Last post Sep 23, 2009 08:54 PM by atconway
Sep 04, 2009 06:18 PM|WebRuss|LINK
I'll start off by saying I'm a bit of a noob with ASP.NET I do know a bit of vb from the old days though.
Using Visual Web Developer 2008 express I've written a dll in vb.net that interfaces with another COM dll called CybersourceWSLib
In my class, called cybersource I interact with a few of the Interfaces inside the CybersourceWSLib COM dll.
My problem is that when I attempt to use one of the properties of the interface from my web page like so:
Partial Class registration
Private Shared oCyb As New Cybersource.cyber1.cyb
oCyb.EnableLog = "0"
"System.NullReferenceException: Object reference not set to an instance of an object."
I've declared the interfaces inside the dll but I'm guessing they are not initailized??? I dunno
Here is where I declare them in the class inside my vb.net dll
Private Shared oClient As CyberSourceWSLib.IClient
My web page access the properties in my dll through :
Public Shared Property LogDirectory() As String
Set(ByVal value As String)
objMerchConfig.LogDirectory = value
That is when I get the error.
What do I need to do to make this work.
Sep 04, 2009 06:48 PM|kannank7|LINK
You are correct, the intialization is the problem here. use any reflectors like
Lutz Roeder's .NET Reflector
to find out what are the methods available in the com object and try to use initialize the object before using the properties.
Sep 04, 2009 07:03 PM|WebRuss|LINK
Thanks for the reply
I thought so. Now How would I actually initialized them?
Doing a x As New interface generates an error.
Sep 23, 2009 08:54 PM|atconway|LINK
Did you get this solved here on your other thread which appears to be the same issue:
If not, I reccomend getting the API documentation from Cybersource and looking at thier code examples. I have done something similar with PayPal before, and you can look at their documentation to see best how to use their exposed .dll.
As a last resort you can use that reflection tool offered previously, but it would be odd that CyberSource does not offer some sort of documentation or support for their provided .dll.
There are some great support links for developers on the CyberSource site which you should look into if you have not already: