【发布时间】:2012-01-26 23:50:35
【问题描述】:
代码:
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Enters a button click");
// Create our OpenGL Hwnd 'control'...
HwndHost host = new WPFOpenGLLib.OpenGLHwnd();
// ... and attach it to the placeholder control:
hwndPlaceholder.Child = host;
}
WPFOpenGLLib.OpenGLHwnd() 是 C++ DLL 中的一个类。我在 C# WPF 应用程序中添加了对该 DLL 的引用。但是当我单击button1 时,应用程序崩溃了。甚至带有 »Enters a button click« 的 messageBox 也不会显示。即使我使用
bool a = false;
if (a)
{
// Create our OpenGL Hwnd 'control'...
HwndHost host = new WPFOpenGLLib.OpenGLHwnd();
// ... and attach it to the placeholder control:
hwndPlaceholder.Child = host;
}
它崩溃了。
顺便说一句,在一台计算机(我编写应用程序的地方)(Win7 32 位)上一切正常,在另一台计算机(Win7 64 位)上崩溃,在另一台计算机(Win7 32 位)上也崩溃。
有谁知道这里的问题是什么?
【问题讨论】: