# Error registering DLL



## Aftab (Oct 15, 2003)

I have created a DLL in Visual C++ 6, for use in Visual Basic 6. Initially I couldn't get it to work in VB, so i tried registering the DLL and I got the error "filerpl.dll was loaded, but the DLLregisterserver entry point was not found etc...". Finally, I figured out why I couldn't call the function exported by my DLL and I got it working (basically the declaration statement was wrong). Now It's working fine I can call it from VB, but I still can't register the DLL, I get the same error. Is this a serious error? does it actually need to be registered? if not what about when I need to use it on another machine, does it need to be registered then. Any help appreciated.


----------



## coderitr (Oct 12, 2003)

It depends on what you're doing. If you can run the code in the DLL without registering it, then skip it. Registering a library like this generally creates GUID entries in the registry for the objects created and manipulated by your code. 

Disclaimer: I don't write DLL code like this so I may be completely out in left field here. I'd try it and see if it works. You may not have to register it at all.


----------



## velu (Jul 8, 2005)

Aftab,
I have the same problem. U have mentioned below that u have solved the problem.

I have created a simple dll like this.

Please let me know what is missing

BOOL APIENTRY DllMain( HANDLE hModule, 
DWORD ul_reason_for_call, 
LPVOID lpReserved
)
{
return TRUE;
}

void concatUser(char* user,char* newUser)
{
strcpy(newUser,"My Name is ");
strcat(newUser,user);
}



Aftab said:


> I have created a DLL in Visual C++ 6, for use in Visual Basic 6. Initially I couldn't get it to work in VB, so i tried registering the DLL and I got the error "filerpl.dll was loaded, but the DLLregisterserver entry point was not found etc...". Finally, I figured out why I couldn't call the function exported by my DLL and I got it working (basically the declaration statement was wrong). Now It's working fine I can call it from VB, but I still can't register the DLL, I get the same error. Is this a serious error? does it actually need to be registered? if not what about when I need to use it on another machine, does it need to be registered then. Any help appreciated.


----------



## Aftab (Oct 15, 2003)

Please give me some more information. Can you call your exported function from VB or not? Can you register the DLL or not?


----------



## freim (Jul 9, 2005)

Basically a DLL needs registration if it is a COM server (aka ActiveX control, aka OLE control, aka OCX control). If it is just a DLL containing some directly called functions, then you don't need to register it.

*velu* 
_Please let me know what is missing_

You omitted four required exportable functions:
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer​
That is if you do want to create an ActiveX control. Better use a wizard - it will take care about server registration and all such.

Hope this helps


----------

