Home > Software engineering >  About using MFC call DLL by matlab conversion problem
About using MFC call DLL by matlab conversion problem

Time:10-03

Younger brother new to c + +, using MFC to write an interface, you need to call matlab generated DLL. To pass a string to the function of matlab, return an image
Excuse me how to write the code

CodePudding user response:

You have to ask how to write DLL? How do you write or call DLL

CodePudding user response:

reference 1st floor lx624909677 response:
you have to ask how to write DLL? How do you write or call DLL
call DLL is how to write

CodePudding user response:

 HINSTANCE hDllInst=LoadLibrary (" youApp. DLL "); 
If (hDllInst)
{
Typedef dwords (WINAPI * MYFUNC) (DWORD, DWORD);
MYFUNC youFuntionNameAlias=NULL;//youFuntionNameAlias function is an alias
YouFuntionNameAlias=(MYFUNC) GetProcAddress call
(hDllInst, "youFuntionName");
//youFuntionName statement in the DLL function name
If (youFuntionNameAlias)
{
YouFuntionNameAlias (param1, param2);
}
FreeLibrary (hDllInst);
}

CodePudding user response:

The
reference 3 floor lx624909677 response:
 HINSTANCE hDllInst=LoadLibrary (" youApp. DLL "); 
If (hDllInst)
{
Typedef dwords (WINAPI * MYFUNC) (DWORD, DWORD);
MYFUNC youFuntionNameAlias=NULL;//youFuntionNameAlias function is an alias
YouFuntionNameAlias=(MYFUNC) GetProcAddress call
(hDllInst, "youFuntionName");
//youFuntionName statement in the DLL function name
If (youFuntionNameAlias)
{
YouFuntionNameAlias (param1, param2);
}
FreeLibrary (hDllInst);
}
can you ask how to pass a string to a function of the matlab

CodePudding user response:

reference 4 floor p694748716 response:
Quote: reference lx624909677 reply: 3/f

 HINSTANCE hDllInst=LoadLibrary (" youApp. DLL "); 
If (hDllInst)
{
Typedef dwords (WINAPI * MYFUNC) (DWORD, DWORD);
MYFUNC youFuntionNameAlias=NULL;//youFuntionNameAlias function is an alias
YouFuntionNameAlias=(MYFUNC) GetProcAddress call
(hDllInst, "youFuntionName");
//youFuntionName statement in the DLL function name
If (youFuntionNameAlias)
{
YouFuntionNameAlias (param1, param2);
}
FreeLibrary (hDllInst);
}
can you ask how to pass a string to a function of the matlab?

You have to call the DLL is not function, the parameters of the function is the code I gave you the param1

CodePudding user response:

String as a parameter to a DLL that matlab functions
  • Related