Incrustar GIF en dll (Firebreath)

I'm trying to embed a GIF into my plugin but I'm failing to get the resource; this is what I'm doing:

HMODULE hModule = GetModuleHandle(NULL);
HRSRC hResInfo = FindResource(hModule, MAKEINTRESOURCE(201), L"GIF");

That is into the OnPluginReady() event, this is the firebreathWin.rc:

IDB_BITMAP1             GIF                     "C:/loader.gif"

And this into the resource.h:

#define IDB_BITMAP1                     201

The exact same procedure, is working on a console application; but not in my firebreath project.

Using, Visual C++ 2010.

preguntado el 09 de marzo de 12 a las 16:03

HMODULE hModule; GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, L"myDll.dll", &hModule); HRSRC hResInfo = FindResource(hModule, MAKEINTRESOURCE(201), L"GIF"); I've solved the problem that way in case someone needs a solution. -

1 Respuestas

Si nos fijamos en dllmain.cpp you'll see that there is a global HINSTANCE gInstance that you can use:

extern HINSTANCE gInstance;
HRSRC hRes = FindResource(gInstance, MAKEINTRESOURCE(201), L"GIF");

Tú también puedes get the full path and filename of your dll pretty easily from FireBreath if you want to use the other method so that you aren't depending on your filename never changing.

respondido 10 mar '12, 00:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.