[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

sup

10/3/2005 9:45:00 PM

Hi,
I have a C++ dll that I wanna call in Axapta.
I am using the following code:

DLL sNumDLL = new DLL('C++DLL');
DLLFunction func = new DLLFunction(sNumDLL,'funcName');
func.returns(ExtTypes::DWord);
func.arg(ExtTypes::String,ExtTypes::DWord);
func.call('1111-1111-1111-1111',1);

But I get an error stating that there was an exceptionin the func.

Am I doing something wrong?

Thanks & Regards,
Sup
1 Answer

Anton Venter

10/4/2005 7:17:00 PM

0

Are you exporting the functions correctly in your DLL?

e.g.

int FAR PASCAL DllGetString(int nId, BSTR* bsOut, int* nLength)
{
//code here
}

and then in the .def file

EXPORTS
DllGetString @1

You can then call this from Axapta, the copiled static DLL must be in the
Windows path of course.


"sup" <sup@discussions.microsoft.com> wrote in message
news:CD85AF73-207B-436C-90E2-6B7586F7BB09@microsoft.com...
> Hi,
> I have a C++ dll that I wanna call in Axapta.
> I am using the following code:
>
> DLL sNumDLL = new DLL(''C++DLL'');
> DLLFunction func = new DLLFunction(sNumDLL,''funcName'');
> func.returns(ExtTypes::DWord);
> func.arg(ExtTypes::String,ExtTypes::DWord);
> func.call(''1111-1111-1111-1111'',1);
>
> But I get an error stating that there was an exceptionin the func.
>
> Am I doing something wrong?
>
> Thanks & Regards,
> Sup