Hi,
A few weeks back I modified my code and found that i cannot work anymore. In the file Intoxicator.asm, this code will always return NULL from what I got in my debugger and the error will always be "Invalid Window Handle" even though I never changed this line of code and it worked in previous versions of my program:
invoke CreateDialogParam, hInstance, IDD_DIALOG2, hTabCtrl, OFFSET DialogProc, 0
Please take a look and my code and help me. Thnx in advance.
--- attachment removed, please read the rules ---
A few weeks back I modified my code and found that i cannot work anymore. In the file Intoxicator.asm, this code will always return NULL from what I got in my debugger and the error will always be "Invalid Window Handle" even though I never changed this line of code and it worked in previous versions of my program:
invoke CreateDialogParam, hInstance, IDD_DIALOG2, hTabCtrl, OFFSET DialogProc, 0
Please take a look and my code and help me. Thnx in advance.
--- attachment removed, please read the rules ---
I don't think you will get much help here.
Did you read the forum rules?
Did you read the forum rules?
What is so bad about CreateDialogParam? Anyway if you are getting an error message that says invalid window handle then I'm guessing hTabCtrl is an invalid window handle?
Strange situation,what about is it?
This current attachment has no spamming code. ANyways, CreateDialogParam returns NULL for any HWND handles that i supply.
You specify a child window as owner of a dialog. I guess that is not allowed, even if your dialog is a WS_CHILD as well.
i copied and pasted your code and everything works, i did not use your data section however so I am guessing this is where the problem lyes
and btw, of course you can make a dialog a child of another window, thats what tab controls are all about... and imho u should use the property sheet api to create tab controls because regular tab controls and windows xp dont mix.
and btw, of course you can make a dialog a child of another window, thats what tab controls are all about... and imho u should use the property sheet api to create tab controls because regular tab controls and windows xp dont mix.
Thanx for the advice, but can you please send me your code? Thnx.
its a little banged up... but essentially the same =/
Sorry to be bothering again, but I still can't find the irritating bug. I've tried searching the whole source code, but I couldn't find any, so I haf included all my source code, but I haf removed the email spamming module. SO thnx in advance for any help.
In your source you specify:
invoke CreateDialogParam, hInstance, IDD_DIALOG2, hTabCtrl, OFFSET WndProc, 0
WndProc is a window proc, but it should be a dialog proc (with no calls to DefWindowProc allowed)
And a richedit control in a dialog requires to load that library before.
invoke CreateDialogParam, hInstance, IDD_DIALOG2, hTabCtrl, OFFSET WndProc, 0
WndProc is a window proc, but it should be a dialog proc (with no calls to DefWindowProc allowed)
And a richedit control in a dialog requires to load that library before.
Tried your advice, but it still returns the same error. One thing to note though my current way of putting it in the WndProc function worked in my last version even though there was DefWindowProc.
to get it runnin all u need to do is add this before you start creating dialogs...
Dont change that defwindowproc mess, it fails for some odd ball reason =/
.data
szRicheditDll db "riched32.dll", 0
.code
invoke LoadLibrary, addr szRicheditDll
Dont change that defwindowproc mess, it fails for some odd ball reason =/
Yeah, I tried that, but it doesnt work. Even when i remove the richedit control totally. Thnx a lot, anyways.