manther
Active Member
This is probably so simple but I could use a second pair of eyes. I'm having a problem passing the 6th argument the long. "li"
Here's my JDE info:
EnterpriseOne tools release 8.94.L1, OS 2003 R2, SQL server 2000.
E1 release 8.10
The compile error I'm getting is:
C:\E810\PD810\source\B550002.c(57) : error C2115: 'function' : incompatible types
C:\E810\PD810\source\B550002.c(57) : warning C4024: 'lpfnDLL_Test' : different types for formal and actual parameter 6
Here is the non JDE function:
<font class="small">Code:</font><hr /><pre> // Dll_test.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "Dll_test.h"
#import "C:\MyInterop\MyInterop\bin\Debug\com.MyInterop.tlb" named_guids raw_interfaces_only
DLL_TEST_API void SubmitCC(BSTR sNameOnCard, BSTR sCCNumber, BSTR sExpDate, BSTR sCvv, BSTR sAmount, long lDonorID, BSTR *pRetVal);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
//Shares out the .NET methos SubmitCC
DLL_TEST_API void SubmitCC(BSTR sNameOnCard, BSTR sCCNumber, BSTR sExpDate, BSTR sCvv, BSTR sAmount, long lDonorID, BSTR *pRetVal)
{
MyInterop::IPaymentProcessInterfacePtr pPaymentPtr;
HRESULT hRes = pPaymentPtr.CreateInstance(MyInterop::CLSID_PaymentProcess);
if (hRes == S_OK)
{
HRESULT hr = pPaymentPtr->SubmitCC(sNameOnCard, sCCNumber, sExpDate, sCvv, sAmount, lDonorID, pRetVal);
if(hr == S_OK)
{
//return *pRetVal;
}
}
// return NULL;
}
// This is an example of an exported variable
DLL_TEST_API int nDll_test=0;
// This is the constructor of a class that has been exported.
// see Dll_test.h for the class definition
CDll_test::CDll_test()
{
return;
}
</pre><hr />
Here is the JDE business function that calls the function listed on top.
<font class="small">Code:</font><hr /><pre>
/*********************************************************************
* Notes:
* Generated from OneWorld Event Rules
*
*********************************************************************/
#include <jde.h>
#include <B550002.h>
/*********************************************************************
* Business Function Prototypes
*********************************************************************/
JDEBFRTN(ID) JDEBFWINAPI
CBusinessFunctionExample( LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD5500CC lpDS )
{
//# ifdef JDENV_PC
/**********************
* Variable declarations
***********************/
//BSTR * bStrn = NULL;
//int nMathReturn = MATH_SUCCESS;
/******************************
*Declare pointers
******************************/
PFNDLL_TEST lpfnDLL_Test;
HINSTANCE hLibrary;
/*****************************
*Check for null pointers
*****************************/
if( (lpBhvrCom == (LPBHVRCOM) NULL) ||
(lpVoid == (LPVOID) NULL) ||
(lpDS == (LPDSD5500CC) NULL))
{
jdeErrorSet (lpBhvrCom, lpVoid, 0L , _J("4363"), (LPVOID) NULL);
return ER_ERROR;
}
/*****************************
*Set pointers
*****************************/
lpfnDLL_Test = (PFNDLL_TEST) NULL;
hLibrary = (HINSTANCE) NULL;
/**************************
*Main processing
**************************/
hLibrary = LoadLibrary(_J("C:\\Dll_test\\Debug\\Dll_test.dll"));
if(hLibrary)
{
lpfnDLL_Test = (PFNDLL_TEST) GetProcAddress (hLibrary, _J("?SubmitCC@@YAXPAG0000JPAPAG@Z"));
if( lpfnDLL_Test )
{
<font color="red">unsigned long li;
//li = atol (lpDS->mnDonorID->);
MathNumericToLong(&lpDS->mnDonorID, (long *)&li);
//lpDS->szReturn = '\0';
lpfnDLL_Test( (ushort *)lpDS->szNameOnCard, (ushort *)lpDS->szCCNum, (ushort *)lpDS->szEXP, (ushort *)lpDS->szCvv, (ushort *)lpDS->szAmount, <font color="green">li</font>, (ushort*)&lpDS->szReturn);
//jdeStrcpy(lpDS->szReturn, (CONST JCHAR*)lpDS->szReturn);</font>
}
FreeLibrary (hLibrary);
}
/*********************************
*Function Cleanup
*********************************/
return (ER_SUCCESS);
}
</pre><hr />
Thanks any help is appriciated. P.S. This I've tried passing the 6 param in many various ways, this is just the way it currently stands.
Here's my JDE info:
EnterpriseOne tools release 8.94.L1, OS 2003 R2, SQL server 2000.
E1 release 8.10
The compile error I'm getting is:
C:\E810\PD810\source\B550002.c(57) : error C2115: 'function' : incompatible types
C:\E810\PD810\source\B550002.c(57) : warning C4024: 'lpfnDLL_Test' : different types for formal and actual parameter 6
Here is the non JDE function:
<font class="small">Code:</font><hr /><pre> // Dll_test.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "Dll_test.h"
#import "C:\MyInterop\MyInterop\bin\Debug\com.MyInterop.tlb" named_guids raw_interfaces_only
DLL_TEST_API void SubmitCC(BSTR sNameOnCard, BSTR sCCNumber, BSTR sExpDate, BSTR sCvv, BSTR sAmount, long lDonorID, BSTR *pRetVal);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
//Shares out the .NET methos SubmitCC
DLL_TEST_API void SubmitCC(BSTR sNameOnCard, BSTR sCCNumber, BSTR sExpDate, BSTR sCvv, BSTR sAmount, long lDonorID, BSTR *pRetVal)
{
MyInterop::IPaymentProcessInterfacePtr pPaymentPtr;
HRESULT hRes = pPaymentPtr.CreateInstance(MyInterop::CLSID_PaymentProcess);
if (hRes == S_OK)
{
HRESULT hr = pPaymentPtr->SubmitCC(sNameOnCard, sCCNumber, sExpDate, sCvv, sAmount, lDonorID, pRetVal);
if(hr == S_OK)
{
//return *pRetVal;
}
}
// return NULL;
}
// This is an example of an exported variable
DLL_TEST_API int nDll_test=0;
// This is the constructor of a class that has been exported.
// see Dll_test.h for the class definition
CDll_test::CDll_test()
{
return;
}
</pre><hr />
Here is the JDE business function that calls the function listed on top.
<font class="small">Code:</font><hr /><pre>
/*********************************************************************
* Notes:
* Generated from OneWorld Event Rules
*
*********************************************************************/
#include <jde.h>
#include <B550002.h>
/*********************************************************************
* Business Function Prototypes
*********************************************************************/
JDEBFRTN(ID) JDEBFWINAPI
CBusinessFunctionExample( LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD5500CC lpDS )
{
//# ifdef JDENV_PC
/**********************
* Variable declarations
***********************/
//BSTR * bStrn = NULL;
//int nMathReturn = MATH_SUCCESS;
/******************************
*Declare pointers
******************************/
PFNDLL_TEST lpfnDLL_Test;
HINSTANCE hLibrary;
/*****************************
*Check for null pointers
*****************************/
if( (lpBhvrCom == (LPBHVRCOM) NULL) ||
(lpVoid == (LPVOID) NULL) ||
(lpDS == (LPDSD5500CC) NULL))
{
jdeErrorSet (lpBhvrCom, lpVoid, 0L , _J("4363"), (LPVOID) NULL);
return ER_ERROR;
}
/*****************************
*Set pointers
*****************************/
lpfnDLL_Test = (PFNDLL_TEST) NULL;
hLibrary = (HINSTANCE) NULL;
/**************************
*Main processing
**************************/
hLibrary = LoadLibrary(_J("C:\\Dll_test\\Debug\\Dll_test.dll"));
if(hLibrary)
{
lpfnDLL_Test = (PFNDLL_TEST) GetProcAddress (hLibrary, _J("?SubmitCC@@YAXPAG0000JPAPAG@Z"));
if( lpfnDLL_Test )
{
<font color="red">unsigned long li;
//li = atol (lpDS->mnDonorID->);
MathNumericToLong(&lpDS->mnDonorID, (long *)&li);
//lpDS->szReturn = '\0';
lpfnDLL_Test( (ushort *)lpDS->szNameOnCard, (ushort *)lpDS->szCCNum, (ushort *)lpDS->szEXP, (ushort *)lpDS->szCvv, (ushort *)lpDS->szAmount, <font color="green">li</font>, (ushort*)&lpDS->szReturn);
//jdeStrcpy(lpDS->szReturn, (CONST JCHAR*)lpDS->szReturn);</font>
}
FreeLibrary (hLibrary);
}
/*********************************
*Function Cleanup
*********************************/
return (ER_SUCCESS);
}
</pre><hr />
Thanks any help is appriciated. P.S. This I've tried passing the 6 param in many various ways, this is just the way it currently stands.