Guest sonic_00 Posted July 12, 2007 Share Posted July 12, 2007 I'm back (after months ) well i'm trying to learn MASM and i've copied the code of lioczar's tutorial on a new file in Quick Editor, just to see if it works, but it doesn't. Why? The code: .386.model flat, stdcallinclude \masm32\include\windows.inc include \masm32\include\user32.incinclude \masm32\include\kernel32.incincludelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib.DATA ClassName db "SimpleWinClass",0 AppName db "Our First Window",0 .DATA? hInstance HINSTANCE ? CommandLine LPSTR ?.CODE start:invoke GetModuleHandle, NULL mov hInstance,eaxinvoke GetCommandLine mov CommandLine,eaxinvoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:SDWORDLOCAL wc:WNDCLASSEX LOCAL msg:MSGLOCAL hwnd:HWNDmov wc.cbSize,SIZEOF WNDCLASSEX mov wc.style, CS_HREDRAW or CS_VREDRAWmov wc.lpfnWndProc, OFFSET WndProcmov wc.cbClsExtra,NULLmov wc.cbWndExtra,NULLpush hInstancepop wc.hInstancemov wc.hbrBackground,COLOR_WINDOW+1mov wc.lpszMenuName,NULLmov wc.lpszClassName,OFFSET ClassNameinvoke LoadIcon,NULL,IDI_APPLICATIONmov wc.hIcon,eaxmov wc.hIconSm,0invoke LoadCursor,NULL,IDC_ARROWmov wc.hCursor,eaxinvoke RegisterClassEx, addr wc invoke CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInst,NULLmov hwnd,eaxinvoke ShowWindow, hwnd,CmdShow invoke UpdateWindow, hwnd .WHILE TRUE invoke GetMessage, ADDR msg,NULL,0,0.BREAK .IF (!eax)invoke TranslateMessage, ADDR msginvoke DispatchMessage, ADDR msg.ENDWmov eax,msg.wParam retWinMain endpWndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAMmov eax,uMsg .IF eax==WM_DESTROY invoke PostQuitMessage,NULL xor eax,eax.ELSEinvoke DefWindowProc,hWnd,uMsg,wParam,lParam .ENDIFretWndProc endpend start Link to comment
F0X Posted July 12, 2007 Share Posted July 12, 2007 what doesn't work?.. maybe u need the .inc files set up.. or the directory's.. be more specific please! Link to comment
Loki Posted July 13, 2007 Share Posted July 13, 2007 Give us the error messages you get when compiling. Link to comment
Guest sonic_00 Posted July 13, 2007 Share Posted July 13, 2007 Give us the error messages you get when compiling.Assembling: C:\masm32\apps\test2.asm\masm32\include\windows.inc(122) : error A2004: symbol type conflict : bool\masm32\include\windows.inc(7088) : error A2179: structure improperly initialized\masm32\include\windows.inc(7088) : error A2008: syntax error : in structure\masm32\include\windows.inc(7990) : error A2179: structure improperly initialized\masm32\include\windows.inc(7990) : error A2008: syntax error : in structure\masm32\include\windows.inc(8003) : error A2179: structure improperly initialized\masm32\include\windows.inc(8003) : error A2008: syntax error : in structure\masm32\include\windows.inc(8015) : error A2179: structure improperly initialized\masm32\include\windows.inc(8015) : error A2008: syntax error : in structure\masm32\include\windows.inc(8020) : error A2179: structure improperly initialized\masm32\include\windows.inc(8020) : error A2008: syntax error : in structure\masm32\include\windows.inc(8025) : error A2179: structure improperly initialized\masm32\include\windows.inc(8025) : error A2008: syntax error : in structure\masm32\include\windows.inc(8030) : error A2179: structure improperly initialized\masm32\include\windows.inc(8030) : error A2008: syntax error : in structure\masm32\include\windows.inc(8035) : error A2179: structure improperly initialized\masm32\include\windows.inc(8035) : error A2008: syntax error : in structure\masm32\include\windows.inc(8042) : error A2179: structure improperly initialized\masm32\include\windows.inc(8042) : error A2008: syntax error : in structure\masm32\include\windows.inc(8049) : error A2179: structure improperly initialized\masm32\include\windows.inc(8049) : error A2008: syntax error : in structure\masm32\include\windows.inc(8056) : error A2179: structure improperly initialized\masm32\include\windows.inc(8056) : error A2008: syntax error : in structure\masm32\include\windows.inc(8061) : error A2179: structure improperly initialized\masm32\include\windows.inc(8061) : error A2008: syntax error : in structure\masm32\include\windows.inc(8067) : error A2179: structure improperly initialized\masm32\include\windows.inc(8067) : error A2008: syntax error : in structure\masm32\include\windows.inc(8075) : error A2179: structure improperly initialized\masm32\include\windows.inc(8075) : error A2008: syntax error : in structure\masm32\include\windows.inc(8076) : error A2179: structure improperly initialized\masm32\include\windows.inc(8076) : error A2008: syntax error : in structure\masm32\include\windows.inc(8080) : error A2179: structure improperly initialized\masm32\include\windows.inc(8080) : error A2008: syntax error : in structure\masm32\include\windows.inc(8086) : error A2179: structure improperly initialized\masm32\include\windows.inc(8086) : error A2008: syntax error : in structure\masm32\include\windows.inc(8093) : error A2179: structure improperly initialized\masm32\include\windows.inc(8093) : error A2008: syntax error : in structure\masm32\include\windows.inc(8100) : error A2179: structure improperly initialized\masm32\include\windows.inc(8100) : error A2008: syntax error : in structure\masm32\include\windows.inc(8105) : error A2179: structure improperly initialized\masm32\include\windows.inc(8105) : error A2008: syntax error : in structure\masm32\include\windows.inc(8113) : error A2179: structure improperly initialized\masm32\include\windows.inc(8113) : error A2008: syntax error : in structure\masm32\include\windows.inc(8120) : error A2179: structure improperly initialized\masm32\include\windows.inc(8120) : error A2008: syntax error : in structure\masm32\include\windows.inc(8128) : error A2179: structure improperly initialized\masm32\include\windows.inc(8128) : error A2008: syntax error : in structure\masm32\include\windows.inc(8135) : error A2179: structure improperly initialized\masm32\include\windows.inc(8135) : error A2008: syntax error : in structure\masm32\include\windows.inc(8145) : error A2179: structure improperly initialized\masm32\include\windows.inc(8145) : error A2008: syntax error : in structure\masm32\include\windows.inc(8146) : error A2179: structure improperly initialized\masm32\include\windows.inc(8146) : error A2008: syntax error : in structure\masm32\include\windows.inc(8150) : error A2179: structure improperly initialized\masm32\include\windows.inc(8150) : error A2008: syntax error : in structure\masm32\include\windows.inc(8151) : error A2179: structure improperly initialized\masm32\include\windows.inc(8151) : error A2008: syntax error : in structure\masm32\include\windows.inc(8156) : error A2179: structure improperly initialized\masm32\include\windows.inc(8156) : error A2008: syntax error : in structure\masm32\include\windows.inc(8162) : error A2179: structure improperly initialized\masm32\include\windows.inc(8162) : error A2008: syntax error : in structure\masm32\include\windows.inc(8169) : error A2179: structure improperly initialized\masm32\include\windows.inc(8169) : error A2008: syntax error : in structure\masm32\include\windows.inc(8176) : error A2179: structure improperly initialized\masm32\include\windows.inc(8176) : error A2008: syntax error : in structure\masm32\include\windows.inc(8182) : error A2179: structure improperly initialized\masm32\include\windows.inc(8182) : error A2008: syntax error : in structure\masm32\include\windows.inc(8193) : error A2179: structure improperly initialized\masm32\include\windows.inc(8193) : error A2008: syntax error : in structure\masm32\include\windows.inc(8201) : error A2179: structure improperly initialized\masm32\include\windows.inc(8201) : error A2008: syntax error : in structure\masm32\include\windows.inc(8212) : error A2179: structure improperly initialized\masm32\include\windows.inc(8212) : error A2008: syntax error : in structure\masm32\include\windows.inc(8224) : error A2179: structure improperly initialized\masm32\include\windows.inc(8224) : error A2008: syntax error : in structure\masm32\include\windows.inc(8232) : error A2179: structure improperly initialized\masm32\include\windows.inc(8232) : error A2008: syntax error : in structure\masm32\include\windows.inc(8240) : error A2179: structure improperly initialized\masm32\include\windows.inc(8240) : error A2008: syntax error : in structure\masm32\include\windows.inc(8251) : error A2179: structure improperly initialized\masm32\include\windows.inc(8251) : error A2008: syntax error : in structure\masm32\include\windows.inc(8262) : error A2179: structure improperly initialized\masm32\include\windows.inc(8262) : error A2008: syntax error : in structure\masm32\include\windows.inc(8271) : error A2179: structure improperly initialized\masm32\include\windows.inc(8271) : error A2008: syntax error : in structure\masm32\include\windows.inc(8279) : error A2179: structure improperly initialized\masm32\include\windows.inc(8279) : error A2008: syntax error : in structure\masm32\include\windows.inc(8288) : error A2179: structure improperly initialized\masm32\include\windows.inc(8288) : error A2008: syntax error : in structure\masm32\include\windows.inc(8295) : error A2179: structure improperly initialized\masm32\include\windows.inc(8295) : error A2008: syntax error : in structure\masm32\include\windows.inc(8300) : error A2179: structure improperly initialized\masm32\include\windows.inc(8300) : error A2008: syntax error : in structure\masm32\include\windows.inc(8306) : error A2179: structure improperly initialized\masm32\include\windows.inc(8306) : error A2008: syntax error : in structure\masm32\include\windows.inc(8325) : error A2179: structure improperly initialized\masm32\include\windows.inc(8325) : error A2008: syntax error : in structure\masm32\include\windows.inc(8346) : error A2179: structure improperly initialized\masm32\include\windows.inc(8346) : error A2008: syntax error : in structure\masm32\include\windows.inc(8375) : error A2179: structure improperly initialized\masm32\include\windows.inc(8375) : fatal error A1012: error count exceeds 100; stopping assemblyit seems that the errors are in windows.inc file...but i'm not sure... Link to comment
Loki Posted July 13, 2007 Share Posted July 13, 2007 What command are you using to compile it?And (forgive the stupi but obvious question) have you definately installed to c:\MASM? Link to comment
Guest sonic_00 Posted July 13, 2007 Share Posted July 13, 2007 (edited) 1) from QEDITOR: Project/Assemble ASM file (or Project/Assemble & Link, same result) 2) C:\masm32... i've not done something strange, just installed it with the setup procedure... what a mistery... Edited July 13, 2007 by sonic_00 Link to comment
Loki Posted July 13, 2007 Share Posted July 13, 2007 Is there a link to this tut online? Googled for lioczar but got nothing Link to comment
Guest sonic_00 Posted July 13, 2007 Share Posted July 13, 2007 argh! i've done a mistake! the author is Iczelion... i'm studying on his tut...third lesson...but my copy of the tut is translated in italian, so if i give you the link i think you wouldn't understand anything... link to the tut Link to comment
Loki Posted July 13, 2007 Share Posted July 13, 2007 There must be something wrong with your setup - have you rebooted since installing MASM? Not sure if it sets up some env variables which require a reboot? Either reboot or reinstall and then reboot - beyond that I'm stumped I'm afraid.Either way, I just copied the code from tut 3 into QEditor and it compiled and linked fine. Link to comment
Guest sonic_00 Posted July 13, 2007 Share Posted July 13, 2007 (edited) oh my god...i'm unlucky as always... i'll try to reinstall it and reboot Edited July 13, 2007 by sonic_00 Link to comment
Rumour Posted July 13, 2007 Share Posted July 13, 2007 (edited) If installed masm on C:\ only compile C drive from If no work: installate winasmstudio same drive. tools -> options -> files&paths: Edited July 13, 2007 by Rumour Link to comment
Guest sonic_00 Posted July 13, 2007 Share Posted July 13, 2007 ey! i've copied the code from the original tut and it WORKS! so the code in my version was wrong...sorry for all this and thanks for the patience... Link to comment
dmesg Posted July 15, 2007 Share Posted July 15, 2007 You forgot one line however when you're includeding windows.inc, you have to set option casemap:none so your first lines have to look like this: .386.model flat,stdcalloption casemap:none Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now