Hellow;
How to create the Resource DLL, for example, load from program ICON, Bitmap, StringTable, etc.
Using Dev-C++ compiler version 4.9.9.0, SO XP Professional. And how calling from the program?????
Bye
Hellow;
How to create the Resource DLL, for example, load from program ICON, Bitmap, StringTable, etc.
Using Dev-C++ compiler version 4.9.9.0, SO XP Professional. And how calling from the program?????
Bye
Create the typlical win32 program with:
Or something like that.Code:#define WIN32_LEAN_AND_MEAN #include <windows.h> int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { MessageBox( NULL, "This program contains image and sound resources.\nPlease run WarkExec.exe to view resources.", "WarkData", MB_OK | MB_ICONSTOP ); return 0; }
Then just put your resources in your RC file.
And to get the resources from somthing you need have the instance, and to do that:
Simple as that.Code:HINSTANCE hRc = LoadLibrary("WarkData.dll");
Hello:
Thanks very much Cool-August.
I to find in the forum, following links, hot to create DLL Resource:
http://msdn.microsoft.com/library/de...ml/ch21-02.asp
Good-Bye.....
Hellow:
Problem, Not load the icon from recursos.dll.
Code:static HWND lblIcon; /* Load DLL */ static HINSTANCE libreria;The recursos.dll file :Code:case WM_CREATE: // Load recursos.dll if ((libreria = LoadLibrary (TEXT ("recursos.dll"))) == NULL) { MessageBox (hwnd, TEXT ("No se puede cargar = recursos.dll."), "Error dll", 0) ; return -1 ; } : : lblIcon = CreateWindowEx( 0,"static","",WS_CHILD|WS_VISIBLE|SS_ICON|WS_BORDER,250,35,30,30,hwnd, (HMENU)0,inst,NULL); SendMessage(lblIcon,WM_SETICON,ICON_SMALL, (LPARAM)(HICON)LoadIcon(libreria,MAKEINTRESOURCE(1)));
File dllmain.cpp :
File rcDLL.rc :Code:#include <windows.h> // BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ , DWORD reason /* Reason this function is being called. */ , LPVOID reserved /* Not used. */ ) { /* Returns TRUE on success, FALSE on failure */ return TRUE; }
Good.Code:#include <windows.h> //#include "dll.h" /* ---------- ICONO ------------- */ /*-- Number TipResource Details --*/ 1 ICON DISCARDABLE "rc/logo.ico" /*--------- Version DLL -------------------*/ 100 VERSIONINFO FILEVERSION 1,0,0,0 PRODUCTVERSION 1,0,0,0 FILEOS 0x4 FILETYPE 0x0 { BLOCK "StringFileInfo" { BLOCK "000004E4" { VALUE "CompanyName", "Consultor Forestal" VALUE "FileDescription", "Rsource DLL" VALUE "InternalName", "recursos.dll" VALUE "LegalTrademarks", "Consultor" VALUE "OriginalFilename", "recursos.dll" VALUE "ProductName", "Procesos de Aserrio" VALUE "FileVersion", "1,1,0,0" VALUE "ProductVersion", "1,1,0,0" VALUE "PrivateBuild", "Creado por Alejandro Ramírez en Dev-C++ v.4.9.9.0" } }
Send a STM_SETIMAGE message to associate an icon with a static control with the SS_ICON style and not WM_SETICON as you have done.
You should also consider breaking your code up into smaller individual statements, at least while you are debugging, so that you can test the return values of api functions like LoadIcon (or LoadImage) and use GetLastError to give you information about problems as they arise.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.