nerd_boy
Joined: 07 Oct 2007
Posts: 4
|
 Trying to make a little menu resource and decided to make one menu similar to Notepad's. Between a few tutorials and google, I managed somewhat decently. However, when I try to compile this, line 107 gives me an error. This is based off of the menu code that sulaiman converted from masm to fasm. *HIS* code compiles without any problem, whereas mine doesn't. After going through at least twenty pages back in the Windows forum and Googling like crazy, I've broken down and decided to seek help.
Again, line 107,which I've marked, is what fasm claims to be the culprit. Any and all help is much appreciated.
; CodeCoder
;
; - A program to implement, debug, and otherwise create an environment to test
; the code editor editor.
format PE GUI 4.0
entry start
include "C:\Documents and Settings\nerd_boy\Desktop\FASM\INCLUDE\win32a.inc"
section '.data' data readable writeable
;Windows Creation Specific Stuff Here
szClass db "CodeCoderClass",0
szTitle db "Code Coder Thingy(Completely not ripping off of Code Jotter)",0
hInstance dd ?
hMainWnd dd ?
msg MSG
wc WNDCLASSEX
section '.code' code readable writeable executable
start:
;get the instance of this program
invoke GetModuleHandle,0
mov [hInstance],eax
;setup the window
mov [wc.hInstance],eax
xor eax,eax
mov [wc.cbSize],sizeof.WNDCLASSEX
mov [wc.style],eax
mov [wc.cbClsExtra],eax
mov [wc.cbWndExtra],eax
mov [wc.lpszMenuName],eax
mov [wc.hIconSm],eax
mov [wc.hbrBackground],COLOR_BTNFACE+1
mov [wc.lpszClassName],szClass
mov [wc.lpfnWndProc],MainWindowProc
invoke LoadIcon,NULL,IDI_APPLICATION
mov [wc.hIcon],eax
invoke LoadCursor,NULL,IDC_ARROW
mov [wc.hCursor],eax
invoke RegisterClassEx,wc
or eax,eax
jz finish
invoke LoadMenu,[hInstance],1
invoke CreateWindowEx,0,szClass,szTitle,WS_VISIBLE+WS_OVERLAPPEDWINDOW,220,220,200,200,HWND_DESKTOP,eax,[hInstance],0
or eax,eax
jz finish
mov [hMainWnd],eax
invoke ShowWindow,eax,SW_SHOW
message_loop:
invoke GetMessage,msg,NULL,0,0
or eax,eax
jz finish
invoke TranslateMessage,msg
invoke DispatchMessage,msg
jmp message_loop
finish:
invoke ExitProcess,0
proc MainWindowProc hWnd,uMsg,wparam,lparam
push ebx esi edi
mov eax,[uMsg]
cmp eax,WM_DESTROY
je .wmdestroy
.defwndproc:
invoke DefWindowProc,[hWnd],[uMsg],[wparam],[lparam]
jmp .finish
.wmdestroy:
invoke PostQuitMessage,0
xor eax,eax
.finish:
pop edi esi ebx
ret
endp
include "CodeEditor.asm"
section '.idata' import data readable writable
library kernel32,'KERNEL32.DLL',\
user32,'USER32.DLL'
import kernel32,\
GetModuleHandle, 'GetModuleHandleA',\
ExitProcess, 'ExitProcess'
import user32,\
RegisterClassEx, 'RegisterClassExA',\
CreateWindowEx, 'CreateWindowExA',\
DefWindowProc, 'DefWindowProcA',\
ShowWindow, 'ShowWindowA',\
LoadCursor, 'LoadCursorA',\
LoadIcon, 'LoadIconA',\
LoadMenu, 'LoadMenuA',\
GetMessage, 'GetMessageA',\
MessageBox, 'MessageBoxA',\
TranslateMessage, 'TranslateMessage',\
DispatchMessage, 'DispatchMessageA',\
PostQuitMessage, 'PostQuitMessageA'
section '.rsrc' resource data readable
directory RT_MENU,menus
resource menus,1,LANG_ENGLISH,menuMain
menu menuMain ;<--- THIS IS LINE 107, THE CULPRIT!
menuitem 'File',10,MFR_POPUP
menuitem 'New',11,MFT_STRING
menuitem 'Open',12,MFT_STRING
menuitem 'Save',13,MFT_STRING
menuitem 'Save As',14,MFT_STRING
menuseparator
menuitem 'Exit',15,MFR_END
menuitem 'Edit',20,MFR_POPUP
menuitem 'Undo',21,MFT_STRING
menuseparator
menuitem 'Copy',22,MFT_STRING
menuitem 'Cut',23,MFT_STRING
menuitem 'Paste',24,MFT_STRING
menuitem 'Delete',25,MFT_STRING
menuseparator
menuitem 'Select All',26,MFR_END
menuitem 'Format',30,MFR_POPUP
menuitem 'WordWrap',31,MFT_STRING
menuitem 'Font',32,MFT_STRING
menuitem 'Highlighting',33,MFT_STRING
menuitem 'AutoComplete',34,MFR_END
menuitem 'Help',40,MFR_POPUP
menuitem 'About CodeCoder',41,MFR_END
_________________ --nerd_boy
|