Home > Software engineering >  How to call DLL in the test program of the variable?
How to call DLL in the test program of the variable?

Time:12-27

My first thought is written in the dynamic library interface program, the interface program returns a variable's value, the test program procedures need to use variables, instead of using the interface function,

But, I saw, add a breakpoint assignment failure,

 extern "C" __declspec (dllexport) int iii () 
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());

CDlgHardware da;
Return da. Ii;//ii is defined in CDlgHardware integer variables, endowed with initial value to 5;




//the following is a test program
Extern "C" __declspec (dllexport) int iii ();
Int tt=iii ();//this sentence after the operation, the breakpoint debugging found that tt is empty;
}


Could you tell me why the assignment is not successful?

I want to in the test program calls variables in a DLL, what should I do?

CodePudding user response:

Applications should use the __declspec (dllimport)
Can also set breakpoints step enter debug see

  • Related