注册 登录
编程论坛 汇编论坛

[求助]为什么新建的窗口只是一闪而过?

maozhong89 发布于 2007-08-17 14:12, 1947 次点击
我用win32 汇编了一个窗口,调试通过了,查看了api函数调用也符合要求,但为什么窗口还只是闪一下就自动关了啊?大概是什么原因?谢谢!!!
13 回复
#2
无理取闹2007-08-17 16:59
把程序放上来
#3
maozhong892007-08-18 10:47
回复:(无理取闹)把程序放上来
这是一个文本编辑器的程序,打的时候没加注释,不好意思啊......
只有本站会员才能查看附件,请 登录

#4
无理取闹2007-08-18 21:15
我编译了你的代码 一屏幕的错误 你还是自己看看吧
#5
maozhong892007-08-19 09:46
回复:(无理取闹)我编译了你的代码 一屏幕的错误 你...
可能是你没把路径设置好吧......难道说不同的编译器结果会不同?
#6
maozhong892007-08-19 11:02
回复:(无理取闹)把程序放上来

麻烦看一下这个rc,怎么运行老报错!谢谢!
#define IDI_ICON1 1100
#define IDM_ABOUT 1000
#define MAINMENU 1002
#define IDM_NEW 1003
#define IDM_OPEN 1004
#define IDM_QUIT 1005
#define IDM_UNDO 1006
#define IDM_CUT 1007
#define IDM_COPY 1008
#define IDM_PASTE 1009
#define IDM_SELALL 1010
#define IDM_DELETE 1011
#define IDM_SAVE 1012
#define IDM_SAVEAS 1013

IDI_ICON1 ICON "edit.ico"

MAINMENU MENUEX
{
POPUP "&File"
{
MENUITEM "&New", IDM_NEW
MENUITEM "&Open\tF3", IDM_OPEN
MENUITEM "&Save\tF2", IDM_SAVE
MENUITEM "Save &As", IDM_SAVEAS
MENUITEM SEPARATOR
MENUITEM "E&xit\tAlt+X", IDM_QUIT
}

POPUP "&Edit"
{
MENUITEM "&Undo\tCtrl+Z", IDM_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", IDM_CUT
MENUITEM "&Copy\tCtrl+C", IDM_COPY
MENUITEM "&Paste\tCtrl+V", IDM_PASTE
MENUITEM "&Delete\tDel", IDM_DELETE
MENUITEM SEPARATOR
MENUITEM "Select &All", IDM_SELALL
}

POPUP "&Help"
{
MENUITEM "&About\tF1", IDM_ABOUT
}
}


MAINACCEL ACCELERATORS
{
VK_F1, IDM_ABOUT, VIRTKEY
VK_F2, IDM_SAVE, VIRTKEY
VK_F3, IDM_OPEN, VIRTKEY
"x", IDM_QUIT, ALT
}

#7
无理取闹2007-08-19 16:02
以下是引用maozhong89在2007-8-19 9:46:54的发言:
可能是你没把路径设置好吧......难道说不同的编译器结果会不同?

你程序里有好多的语法错误 我看了 帮你改了几个 实在太多了

#8
无理取闹2007-08-19 16:03

我改了些 还剩这么多
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

ml /c /coff maozhong1.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.

Assembling: maozhong1.asm
maozhong1.asm(158) : error A2109: only white space or comment can follow backsla
sh
maozhong1.asm(164) : error A2008: syntax error : rectClient
maozhong1.asm(179) : error A2006: undefined symbol : GetCommandArgs
maozhong1.asm(222) : error A2006: undefined symbol : szNULL
maozhong1.asm(222) : error A2114: INVOKE argument type mismatch : argument : 2
maozhong1.asm(225) : error A2008: syntax error : invoke
maozhong1.asm(251) : error A2008: syntax error : mov
maozhong1.asm(267) : error A2008: syntax error : invoke
maozhong1.asm(349) : error A2137: too few arguments to INVOKE
maozhong1.asm(492) : error A2006: undefined symbol : szNULL
maozhong1.asm(492) : error A2114: INVOKE argument type mismatch : argument : 2
maozhong1.asm(243) : error A2006: undefined symbol : IDM_SELALL
maozhong1.asm(293) : error A2006: undefined symbol : OFN_EXPLRER
maozhong1.asm(300) : error A2006: undefined symbol : FAlSE
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x1'
Stop.

Press any key to continue...

#9
maozhong892007-08-20 09:36
回复:(无理取闹)我改了些 还剩这么多 [em03]Micros...
哦实在对不起,我把我原来的程序放上来了,耽误你时间......
帮我看下上面的那段rc程序把,就那个调试通过不了,不知道哪有语法错误!
对lz的帮忙实在是感激啊!!!
#10
无理取闹2007-08-20 19:15
还是把原程序或者是错误信息发上来吧 这样怎么给你挑错哦
#11
maozhong892007-08-21 11:06
回复:(无理取闹)还是把原程序或者是错误信息发上来...

#define IDI_ICON1 1100
#define IDM_ABOUT 1000
#define MAINMENU 1002
#define IDM_NEW 1003
#define IDM_OPEN 1004
#define IDM_QUIT 1005
#define IDM_UNDO 1006
#define IDM_CUT 1007
#define IDM_COPY 1008
#define IDM_PASTE 1009
#define IDM_SELALL 1010
#define IDM_DELETE 1011
#define IDM_SAVE 1012
#define IDM_SAVEAS 1013

IDI_ICON1 ICON "edit.ico"

MAINMENU MENUEX
{
POPUP "&File"
{
MENUITEM "&New", IDM_NEW
MENUITEM "&Open\tF3", IDM_OPEN
MENUITEM "&Save\tF2", IDM_SAVE
MENUITEM "Save &As", IDM_SAVEAS
MENUITEM SEPARATOR
MENUITEM "E&xit\tAlt+X", IDM_QUIT
}

POPUP "&Edit"
{
MENUITEM "&Undo\tCtrl+Z", IDM_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", IDM_CUT
MENUITEM "&Copy\tCtrl+C", IDM_COPY
MENUITEM "&Paste\tCtrl+V", IDM_PASTE
MENUITEM "&Delete\tDel", IDM_DELETE
MENUITEM SEPARATOR
MENUITEM "Select &All", IDM_SELALL
}

POPUP "&Help"
{
MENUITEM "&About\tF1", IDM_ABOUT
}
}


MAINACCEL ACCELERATORS
{
VK_F1, IDM_ABOUT, VIRTKEY
VK_F2, IDM_SAVE, VIRTKEY
VK_F3, IDM_OPEN, VIRTKEY
"x", IDM_QUIT, ALT
}


报错就是:
D:\masm32\bin>rc edit.rc
edit.rc (28): error RC2243 : invalid string expression at SEPARATOR

edit.rc (29): error RC2236 : required parameter missing

edit.rc (35): error RC2243 : invalid string expression at SEPARATOR

edit.rc (36): error RC2236 : required parameter missing

edit.rc (40): error RC2243 : invalid string expression at SEPARATOR

edit.rc (41): error RC2236 : required parameter missing
edit.rc (53): error RC2104 : undefined keyword or key name: VK_F1

不知道哪里有问题...
帮忙看下,谢谢!!!


#12
无理取闹2007-08-21 21:03
MAINMENU MENUEX 改成MAINMENU MENU
#13
无理取闹2007-08-21 21:04
还有加上#include        <resource.h>
#14
maozhong892007-08-22 10:27
回复:(无理取闹)还有加上#include
成功!太感谢bz的帮助了
1