level 1
zjnny
楼主
vtk 5.10.1编译后无法创建vtkMFCWindow
1.首先是字符集的问题,使用UNICODE时会在这里停止
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle()>>>>
{ ASSERT(afxCurrentInstanceHandle != NULL);>>>>
return afxCurrentInstanceHandle; }
换了字符集以后就可以过去,我在5.6就可以使用unicode到了10怎么就不行了
2.继续创建窗口跟踪到下面这个地方CreateWindow这里无法找到vtkopengl窗口类,这个vtkmfcwindow创建中有什么问题
void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags,
int debug, int
bp
p,
int zbpp)
{
// Create a dummy window, needed for calling wglGetProcAddress.
#ifdef UNICODE
HWND tempId = CreateWindow(L"vtkOpenGL", 0, 0, 0, 0, 1, 1, 0, 0, this->ApplicationInstance, 0);
#else
HWND tempId = CreateWindow("vtkOpenGL", 0, 0, 0, 0, 1, 1, 0, 0, this->ApplicationInstance, 0);
#endif
HDC tempDC = GetDC(tempId);
PIXELFORMATDESCRIPTOR tempPfd;
memset(&tempPfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
tempPfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
tempPfd.nVersion = 1;
tempPfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
tempPfd.iPixelType = PFD_TYPE_RGBA;
int tempPixelFormat = ChoosePixelFormat(tempDC, &tempPfd);
SetPixelFormat(tempDC, tempPixelFormat, &tempPfd);
HGLRC tempContext = wglCreateContext(tempDC);
wglMakeCurrent(tempDC, tempContext);
上面的问题都是在5.6里没遇到过,换了各版本就各种问题,求解释
@rabbitbride
2014年09月19日 09点09分
1
1.首先是字符集的问题,使用UNICODE时会在这里停止
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle()>>>>
{ ASSERT(afxCurrentInstanceHandle != NULL);>>>>
return afxCurrentInstanceHandle; }
换了字符集以后就可以过去,我在5.6就可以使用unicode到了10怎么就不行了
2.继续创建窗口跟踪到下面这个地方CreateWindow这里无法找到vtkopengl窗口类,这个vtkmfcwindow创建中有什么问题
void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags,
int debug, int
bp
p,
int zbpp)
{
// Create a dummy window, needed for calling wglGetProcAddress.
#ifdef UNICODE
HWND tempId = CreateWindow(L"vtkOpenGL", 0, 0, 0, 0, 1, 1, 0, 0, this->ApplicationInstance, 0);
#else
HWND tempId = CreateWindow("vtkOpenGL", 0, 0, 0, 0, 1, 1, 0, 0, this->ApplicationInstance, 0);
#endif
HDC tempDC = GetDC(tempId);
PIXELFORMATDESCRIPTOR tempPfd;
memset(&tempPfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
tempPfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
tempPfd.nVersion = 1;
tempPfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
tempPfd.iPixelType = PFD_TYPE_RGBA;
int tempPixelFormat = ChoosePixelFormat(tempDC, &tempPfd);
SetPixelFormat(tempDC, tempPixelFormat, &tempPfd);
HGLRC tempContext = wglCreateContext(tempDC);
wglMakeCurrent(tempDC, tempContext);
上面的问题都是在5.6里没遇到过,换了各版本就各种问题,求解释
@rabbitbride