鱼C论坛

 找回密码
 立即注册
查看: 3563|回复: 6

VC++求助

[复制链接]
发表于 2013-3-7 12:41:34 | 显示全部楼层 |阅读模式
1鱼币
“1111.exe”: 已加载“E:\a\1111\debug\1111.exe”,已加载符号。
“1111.exe”: 已加载“C:\Windows\System32\ntdll.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\kernel32.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\KernelBase.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\user32.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\gdi32.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\lpk.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\usp10.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\msvcrt.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\winsxs\x86_microsoft.vc80.debugcrt_1fc8b3b9a1e18e3b_8.0.50727.42_none_ef74ff32550b5bf0\msvcr80d.dll”,已加载符号。
“1111.exe”: 已加载“C:\Windows\System32\imm32.dll”,未加载任何符号。
“1111.exe”: 已加载“C:\Windows\System32\msctf.dll”,未加载任何符号。

请问一下这个怎么解决

最佳答案

查看完整内容

这个问题你前面问了,少赋值了一个成员变量 修改代码:
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2013-3-7 12:41:35 | 显示全部楼层
这个问题你前面问了,少赋值了一个成员变量
  1. //错误
  2.         wndcls.hIcon = LoadIcon(NULL,IDI_ERROR);
复制代码
修改代码:

  1. #include <windows.h>
  2. #include <stdio.h>

  3. LRESULT CALLBACK WinSunProc( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );

  4. int WINAPI WinMain( HINSTANCE hInstance , HINSTANCE hPrevInstance , LPSTR lpCmdLine , int nCmdShow )
  5. {
  6.         //设计一个窗口类
  7.         WNDCLASS wndcls ;
  8.         wndcls.cbClsExtra = 0 ;
  9.         wndcls.cbWndExtra = 0 ;
  10.         wndcls.hbrBackground = ( HBRUSH )GetStockObject( BLACK_BRUSH );
  11.         //错误 2
  12.         wndcls.hIcon = LoadIcon(NULL,IDI_ERROR);
  13.         wndcls.hCursor = LoadIcon( NULL , IDI_ERROR );
  14.         wndcls.hInstance = hInstance ;
  15.         wndcls.lpfnWndProc = WinSunProc ;
  16.         wndcls.lpszClassName = "sunxin2006";
  17.         wndcls.lpszMenuName = NULL ;
  18.         wndcls.style = CS_HREDRAW | CS_VREDRAW ;
  19.         RegisterClass( &wndcls );

  20.         //创建窗口,定义一个变量用来保存成功创建窗口后的返回的句柄
  21.         HWND hwnd ;
  22.         hwnd = CreateWindow( "sunxin2006" , "http://www.sunxin.org" ,
  23.                 WS_OVERLAPPEDWINDOW , 0 , 0 , 600 , 400 , NULL , NULL , hInstance , NULL );

  24.         //显示以及刷新窗口
  25.         ShowWindow( hwnd , SW_SHOWNORMAL );
  26.         UpdateWindow( hwnd ) ;

  27.         //定义消息结构体,开始消息循环
  28.         MSG msg;
  29.         while( GetMessage( &msg , NULL , 0 , 0 ) )
  30.         {
  31.                 TranslateMessage( &msg ) ;
  32.                 DispatchMessage( &msg ) ;
  33.         }
  34.         return msg.wParam ;

  35. }

  36. //编写窗口过程函数
  37. LRESULT CALLBACK WinSunProc( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam )
  38. {
  39.         switch( uMsg )
  40.         {
  41.         case WM_CHAR:
  42.                 char szChar[20] ;
  43.                 sprintf( szChar , "char code is %d" , wParam );
  44.                 MessageBox( hwnd , szChar , "char" , 0 );
  45.                 break ;

  46.         case WM_LBUTTONDOWN:
  47.                 MessageBox( hwnd , "mouse clicked" , "message" , 0 );
  48.                 HDC hdc ;
  49.                 //错误 1
  50.                 hdc = GetDC( hwnd );
  51.                 TextOut( hdc , 0 , 50 , "程序员之家" , strlen("程序员之家") );
  52.                 break ;

  53.         case WM_PAINT:
  54.                 HDC hDC ;
  55.                 PAINTSTRUCT ps ;
  56.                 hDC = BeginPaint( hwnd , &ps );
  57.                 TextOut( hDC , 0 , 0 , "http://www.sunxin.org" , strlen("http://www.sunxin.org" ) ) ;
  58.                 EndPaint( hwnd , &ps );
  59.                 break ;

  60.         case WM_CLOSE:
  61.                 if( IDYES == MessageBox( hwnd , "是否真的结束?" , "message" , MB_YESNO ))
  62.                         DestroyWindow( hwnd );
  63.                 break ;

  64.         case WM_DESTROY:
  65.                 PostQuitMessage( 0 ) ;
  66.                 break ;

  67.         default:
  68.                 return DefWindowProc( hwnd , uMsg , wParam , lParam );

  69.         }

  70.         return 0 ;
  71. }
复制代码


想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2013-3-7 12:59:34 | 显示全部楼层
什么怎么解决 不懂哦
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2013-3-7 13:05:05 | 显示全部楼层
  1. #include <windows.h>
  2. #include <stdio.h>

  3. LRESULT CALLBACK WinSunProc( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam );

  4. int WINAPI WinMain( HINSTANCE hInstance , HINSTANCE hPrevInstance , LPSTR lpCmdLine , int nCmdShow )
  5. {
  6.    //设计一个窗口类
  7.    WNDCLASS wndcls ;
  8.    wndcls.cbClsExtra = 0 ;
  9.    wndcls.cbWndExtra = 0 ;
  10.    wndcls.hbrBackground = ( HBRUSH )GetStockObject( BLACK_BRUSH );
  11.    wndcls.hCursor = LoadIcon( NULL , IDI_ERROR );
  12.    wndcls.hInstance = hInstance ;
  13.    wndcls.lpfnWndProc = WinSunProc ;
  14.    wndcls.lpszClassName = "sunxin2006";
  15.    wndcls.lpszMenuName = NULL ;
  16.    wndcls.style = CS_HREDRAW | CS_VREDRAW ;
  17.    RegisterClass( &wndcls );
  18.    
  19.    //创建窗口,定义一个变量用来保存成功创建窗口后的返回的句柄
  20.    HWND hwnd ;
  21.    hwnd = CreateWindow( "sunxin2006" , "http://www.sunxin.org" ,
  22.           WS_OVERLAPPEDWINDOW , 0 , 0 , 600 , 400 , NULL , NULL , hInstance , NULL  );
  23.   
  24.   //显示以及刷新窗口
  25.   ShowWindow( hwnd , SW_SHOWNORMAL );
  26.   UpdateWindow( hwnd ) ;
  27.   
  28.   //定义消息结构体,开始消息循环
  29.   MSG msg;
  30.   while( GetMessage( &msg , NULL , 0 , 0 ) )
  31.   {
  32.      TranslateMessage( &msg ) ;
  33.      DispatchMessage( &msg ) ;
  34.   }
  35.   return msg.wParam ;
  36.   
  37. }

  38. //编写窗口过程函数
  39. LRESULT CALLBACK WinSunProc( HWND hwnd , UINT uMsg , WPARAM wParam , LPARAM lParam )
  40. {
  41.    switch( uMsg )
  42.    {
  43.     case WM_CHAR:
  44.          char szChar[20] ;
  45.          sprintf( szChar , "char code is %d" , wParam );
  46.          MessageBox( hwnd , szChar , "char" , 0 );
  47.          break ;
  48.          
  49.     case WM_LBUTTONDOWN:
  50.          MessageBox( hwnd , "mouse clicked" , "message" , 0 );
  51.          HDC hdc ;
  52.          hdc = GetDC( hwnd );
  53.          TextOut( hdc , 0 , 50 , "程序员之家" , strlen("程序员之家") );
  54.          break ;
  55.          
  56.     case WM_PAINT:
  57.          HDC hDC ;
  58.          PAINTSTRUCT ps ;
  59.          hDC = BeginPaint( hwnd , &ps );
  60.          TextOut( hDC , 0 , 0 , "http://www.sunxin.org" , strlen("http://www.sunxin.org" ) ) ;
  61.          EndPaint( hwnd , &ps );
  62.          break ;
  63.          
  64.     case WM_CLOSE:
  65.          if( IDYES == MessageBox( hwnd , "是否真的结束?" , "message" , MB_YESNO ))
  66.             DestroyWindow( hwnd );
  67.          break ;
  68.       
  69.     case WM_DESTROY:
  70.          PostQuitMessage( 0 ) ;
  71.          break ;
  72.      
  73.     default:
  74.          return DefWindowProc( hwnd , uMsg , wParam , lParam );
  75.             
  76.    }
  77.    
  78.    return 0 ;
  79. }
复制代码
运行后不能弹出窗口
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2013-3-7 13:21:32 | 显示全部楼层
┾断┡ē誸 发表于 2013-3-7 13:05
运行后不能弹出窗口

谢谢你啊 谢谢你啊
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2013-3-7 13:22:10 | 显示全部楼层
小新110 发表于 2013-3-7 12:41
这个问题你前面问了,少赋值了一个成员变量
修改代码:

谢谢你啊 我查了半天也没发现错误
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2013-3-7 17:25:29 | 显示全部楼层
嗯嗯 看来真的运行出来了 真是高手啊 哈哈
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-26 19:27

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表