我想在MT4的脚本里调用vc++的库,并将一个窗体显示在当前的图表窗口中,
由于脚本执行与图表窗口运行在不同的线程中,导致报错,错误信息如下:
2015.03.26 14:49:34.890 Access violation read to 0xDDDDDF6D in 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\FF6486332E05B65B7E995E1DD5B90FBE\MQL4\Libraries\MT4toDLL.dll'
Debug Assertion Failed!
Program: C:\Windows\system32\mfc110ud.dll
File: f:\dd\vctools\vc7libs\ship\atlmfc\include\afxwin1.inl
Line: 24
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
我要问的问题是,在不同线程中,如何用窗体的句柄来添加用户界面?
代码中有指针越界等,你可以通过消息来在不同线程之间通信,而不要直接跨线程调用其他线程的指针
访问违例,很明显 0xDDDDDF6D 这是一个野指针,因为Debug模式下,VC会将所有分配的内存设置为DDDDDDDD。
我将资源视图里menu下的除“IDR_MAINFRAME”的其它东西全给删掉了,执行时也出了同样的问题。不知道怎么解决呢?