65,203
社区成员
发帖
与我相关
我的任务
分享(LPCWSTR)"没找到合适的显示模式"L"没找到合适的显示模式"
if (!(nPixelFormat = ChoosePixelFormat(hDc, &pfd)))
{ MessageBox(NULL,_T("没找到合适的显示模式"),_T("Error"),MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
WINUSERAPI
HWND
WINAPI
CreateWindowExA(
IN DWORD dwExStyle,
IN LPCSTR lpClassName,
IN LPCSTR lpWindowName,
IN DWORD dwStyle,
IN int X,
IN int Y,
IN int nWidth,
IN int nHeight,
IN HWND hWndParent,
IN HMENU hMenu,
IN HINSTANCE hInstance,
IN LPVOID lpParam);
WINUSERAPI
HWND
WINAPI
CreateWindowExW(
IN DWORD dwExStyle,
IN LPCWSTR lpClassName,
IN LPCWSTR lpWindowName,
IN DWORD dwStyle,
IN int X,
IN int Y,
IN int nWidth,
IN int nHeight,
IN HWND hWndParent,
IN HMENU hMenu,
IN HINSTANCE hInstance,
IN LPVOID lpParam);
#ifdef UNICODE
#define CreateWindow CreateWindowW
#else
#define CreateWindow CreateWindowA
#endif // !UNICODE hWnd = CreateWindowEx(NULL,cc, L"OpenGL",
dwStyle|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
nX, nY,Width, Height,
NULL,NULL,hInst,NULL); // 创建窗口
ShowWindow( hWnd, SW_SHOWDEFAULT ); hWnd = CreateWindowExA(NULL,cc,"OpenGL",
dwStyle|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
nX, nY,Width, Height,
NULL,NULL,hInst,NULL); // 创建窗口
ShowWindow( hWnd, SW_SHOWDEFAULT ); typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;if (!(nPixelFormat = ChoosePixelFormat(hDc, &pfd)))
{ MessageBox(NULL,"没找到合适的显示模式","Error",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}if (!(nPixelFormat = ChoosePixelFormat(hDc, &pfd)))
{ MessageBox(NULL,(LPCWSTR)"没找到合适的显示模式",(LPCWSTR)"Error",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}hWnd = CreateWindowEx(NULL,cc,"OpenGL",
dwStyle|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
nX, nY,Width, Height,
NULL,NULL,hInst,NULL); // 创建窗口
ShowWindow( hWnd, SW_SHOWDEFAULT ); // 显示窗口#include <windows.h> // Windows的头文件
#include <mmsystem.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <assert.h>
//#include <afxwin.h>
#include <gl\gl.h> // OpenGL32库的头文件
#include <gl\glu.h> // GLu32库的头文件
#include <gl\glaux.h> // GLaux库的头文件
#pragma comment( lib, "winmm.lib")
#pragma comment( lib, "opengl32.lib") // OpenGL32连接库
#pragma comment( lib, "glu32.lib") // GLu32连接库
#pragma comment( lib, "glaux.lib") // GLaux连接库
#define KEY_DOWN(vk_code)((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define IDI_ICON1 101