hi,

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?

[edit]
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...
[/edit]

solved.

the lack of a .def file was indeed the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.