getprocaddress didn't load coinitialize
I am working to load CoInitialize using getprocaddress, but I don't know why this function fail and cash program! It didn't happen with other functions in other libraries like kernel32.dll. Here is my test :
Do you know why and how to properly load it ?
typedef HRESULT (*pf)(LPVOID);
pf rf = (pf)GetProcAddress(LoadLibrary(ole32.dll), "CoInitialize");
CoInitialize(NULL); // This line crashes the program!!
Re: getprocaddress didn't load coinitialize
If you directly call CoInitialize then why do you need to LoadLibrary/GetProcAddress? :confused:
Besides, you have to check the return values of every API call before you use it in the next code stuff