鱼C--泪痕 发表于 2013-1-31 18:36:50

编译正常 但运行出现停止工作

本帖最后由 鱼C--泪痕 于 2013-1-31 20:16 编辑

.386
.model flat, stdcall;32 bit memory model
option casemap :none;case sensitive



include windows.inc
include kernel32.inc
include user32.inc
include Comctl32.inc
include shell32.inc
include wininet.inc
include debug.inc
includelib debug.lib
includelib wininet.lib
includelib kernel32.lib
includelib user32.lib
includelib Comctl32.lib
includelib shell32.lib

DlgProc                        PROTO      :HWND,:UINT,:WPARAM,:LPARAM

.const

IDD_DIALOG1                        equ 101

;#########################################################################

.data?
buffer                  db   512   dup(?)

hInstance                        dd ?
d                              dd ?
a                               dd ?
b                               dd ?

.code

start:

      invoke GetModuleHandle,NULL
      mov                hInstance,eax

      invoke InitCommonControls
      invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr DlgProc,NULL
      invoke ExitProcess,0

;########################################################################

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

      mov                eax,uMsg
      .if eax==WM_INITDIALOG
      .elseif eax==WM_COMMAND
      invokeInternetOpen,CTEXT("MY123"),INTERNET_OPEN_TYPE_PRECONFIG,CTEXT("0"),CTEXT("0"),0
      mov a,eax
      PrintDec eax
      invokeInternetOpenUrl,a,CTEXT("http://p0.so.qhimg.com/t01f6d0a4bf155f804f.jpg"),CTEXT("0"),0,INTERNET_FLAG_RELOAD,0
      PrintDec eax
      mov d,eax
      
      invoke HttpQueryInfo,d,5,addr buffer,512,0
      invoke MessageBox,hWin,CTEXT("0"),CTEXT("0"),MB_OK
      PrintDec eax
      invoke InternetCloseHandle,eax
      invoke InternetCloseHandle,d
      invoke InternetCloseHandle,a
      .elseif eax==WM_CLOSE
                invoke EndDialog,hWin,0
      .else
                mov                eax,FALSE
                ret
      .endif
      mov                eax,TRUE
      ret

DlgProc endp

end start
程序运行到HttpQueryInfo的时候就出现程序停止工作 这是怎么??
file:///D:\软件应用\腾讯\QQ\QQ缓存\522243299\Image\Q83HOZIG4IJHB8N`X]S)PQE.jpg

メ㊣逆ご帅☆ 发表于 2013-1-31 20:50:48

请把资源文件给我

鱼C--泪痕 发表于 2013-1-31 22:24:06

唉重要找到原因了在掉用 invoke HttpQueryInfo,d,5,addr buffer,512,0的时候不能直接 使用512
改成加个变量 a
mov a,sizeof buffer
invoke HttpQueryInfo,d,5,addr buffer,a,0
这样运行正常了

我在看看为什么不能直接怎么写

xitonggongchen 发表于 2013-2-2 14:55:51

学习了,共勉,大家加油啊

xitonggongchen 发表于 2013-2-2 17:14:03

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:23:37

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:25:07

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:25:53

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:28:02

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:29:09

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:29:41

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:30:13

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:31:56

赚点鱼币,多谢了

xitonggongchen 发表于 2013-2-2 17:32:27

赚点鱼币,多谢了

鱼C--泪痕 发表于 2013-9-5 02:59:46

http://www.fishc.com

ソ孤单背影 发表于 2013-9-5 19:28:47

加油!!!
页: [1]
查看完整版本: 编译正常 但运行出现停止工作