Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can I get the first file of FindFile? Pin
Gero Gerber29-Mar-01 7:16
Gero Gerber29-Mar-01 7:16 
AnswerRe: How can I get the first file of FindFile? Pin
Wayne Fuller29-Mar-01 8:13
Wayne Fuller29-Mar-01 8:13 
QuestionHow to create button at Run-Time ?? Pin
Vistac29-Mar-01 6:48
Vistac29-Mar-01 6:48 
AnswerRe: How to create button at Run-Time ?? Pin
Christian Graus29-Mar-01 12:35
protectorChristian Graus29-Mar-01 12:35 
GeneralRe: How to create button at Run-Time ?? Pin
Vistac29-Mar-01 15:14
Vistac29-Mar-01 15:14 
Generalforms Pin
29-Mar-01 3:57
suss29-Mar-01 3:57 
GeneralWindows 95 and resource problem Pin
AndyC29-Mar-01 3:53
AndyC29-Mar-01 3:53 
GeneralRe: resource problem Pin
Paolo Messina29-Mar-01 7:06
professionalPaolo Messina29-Mar-01 7:06 
I have a similar (but different) problem with animated cursors in the app's resources. Strangely, when I build with Static MFC Libs my call to LoadIcon returns NULL, while it works perfectly with MFC DLLs. This happens both in Debug and Release builds.

I tried every method to load an icon from the resources:
HCURSOR hAniCur = ::LoadCursor(AfxFindResourceHandle(MAKEINTRESOURCE(IDR_HOURGLASS),
	RT_ANICURSOR), MAKEINTRESOURCE(IDR_HOURGLASS));

HCURSOR hAniCur = (HCURSOR)LoadImage(NULL, GetModuleHandle(NULL),
	MAKEINTRESOURCE(IDR_HOURGLASS), IMAGE_CURSOR, 0, 0, LR_DEFAULTCOLOR);

HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_HOURGLASS), _T("ANICUR"));
DWORD dwResSize = SizeofResource(NULL, hResInfo);
HGLOBAL hRes = LoadResource(NULL, hResInfo);
PBYTE pResData = (PBYTE)LockResource(hRes);

HCURSOR hAniCur = CreateIconFromResource(pResData, dwResSize, FALSE, 0x00030000);

None of these methods works when linking with static libraries. I found a work-around some time ago, that can seem absurd, but really works on Win2000 and Win95, but not on WinME (and possibly others):
HRSRC hResInfo = FindResource(NULL, MAKEINTRESOURCE(IDR_HOURGLASS), _T("ANICUR"));
DWORD dwResSize = SizeofResource(NULL, hResInfo);
HGLOBAL hRes = LoadResource(NULL, hResInfo);
PBYTE pResData = (PBYTE)LockResource(hRes);
PBYTE pResCopy = new BYTE[dwResSize];
MoveMemory(pResCopy, pResData, dwResSize);

HCURSOR hAniCur = CreateIconFromResource(pResData, dwResSize, FALSE, 0x00030000);

That is copying the just loaded icon makes the system happy. Confused | :confused:

I finally gave up when I tried this on ME...
But I suspect a bug in the resource compiler, because when I remove *all* the standard MFC resources automatically included in the app's resource script, everything is fine even with static libraries.

I also tried to extract my app's resources with other tools, to see if they were ok, I even compared the extracted resources with those of my dinamically linked app, but they were identical.

What to say? I even thought to download debug symbols for my system DLLs, to debug the call to LoadCursor and the others... but I have no will to do it.

All my comprehension,
Paolo.
QuestionHow I can play mp3 files from my program Pin
Ahmad29-Mar-01 3:16
Ahmad29-Mar-01 3:16 
AnswerRe: How I can play mp3 files from my program Pin
Thierry Marneffe29-Mar-01 4:21
Thierry Marneffe29-Mar-01 4:21 
AnswerRe: How I can play mp3 files from my program Pin
Thierry Marneffe29-Mar-01 4:21
Thierry Marneffe29-Mar-01 4:21 
AnswerRe: How I can play mp3 files from my program Pin
Christian Graus29-Mar-01 12:39
protectorChristian Graus29-Mar-01 12:39 
GeneralCall Stack Debug Window in VC6 Pin
jerry0davis28-Mar-01 23:46
jerry0davis28-Mar-01 23:46 
GeneralRe: Call Stack Debug Window in VC6 Pin
Tim Deveaux29-Mar-01 4:41
Tim Deveaux29-Mar-01 4:41 
GeneralOLE DoVerb() problem Pin
28-Mar-01 23:27
suss28-Mar-01 23:27 
GeneralRe: OLE DoVerb() problem Pin
28-Mar-01 23:45
suss28-Mar-01 23:45 
GeneralRe: OLE DoVerb() problem Pin
29-Mar-01 0:19
suss29-Mar-01 0:19 
QuestionHow to make splitter windows scroll synchronously? Pin
28-Mar-01 22:28
suss28-Mar-01 22:28 
GeneralCursor problem Pin
Wolfram Steinke28-Mar-01 14:10
Wolfram Steinke28-Mar-01 14:10 
GeneralRe: Cursor problem Pin
Christian Graus28-Mar-01 15:11
protectorChristian Graus28-Mar-01 15:11 
GeneralHelp de-activating system menu in window Pin
Peter Sjöström28-Mar-01 6:49
Peter Sjöström28-Mar-01 6:49 
GeneralRe: Help de-activating system menu in window Pin
Sir Gras of Berger28-Mar-01 9:30
Sir Gras of Berger28-Mar-01 9:30 
GeneralRe: Help de-activating system menu in window Pin
Peter Sjöström28-Mar-01 21:32
Peter Sjöström28-Mar-01 21:32 
GeneralHelp de-activating system menu in window Pin
Peter Sjöström28-Mar-01 6:48
Peter Sjöström28-Mar-01 6:48 
QuestionFlickering...? Pin
Manfred Ramosch28-Mar-01 3:45
Manfred Ramosch28-Mar-01 3:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.