News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

i dont know whats exactly hapening?

Started by trodon, October 17, 2006, 01:23:59 AM

Previous topic - Next topic

trodon

hi, i was geting very strange error and i can get any conclusion wtf is hapening with me
am i making some mistake or something is wrong, i was make simple dialogbox with one button that when i press this button plays beep
ok, beep's  play fine, but when i insert manifest (xp style) in rsrc and compile my exefile and run
my dialog beeping all the time when i move mouse to button.
can someone look intro my stupid code and tell me if i am cr4zy or what?

thanks in advance.

[attachment deleted by admin]

jdoe

The problem is DlgProc. wParam is your button ID on the WM_COMMAND message.



DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM

   mov eax,uMsg
   .if eax==WM_COMMAND
       .if wParam==1001
           invoke Beep,100h,100h
       .endif
   .elseif eax==WM_CLOSE
       invoke EndDialog,hWin,0
   .else
       mov eax,FALSE
       ret
   .endif
   mov eax,TRUE
   ret

DlgProc endp



trodon

hi jdoe, thanks for the ansver.
i know but i am totaly comfuzed, why this works perfectly when i dont include manifest xp style in resource
and then when include stupid code goo mad  :bg?

gabor

Hello!


I am sorry I don't know much about this manifest thing, but. Is it really okay, that in your .RES file (this should be the binary of your resources) there is the whole xml file. Should be a string in the resource or what? Are you sure that you are including this xml properly?

Greets, Gábor

trodon

hi gabor, no, including manifest is ok this only need 1 24 location of manifest.xml
i was check and its ok, xp style was show fine but when i move mouse to button i get beep-ing
when i remove manifest its works fine
i was try to enter code propertly in
.if eax==WM_COMMAND
.if eax==1001
invoke beep,100h,100h


and this works fine with manifest, but in this way i attached not work, i realy dont have idea why xp style take controll of this code
i would like to know this, thats break all theory in my head, how simple rsrc can affect on this  code?  :bg

Tedd

Your manifest and its inclusion are working fine (as far as I can tell.)
The reason it acted strangely was down to the error that jdoe pointed out.
But why should this make it beep all the time? Well, it was beeping whenever the button got a message, which it will every time the mouse moves over it, it clicked, etc.
So why does the manifest make this happen? When you add the manifest, it causes a different version of the button class to be used (which is why it's drawn differently) this means the code it's using is also different. There must be a certain difference between them that causes the message to be posted where wParam is the id of your button and thus your program was beeping.
No snowflake in an avalanche feels responsible.