im creating a win32 dll using VS.NET 2005. actually im creating a COM component so i need to implement DllRegisterServer. The problem is that when i call regsvr32 on the dll, i get the error 'the dll was loaded but the dllRegisterServer entry point was not found'.

Now, the function prototype in my code is the same as it is in MSDN:

STDAPI DllRegisterServer()
  // do registry stuff

and this way i get the error. what is bizzare is that if i change it to:

extern "C" __declspec(dllexport) long DllRegisterServer()
  // do registry stuff

then it registers fine. can someone explain this please?

10 Years
Discussion Span
Last Post by unclepauly

this also happens in VS.NET 2003.

ah ha, i used a tool to view exported functions from dlls and i can see that when i do STDAPI DllRegisterServer, the function is not exported. So im guessing this is the problem. maybe a def fileis the answer...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.