Constructor with Parameter not Firing
Okie dokie. So I am making a listbox class because it was starting to get messy in my Main. Now in order to make it more self contained I needed to pass a lot of information to the new class when it gets made.
The problem is that the constructor doesn't seem to be getting triggered, at least it won't break in Debug inside of the constructor, the window that is supposed to created in the constructor does not.
I am floating through my C++ books and they show a argument constructor demonstration and I mirrored it for mine.
So with no further ado class declaration.
Then we have the beautiful calling code...
/* Constructors */
CListbox( HWND hwnd,
/* Properties */
void hwnd(HWND l_Hwnd);
void hinstance(HINSTANCE l_Hinstance);
/* Methods */
long AddString(char * pItemText);
Now the code compiles (I know that doesn't mean much) and it gets to the AddString call, but the window that was supposed to be drawn in the constructor wasn't drawn.
Now for some odd reason if I add this line....
so now it looks like this
The constructor appears to be triggered and works, the window is drawn, and my string is added.
Here is the implementation code structure fyi.
/* Load Class Variables */
/* Local Variables */
m_Hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
"Listbox", /* Classname */
"", /* Title Text */
lStyleSetting, /* default window */
iStartPosHorizontal, /* Windows decides the position */
iStartPosVertical, /* where the window ends up on the screen */
iWidth, /* The programs width */
iHeight, /* and height in pixels */
m_OwnerHwnd, /* The window is a child-window to main window */
NULL, /* No menu */
m_HInstance, /* Program Instance handler */
NULL /* No Window Creation data */