Click here to Skip to main content
15,908,115 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need urgent help in vc++ Pin
Ash_VCPP18-Feb-09 22:21
Ash_VCPP18-Feb-09 22:21 
GeneralRe: Need urgent help in vc++ Pin
priyankapriyanka19-Feb-09 18:58
priyankapriyanka19-Feb-09 18:58 
GeneralRe: Need urgent help in vc++ Pin
Ash_VCPP19-Feb-09 21:11
Ash_VCPP19-Feb-09 21:11 
GeneralRe: Need urgent help in vc++ Pin
priyankapriyanka19-Feb-09 21:59
priyankapriyanka19-Feb-09 21:59 
GeneralRe: Need urgent help in vc++ Pin
Ash_VCPP22-Feb-09 20:04
Ash_VCPP22-Feb-09 20:04 
AnswerRe: Need urgent help in vc++ Pin
Stephen Hewitt19-Feb-09 1:42
Stephen Hewitt19-Feb-09 1:42 
GeneralRe: Need urgent help in vc++ Pin
priyankapriyanka19-Feb-09 18:53
priyankapriyanka19-Feb-09 18:53 
QuestionLoadLibrary cand call MFC DLL's fucntion Pin
akira3218-Feb-09 18:57
akira3218-Feb-09 18:57 
I meet a problem when I call the another MFC DLL's function.

I create two projects.

First project is called maxProjectMFCDLL, which is a MFC DLL project.

maxProjectMFCDLL.def's content as below:

LIBRARY "maxProjectMFCDLL"

EXPORTS
fDoExport @1


maxProjectMFCDLL.cpp's additional content as below:
int fDoExport(int a)
{
MessageBox(NULL,"name","Warn",MB_OK);
return TRUE;
}

Second project is called TestDialog, which is a MFC Dialog project.
I add a button to the dialog and add the function OnBnClickedButton1 for clicking the button.

void CTestDialogDlg::OnBnClickedButton1()
{
typedef int (CALLBACK* D_MYEXPORT)(int);

HMODULE l_mod;
D_MYEXPORT l_export=NULL;
int l_ret=0;

l_mod=LoadLibrary(L"..\\maxProjectMFCDLL.dll");

if (l_mod!=NULL)
{
int a=1;
l_export=(D_MYEXPORT)GetProcAddress(l_mod,"fDoExport");
l_ret=l_export(a);
FreeLibrary(l_mod);
}
}

After I build the Frist and Second projects, run the Second project. VC++ appear a error message(http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/MFC%20DLL.JPG).
The message is "Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one callinc convention with a function pointer declared with a different calling convention."

Could somebody tell me how to solve this problem?

I put my complete source code at http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/3ds%20max%20Plugin%20Two%20Project%20Q2.rar
AnswerRe: LoadLibrary cand call MFC DLL's fucntion Pin
«_Superman_»18-Feb-09 19:03
professional«_Superman_»18-Feb-09 19:03 
GeneralRe: LoadLibrary cand call MFC DLL's fucntion Pin
akira3218-Feb-09 19:11
akira3218-Feb-09 19:11 
GeneralRe: LoadLibrary cand call MFC DLL's fucntion Pin
«_Superman_»18-Feb-09 19:17
professional«_Superman_»18-Feb-09 19:17 
GeneralRe: LoadLibrary cand call MFC DLL's fucntion Pin
hariscats7-Dec-09 1:15
hariscats7-Dec-09 1:15 
QuestionDetect Current Drive name in EVC++ 4.0 on window CE 5.0 Pin
pri_skit18-Feb-09 18:39
pri_skit18-Feb-09 18:39 
QuestionSHGetDataFromIDList Problem Pin
john563218-Feb-09 18:00
john563218-Feb-09 18:00 
QuestionCRichEditCtrl and printing Pin
prithaa18-Feb-09 17:44
prithaa18-Feb-09 17:44 
AnswerRe: CRichEditCtrl and printing Pin
Stuart Dootson18-Feb-09 17:52
professionalStuart Dootson18-Feb-09 17:52 
QuestionTrying to create a Popup Window Pin
BobInNJ18-Feb-09 5:05
BobInNJ18-Feb-09 5:05 
AnswerRe: Trying to create a Popup Window Pin
prasad_som18-Feb-09 6:26
prasad_som18-Feb-09 6:26 
AnswerRe: Trying to create a Popup Window Pin
Iain Clarke, Warrior Programmer19-Feb-09 0:20
Iain Clarke, Warrior Programmer19-Feb-09 0:20 
QuestionModifying the window list and/or Ctrl+Tab behaviour in an MDI app Pin
Paul Vickery18-Feb-09 4:28
professionalPaul Vickery18-Feb-09 4:28 
AnswerRe: Modifying the window list and/or Ctrl+Tab behaviour in an MDI app Pin
led mike18-Feb-09 4:40
led mike18-Feb-09 4:40 
Questionmultiple dll Pin
pedefetoll18-Feb-09 3:08
pedefetoll18-Feb-09 3:08 
AnswerRe: multiple dll Pin
CPallini18-Feb-09 3:17
mveCPallini18-Feb-09 3:17 
AnswerRe: multiple dll Pin
Iain Clarke, Warrior Programmer18-Feb-09 3:51
Iain Clarke, Warrior Programmer18-Feb-09 3:51 
GeneralRe: multiple dll Pin
led mike18-Feb-09 4:30
led mike18-Feb-09 4:30 

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.