如題,我在mfc dll中插入了一個表單,并在匯出函式中彈出這個表單,用的是模態對話框的方式,我想實作通過dll中的表單和主應用程式間進行互動。感覺跨語言是存在一定問題,但我想請教一下有經驗的大神,我該如何實作我的需求呢?
uj5u.com熱心網友回復:
呼叫dll崩潰的話,可以用垮行程除錯來看下具體的奔潰原因,傳遞引數的話可以通過管道來實作uj5u.com熱心網友回復:
MFC dll最好用mfc程式來加載,你這個最好用行程通信方式跟c++ builder程式通信uj5u.com熱心網友回復:
你不都是C/C++嗎?跨什么語言?不同的編譯器,可能不同的API封裝庫吧。
uj5u.com熱心網友回復:
你彈出對話框崩潰不會是因為這個原因吧:By default, MFC uses the resource handle of the main application to load the resource template. If you have an exported function in a DLL, such as one that launches a dialog box in the DLL, this template is actually stored in the DLL module. You need to switch the module state for the correct handle to be used. You can do this by adding the following code to the beginning of the function:
AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/105228.html
標籤:進程/線程/DLL
