Click here to Skip to main content
15,914,594 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionPlease help. Is multimap what I need? Pin
knapak29-Mar-05 12:58
knapak29-Mar-05 12:58 
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 
As an exercise, I am wrapping some of the lower level win32 structures and methods into a C++ object library.

I'd like to avoid forcing the user to do things like "register" classes. I think this is error prone to have the user make 'one' time calls, so I am trying to take advantage of C++ static properties. Currently, I declare an class (static) ATOM and initialize it with a function that is local to the cpp file.

My question revolves around the HINSTANCE member of the WNDCLASSEX struct. It clear that for win2k+, the hinstance parameter is ignored in the CreateWindowEx function - but what about for the population of WNDCLASSEX and subsequent RegisterClassEx calls?

It seems to work in my demo application (using WNDCLASSEX.hInstance = NULL that is). I have also had luck using the return value of GetModuleHandle.

Any suggestiong? I'd like to know whats going on under the hood. Will these methods work in simple cases and not more complex? I've even done this in a small DLL and seemed to have no problems using absolutely no HINSTANCE in the WNDCLASSEX ....

When one registers a class, is it registered systemwide? so that any HINSTANCE could instantiate it? The documentation says the WNDPROC must exist in the HINSTANCE. When I don't provide a hinstance, maybe it assumes the hinstance the call is being made from and so far, my WNDPROC always exists there?

This all comes back to the question, should I force the user to provide a HINSTANCE and consequently, Register classes explicitly.

Any direction would be appreciated.

Thanks in advance,

-Luther
GeneralRe: HINSTANCE requirement (partial answer only) Pin
David Nash30-Mar-05 14:09
David Nash30-Mar-05 14:09 
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 

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.