Hi,
it's the first time i try to create a dll application which could be used from excel. So i try to do it by creating a MFC dynamically linked dll, where i put a simply code for a simply function:
/////////////////////////////////////////////////////////////////////////////
// The one and only CEssai2App object
CEssai2App theApp;
extern "C" __declspec(dllexport) int Maximum(int a,int b)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
int max;
if(a<b)
max=b;
else
max=a;
return max;
}
and after the compilation, i put this line into a vba module :
Public Declare Function Maximun Lib "D:\essai2\Debug\essai2.dll"(byval a as integer,byval b as integer) as integer
So, i do the compilation in vba, and i try to test this function in excel by calling simply Maximum.
Excel recognize it, but instead of it returns #VALEUR
so if anybody could solve my problem
thanks in advance
jayjay
it's the first time i try to create a dll application which could be used from excel. So i try to do it by creating a MFC dynamically linked dll, where i put a simply code for a simply function:
/////////////////////////////////////////////////////////////////////////////
// The one and only CEssai2App object
CEssai2App theApp;
extern "C" __declspec(dllexport) int Maximum(int a,int b)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
int max;
if(a<b)
max=b;
else
max=a;
return max;
}
and after the compilation, i put this line into a vba module :
Public Declare Function Maximun Lib "D:\essai2\Debug\essai2.dll"(byval a as integer,byval b as integer) as integer
So, i do the compilation in vba, and i try to test this function in excel by calling simply Maximum.
Excel recognize it, but instead of it returns #VALEUR
so if anybody could solve my problem
thanks in advance
jayjay