Register a DLL via COM under Windows Mobile

0.00 avg. rating (0% score) - 0 votes
On Windows XP, one can register a COM DLL by using regsvr32. On Windows CE, there is a similiar tool called regsvrce.exe.

The DLL must export the following function for registration to be successful:

STDAPI DllRegisterServer()
{
return AMovieDllRegisterServer2( TRUE );
}

STDAPI DllUnregisterServer()
{
return AMovieDllRegisterServer2( FALSE );
}

extern “C” BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);

BOOL APIENTRY DllMain(HANDLE hModule,
DWORD dwReason
,
LPVOID lpReserved
)
{
return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}


If the DLL is built in Visual Studio 2005, an export file (extension .DEF) needs to be created:

EXPORTS
DllMain PRIVATE
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
0.00 avg. rating (0% score) - 0 votes
ToughDev

ToughDev

A tough developer who likes to work on just about anything, from software development to electronics, and share his knowledge with the rest of the world.

Leave a Reply