flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
mns 06 Sep 2011, 16:53
I have tried to call a dialogbox from a main dialogbox but no luck.I think problem is in the .rsrc section.
![]() ![]() source is attached with this
|
|||||||||||
![]() |
|
mns 06 Sep 2011, 17:01
typedef I'm having poor knowladge in windows programming(infact all kind of programming)Please, can you explain more?
|
|||
![]() |
|
mns 06 Sep 2011, 17:20
I used eax but the result is same, no dialog displayed. Are there errors in .rsrc section?
|
|||
![]() |
|
typedef 06 Sep 2011, 17:23
It seems like The first dialog cannot be loaded for some reason. Even if you copy the 2nd dialog to the first one, it still doesn't show. Only the 2nd dialog shows, using MainDlg as it's procedure.
Odd.. |
|||
![]() |
|
mns 06 Sep 2011, 17:30
And if .rsrc section change like below it show the 1st dialog but giving a error when press the button,
directory RT_DIALOG, dialogs2,\ RT_DIALOG, dialogs1,\ RT_MANIFEST,manifest |
|||
![]() |
|
typedef 06 Sep 2011, 17:59
if you could, compare your code with FASMs templates
|
|||
![]() |
|
mns 06 Sep 2011, 18:05
typedef how can I find FASMs templates
![]() |
|||
![]() |
|
typedef 06 Sep 2011, 18:55
in your FASM folder --> fasmw16931\EXAMPLES\DIALOG\DIALOG.ASM
|
|||
![]() |
|
bitRAKE 06 Sep 2011, 19:47
I was able to get the first dialog to show by removing the manifest. There are several errors in the dialog procedure. Register preservation is off balance, leaf functions within proc cannot use RET (which is a macro) -- use RETN instead.
|
|||
![]() |
|
yoshimitsu 07 Sep 2011, 21:49
Apparently, you shouldn't have the same kind of a directory twice, means your code has to look like this:
Code: directory RT_DIALOG, dialogs,\ RT_MANIFEST,manifest resource dialogs,\ IDD_DIALOG1, LANG_ENGLISH + SUBLANG_DEFAULT, main_dialog,\ IDD_DIALOG2, LANG_ENGLISH + SUBLANG_DEFAULT, dialog2 Though, bitRAKE is right, your code is f**ked up to the max.. Code: call .process ; [...] .process: mov eax,1 endp you can't simply jump somewhere without returning.. Code: .wmclose: invoke EndDialog,[hwnddlg],0 ret don't just fill everything with rets.. (also note your push ebx esi edi, your program doesn't crash only because ret inserts a leave, but your registers aren't getting preserved, though.) just do it like this: Code: push ebx cmp [msg],WM_COMMAND je .wmcommand cmp [msg],WM_CLOSE je .wmclose xor eax,eax jmp .finish .wmcommand: ;... jmp .handled .wmclose: invoke EndDialog,[hwnddlg],0 ;fall through .handled: mov eax,1 .finish: pop ebx ret |
|||
![]() |
|
mns 08 Sep 2011, 13:33
thank you very much yoshimitsu,bitRAKE and typedef for your kind help.
![]() One other thing, How can I keep 1st dialog without closing, when closing 2nd dialog ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.