Load DLL in program
-
Hi, I need help to load a third party DLL in my program. This DLL is not registring through regsvr32.
-
Hi, I need help to load a third party DLL in my program. This DLL is not registring through regsvr32.
For starters, look up LoadLibarary() and GetProcAddress(). If you're trying to use COM objects that are in the DLL, but aren't being registered properly, then you'll need to contact the author of the DLL. --Mike-- http://home.inreach.com/mdunn/ Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese? Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
-
For starters, look up LoadLibarary() and GetProcAddress(). If you're trying to use COM objects that are in the DLL, but aren't being registered properly, then you'll need to contact the author of the DLL. --Mike-- http://home.inreach.com/mdunn/ Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese? Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
Can you explain me a little about LoadLibrary. coz I don't know any functions in that DLL
-
Can you explain me a little about LoadLibrary. coz I don't know any functions in that DLL
LoadLibrary, just load's the dll, so you can call functions in it. You need to have a function prototype to call a function in a dll. Lets make a function that will register a com-dll (just like regsvr32.exe does): typedef void (*f)(void); BOOL MyFuncCallsADLL(TCHAR* szDll) { f pf; // our function pointer HINSTANCE hDll = LoadLibrary(szDll); if(hDll == NULL) return FALSE; // we couldnt load library //get function address pf = (f)GetProcAddress(hDll, _T("DllRegisterServer")); if(pf == NULL) { FreeLibrary(hDll); return FALSE; //we couldn locate the function } //lets call that method pf(); FreeLibrary(hDll); return TRUE; } ;P