Welcome! Log In Create A New Profile

Advanced

.NET Assemblies

Posted by Johan Claessens.pcs.crosspost 
Johan Claessens.pcs.crosspost
.NET Assemblies
December 02, 2008 12:37PM
I'm trying to use a .NET DLL in WINDEV 12

Following code works perfect in VB2005:

Dim gXMLRouter As Coda.Xml.Router.XMLRouter  ' Declare XMLRouter Object
Dim sToken As String                         ' Declare Token String Object
gXMLRouter = New Coda.Xml.Router.XMLRouter() ' get Instance from XMLRouter Object
sToken = gXMLRouter.Authenticate("INSTALL", "OAS", "AVIABEL")

However when used in WINDEV 12

gCODAXMLRouter is XMLRouter dynamic
gToken is string
gCODAXMLRouter = new XMLRouter()
gToken = gCODAXMLRouter:Authenticate("INSTALL","OAS","AVIABEL")

The following error is generated:

Error at line 5 of Initialization of Main process.
Unable to invoke <Authenticate(System.String,System.String,System.String)> method of <String> type

Technical Information

Project : CODA Test

Dump error of module <WD120NET2.DLL> <12.00Be>.

- WL Call:
Processing <Main>, line <5>, thread <0>

- Level: fatal error (EL_FATAL)

- Error Code: 200002

- WD55 Error Code: 0

- No system error code

- No system error message

- What happened?
Unable to invoke <Authenticate(System.String,System.String,System.String)> method of <String> type

- No debug information

- Attached Information:
EIT_PILEWL :
Initialization of Main (Main), ligne 5
EIT_COMPOSANT :

EIT_DATEHEURE : 02/12/2008 12:23:35

- Identifier in .err: 200002


-------------------------------------- Sub-error #1 --------------------------------------

Dump error of module <WD120NET2.DLL> <12.00Be>.

- Level: fatal error (EL_FATAL)

- Error Code: 200007

- WD55 Error Code: 0

- No system error code

- No system error message

- What happened?
Error returned by .NET Framework: 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Coda.Xml.Router.XMLRouter.getCallerID()
   at Coda.Xml.Router.XMLRouter.getRouter(NetJNIEnvironment* jniEnv)
   at Coda.Xml.Router.XMLRouter.Authenticate(String user, String password, String company, RegionInfo regionInfo)
   at Coda.Xml.Router.XMLRouter.Authenticate(String user, String password, String company)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at CDotNetMethod.bInvoke(SByte* pszTypeName, SByte* pszMethodName, SByte* pszParameters, MethodInfo gcMethod, Object gcObj, CSLevel* pclPile, Int32 nNbParamPile, Int32 bValeurRetour, STOperationDotNet* pstOperation)

- No debug information

- No attached information

- Identifier in .err: 200007

The .NET assembly has been defined in the project through workshop and all conditions in setup for .NET are done.

Does someone have an idea to solve this problem?

Thanks in advance.

Message forwarded from pcsoft.us.windev
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: