loadLibrary,GetProcAddress ...

marz posted @ Sep 07, 2010 11:52:08 PM in win32 with tags tips tricks Win32 , 2266 readers

 

IDirectDraw *DynamicDirectDrawCreate(void) {
typedef HRESULT (WINAPI *DirectDrawCreateFunc)
(
GUID FAR *guid,
IDirectDraw FAR **device,
IUnknown FAR *unknown
);
 
HMODULE library;
DirectDrawCreateFunc create;
IDirectDraw *device;
 
library = LoadLibrary("ddraw.dll");
 
if(!library) {
return NULL;
}
 
create = (DirectDrawCreateFunc) GetProcAddress(library, "DirectDrawCreate");
 
if(!create) {
return NULL;
}
 
create(0, &device, 0);
 
return device;
}

Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter