使用 Visual Studio 2010时遇到的问题.docx
文本预览下载声明
问题:出现错误error C4335: 检测到 Mac 文件格式: 请将源文件转换为 DOS 格式或 UNI格式;解答:?? 这个错误的意思是这个文件被检测出来是MAC OS格式,请转换成DOS或者UNIX文件格式。具体解决方法:将文本内容复制到Word,之后再创建一个TXT文件将Word的内容复制出来,再将这个TXT文件替换原来的文件。问题:使用多媒体功能呼叫,无法通过PlaySound函式解答:转载出处/lyqf_365一般是:LNK2019: 无法解析的外部符号 __imp__PlaySoundW@12,该符号在函数 _WndProc@16 中被引用,下面附下解决方案:-----------------------------------------------------------------------------------------------1.新建工程/项目,输入项目名称建好项目。建立一个新的源文件,类型是C++的,但后缀要用.c的。===============以下为源代码======================================/*------------------------------------------------------------?? HELLOWIN.C -- Displays Hello, Windows 98! in client area???????????????? (c) Charles Petzold, 1998------------------------------------------------------------*/#pragma???? comment(lib,winmm.lib)#include windows.h#using mscorlib.dllLRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,??????????????????? PSTR szCmdLine, intiCmdShow){???? static TCHAR szAppName[] = TEXT (HelloWin) ;???? HWND???????? hwnd ;???? MSG????????? msg ;???? WNDCLASS???? wndclass ;//CS_HREDRAW | CS_VREDRAW 格式在窗口大小改变后,就把整个窗口显示内容当成无效。然后,窗口消息处理程序将收到一条WM_PAINT消息。???? wndclass.style???????? = CS_HREDRAW | CS_VREDRAW ;//0;调试???? wndclass.lpfnWndProc?? = WndProc ;???? wndclass.cbClsExtra??? = 0 ;???? wndclass.cbWndExtra??? = 0 ;???? wndclass.hInstance???? = hInstance ;???? wndclass.hIcon???????? = LoadIcon (NULL, IDI_APPLICATION) ;???? wndclass.hCursor?????? = LoadCursor (NULL, IDC_ARROW) ;???? wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;???? wndclass.lpszMenuName = NULL ;???? wndclass.lpszClassName = szAppName ;???? if (!RegisterClass (wndclass))???? {????????? MessageBox (NULL, TEXT (This program requires Windows NT!), ????????????????????? szAppName, MB_ICONERROR) ;????????? return 0 ;???? }???? ???? hwnd = CreateWindow (szAppName,????????????????? // window class name????????????????????????? TEXT (The Hello Program), // window caption????????????????????????? WS_O
显示全部