Sorry guyz, but could some1 take 1 sec n look at my code, 2 tell me wut's wrong with it? Why my tabs doesn't appear correctly.. :stupid:
Posted on 2003-07-19 18:36:55 by CuTedEvil
Set the top of your tab's child windows to 30 in the RadASM dialog editor. You can edit the top directly using the entry in the Properties box.
Posted on 2003-07-19 21:18:51 by donkey
The error is this:


invoke CreateDialogParam,hInstance,IDD_SEGMENTS,hTab,addr SegmentsProc,0
mov hTabDlg,eax
invoke CreateDialogParam,hInstance,IDD_OPERAND,hTab,addr OperandProc,0
mov hTabDlg[4],eax

Should be:

invoke CreateDialogParam,hWin,IDD_SEGMENTS,hTab,addr SegmentsProc,0
mov hTabDlg,eax
invoke CreateDialogParam,hWin,IDD_OPERAND,hTab,addr OperandProc,0
mov hTabDlg[4],eax

It was a window handle problem and not a size one.

Posted on 2003-07-19 21:24:43 by RobotBob
Here it is with repairs and a working exe.
Posted on 2003-07-19 21:27:05 by RobotBob

Actually i found the solution (like donkey said) and it worked thanks :) but the amazing is that RobotBob's solution made it work too :grin: Dunno why, but thanks alot guyz, i'm back to work.

PS: I started to LUV this place =)

Posted on 2003-07-19 22:25:41 by CuTedEvil

The CreateDialogParam was correct, the first parameter must be hInstance, no idea why it works in your code without it but it may lead to undesired features later if he does not follow the specifications for the API call:
HWND CreateDialogParam( HINSTANCE hInstance,
LPCTSTR lpTemplateName,
HWND hWndParent,
DLGPROC lpDialogFunc,
LPARAM dwInitParam
Mmmmm did the ESP fail us ???
Posted on 2003-07-19 22:32:06 by donkey
I have never use hInstance inside a WinProc.
Always the hwnd parameter passed to winproc.

There are alot of apis that fail unless this is done.
Posted on 2003-07-20 01:20:09 by RobotBob
The hInstance is so that the api can find the resource, outside of that there is never a need for it. It simply identifies the module that the resource needs to be loaded from. I have never seen an api that called for the instance handle fail because it was given. I'd be interested to know which ones so I can avoid problems.
Posted on 2003-07-20 01:35:30 by donkey
I'm interested in ur explanation too :confused:
Posted on 2003-07-20 02:27:55 by CuTedEvil
An instance handle is the starting address of the EXE or DLL in memory where a Window handle is simple a numeric identifier for a Window and they are not the same thing. In an EXE file you can use 400000h which is almost exclusively the start address of an EXE but it does not work in a DLL which can be relocated by the OS to another address if its preferred address is already taken.

Simplest way is to make the instance handle GLOBAL by putting it in the .DATA? section and it then has scope across the whole application. The main purpose of the window handle passed to a WndProc procedure is for the WM_CREATE message where the handle from CreateWindowEx is not yet available but you can use it as well withing the WndProc for any other task.

What happens at times when you fail to specify a window handle is that zero is passed and that is the background handle so it works but for Window specific code, you should pass the correct window handle so that a child window for example has the correct parent window and not the background.

Posted on 2003-07-20 09:20:55 by hutch--
Thanks hutch :alright:
Posted on 2003-07-21 02:54:39 by CuTedEvil