Click here to Skip to main content
15,886,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Writing a Screensaver Pin
Adam Maras15-Aug-09 6:37
Adam Maras15-Aug-09 6:37 
GeneralRe: Writing a Screensaver Pin
gamefreak229115-Aug-09 8:37
gamefreak229115-Aug-09 8:37 
Questiondecompress gzip file using zlib lib Pin
Toubro14-Aug-09 21:30
Toubro14-Aug-09 21:30 
AnswerRe: decompress gzip file using zlib lib Pin
Garth J Lancaster14-Aug-09 21:54
professionalGarth J Lancaster14-Aug-09 21:54 
AnswerRe: decompress gzip file using zlib lib Pin
kilt17-Aug-09 3:28
kilt17-Aug-09 3:28 
QuestionHello How Can I Use C++ read/write data with PLC Pin
driveinc14-Aug-09 21:23
driveinc14-Aug-09 21:23 
AnswerRe: Hello How Can I Use C++ read/write data with PLC Pin
Garth J Lancaster14-Aug-09 22:02
professionalGarth J Lancaster14-Aug-09 22:02 
QuestionAsk for help ___the errors in my projects to show modless dialog in dll [modified] Pin
hailuolan14-Aug-09 19:33
hailuolan14-Aug-09 19:33 
my function in dll:

extern "C" _declspec(dllexport) CDialog * ShowDllDlg(HWND hWnd)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

CDllDlg * m_pDlg =new CDllDlg();
m_pDlg->Create(IDD_DLG_DllDLG, CWnd::FromHandle(hWnd));
m_pDlg->ShowWindow(SW_SHOW);
return m_pDlg;
}


Another function to call dll function in my test project:


void CTestDlg::OnBnClickedButtonDlltest()
{
HWND myhWnd = this->m_hWnd;

typedef CDialog * (_stdcall *Connect)(HWND hWnd);
HINSTANCE hinstDLL=NULL;
hinstDLL = ::LoadLibrary("AntiSubmarine.dll");
if (hinstDLL) {
Connect Proc;
Proc = (Connect)GetProcAddress(hinstDLL,"ShowDllDlg");
if (Proc!=(Connect)NULL) {
m_pdlg = (CDialog *)Proc(myhWnd);//in *.h file defines CDialog * m_pdlg;
//if only "Proc(myhWnd)", also the same error;
}
FreeLibrary(hinstDLL);
}
else {
AfxMessageBox("Not found dll !");
}
return;
}


when run the dll, error comes out.

modified on Wednesday, August 19, 2009 8:47 AM

AnswerRe: Ask for help ___the errors in my projects to show non-model dialog in dll Pin
zhu_lin16-Aug-09 22:29
zhu_lin16-Aug-09 22:29 
GeneralRe: Ask for help ___the errors in my projects to show non-model dialog in dll Pin
hailuolan19-Aug-09 2:46
hailuolan19-Aug-09 2:46 
AnswerRe: Ask for help ___the errors in my projects to show modless dialog in dll Pin
zhu_lin20-Aug-09 15:26
zhu_lin20-Aug-09 15:26 
GeneralRe: Ask for help ___the errors in my projects to show modless dialog in dll Pin
hailuolan21-Aug-09 4:21
hailuolan21-Aug-09 4:21 
QuestionExtending combo box. [modified] Pin
emmmatty114-Aug-09 19:30
emmmatty114-Aug-09 19:30 
AnswerRe: Extending combo box. Pin
Code-o-mat14-Aug-09 21:17
Code-o-mat14-Aug-09 21:17 
GeneralRe: Extending combo box. Pin
emmmatty114-Aug-09 22:33
emmmatty114-Aug-09 22:33 
QuestionGCC & bitmap.c__ Pin
tuan111114-Aug-09 18:29
tuan111114-Aug-09 18:29 
AnswerRe: GCC & bitmap.c__ Pin
zhu_lin16-Aug-09 16:23
zhu_lin16-Aug-09 16:23 
QuestionGCC & vga,bitmap.c Pin
tuan111114-Aug-09 17:13
tuan111114-Aug-09 17:13 
AnswerRe: GCC & vga,bitmap.c Pin
Bacon Ultimate Cheeseburger14-Aug-09 17:29
Bacon Ultimate Cheeseburger14-Aug-09 17:29 
AnswerRe: GCC & vga,bitmap.c Pin
Bacon Ultimate Cheeseburger14-Aug-09 20:33
Bacon Ultimate Cheeseburger14-Aug-09 20:33 
QuestionVC7 to VC8 migration Pin
uli200014-Aug-09 9:01
uli200014-Aug-09 9:01 
AnswerRe: VC7 to VC8 migration Pin
«_Superman_»14-Aug-09 17:05
professional«_Superman_»14-Aug-09 17:05 
QuestionTVINSERTSTRUCT - how to get the "item" memeber in CTreeCtrl? Pin
Vaclav_14-Aug-09 8:49
Vaclav_14-Aug-09 8:49 
AnswerRe: TVINSERTSTRUCT - how to get the "item" memeber in CTreeCtrl? Pin
Vaclav_14-Aug-09 8:53
Vaclav_14-Aug-09 8:53 
QuestionLogger! "hijacking" interface! Pin
thelonesquirrely14-Aug-09 7:27
thelonesquirrely14-Aug-09 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.