Click here to Skip to main content
15,910,118 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Please help. Is multimap what I need? Pin
BadJerry29-Mar-05 23:47
BadJerry29-Mar-05 23:47 
GeneralRe: Please help. Is multimap what I need? Pin
knapak30-Mar-05 10:50
knapak30-Mar-05 10:50 
AnswerRe: Please help. Is multimap what I need? Pin
Blake Miller30-Mar-05 4:23
Blake Miller30-Mar-05 4:23 
GeneralRe: Please help. Is multimap what I need? Pin
knapak30-Mar-05 10:50
knapak30-Mar-05 10:50 
GeneralProblem with SetWindowsHookEx() Pin
Dev57829-Mar-05 12:40
Dev57829-Mar-05 12:40 
GeneralRe: Problem with SetWindowsHookEx() Pin
Dev57830-Mar-05 3:57
Dev57830-Mar-05 3:57 
GeneralHINSTANCE requirement Pin
Luther Baker29-Mar-05 11:02
Luther Baker29-Mar-05 11:02 
GeneralRe: HINSTANCE requirement (partial answer only) Pin
David Nash30-Mar-05 14:09
David Nash30-Mar-05 14:09 
Hi Luther,

I can only answer some of the questions you've put here. Hopefully someone else will jump in and answer the remainder.

Regarding HINSTANCE
I only know what's available in MSDN and the platform SDK, and these don't cover what goes on "under the hood" for functions like RegisterClassEx and CreateWindowEx. From experience, using NULL for the HINSTANCE doesn't seem to make much difference (but you already knew that). I don't know the consequence of using NULL for the HINSTANCE in these functions.

HINSTANCE can be important for other things though. One example is the TBADDBITMAP structure for a toolbar must get a real HINSTANCE value (not NULL) to create the toolbar.

The bottom line is that you will probably find you'll need the HINSTANCE of your application to do some things, but you'll get away with NULL for some others. Not a very adequate answer, but there you go.

Regarding RegisterClassEx
You need to call this in your application before it creates a normal window. The name registered for the window is not global, each application needs to register the windows before creating it. Using NULL as the HINSTANCE doesn't make it global or system wide.

Some predefined window types don't need to be registered. These include dialogs, edit controls, tool bars, status bars and so forth. All "general purpose" windows, however, need to be registered in the application that uses them.

By the way, you might find my article "Win32 Framework for SDI Applications" a handy reference. The URL is: http://www.codeproject.com/win32/Framework.asp


regards,
David

If it was easy, anyone could do it.
GeneralRe: HINSTANCE requirement (partial answer only) Pin
Luther Baker31-Mar-05 9:17
Luther Baker31-Mar-05 9:17 
GeneralRe: HINSTANCE requirement (partial answer only) Pin
David Nash31-Mar-05 20:28
David Nash31-Mar-05 20:28 
GeneralRepaint Dialogs Pin
HackPrince29-Mar-05 10:53
HackPrince29-Mar-05 10:53 
GeneralRe: Repaint Dialogs Pin
David Crow29-Mar-05 11:07
David Crow29-Mar-05 11:07 
GeneralRe: Repaint Dialogs Pin
HackPrince29-Mar-05 11:41
HackPrince29-Mar-05 11:41 
GeneralRe: Repaint Dialogs Pin
HackPrince29-Mar-05 11:43
HackPrince29-Mar-05 11:43 
GeneralRe: Repaint Dialogs Pin
David Crow30-Mar-05 5:19
David Crow30-Mar-05 5:19 
Generalmap keystroke to a string in wordpad application Pin
kristna29-Mar-05 9:09
kristna29-Mar-05 9:09 
GeneralRe: map keystroke to a string in wordpad application Pin
David Crow29-Mar-05 11:12
David Crow29-Mar-05 11:12 
GeneralRe: map keystroke to a string in wordpad application Pin
kristna30-Mar-05 10:22
kristna30-Mar-05 10:22 
GeneralRe: map keystroke to a string in wordpad application Pin
David Crow30-Mar-05 10:34
David Crow30-Mar-05 10:34 
GeneralRe: map keystroke to a string in wordpad application Pin
kristna1-Apr-05 8:53
kristna1-Apr-05 8:53 
GeneralHooking CoCreateInstance / CoGetClassObject Pin
peterchen29-Mar-05 5:06
peterchen29-Mar-05 5:06 
GeneralRe: Hooking CoCreateInstance / CoGetClassObject Pin
Michael Dunn29-Mar-05 5:35
sitebuilderMichael Dunn29-Mar-05 5:35 
GeneralRe: Hooking CoCreateInstance / CoGetClassObject Pin
Joel Lucsy29-Mar-05 13:03
Joel Lucsy29-Mar-05 13:03 
QuestionHow to compare two images using cximage Pin
Madhurya29-Mar-05 4:54
Madhurya29-Mar-05 4:54 
AnswerRe: How to compare two images using cximage Pin
Ted Ferenc29-Mar-05 5:23
Ted Ferenc29-Mar-05 5:23 

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.