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:
Imports Cybersource.cyber1.cyb
Partial Class registration
Inherits System.Web.UI.Page
Private Shared oCyb As New Cybersource.cyber1.cyb
<snip>
oCyb.EnableLog = "0"
I get:
"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
Get
Return objMerchConfig.LogDirectory
End Get
Set(ByVal value As String)
objMerchConfig.LogDirectory = value
End Set
End Property
to find out what are the methods available in the com object and try to use initialize the object before using the properties.
Thanks
KannanK7
Don't forget to click "Mark as Answer" on every post that helped you. You don't have to pick just one! ;)
This credits that member, earns you a point and marks your thread as Resolved for the sake of Future Readers.
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:
WebRuss
0 Points
19 Posts
COM object Interface issue
Sep 04, 2009 06:18 PM|LINK
Hello all
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:
Imports Cybersource.cyber1.cyb Partial Class registration Inherits System.Web.UI.Page Private Shared oCyb As New Cybersource.cyber1.cyb <snip> oCyb.EnableLog = "0"I get:
"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
My web page access the properties in my dll through :
Public Shared Property LogDirectory() As String
Get
Return objMerchConfig.LogDirectory
End Get
Set(ByVal value As String)
objMerchConfig.LogDirectory = value
End Set
End Property
That is when I get the error.
What do I need to do to make this work.
KannanK7
Member
325 Points
59 Posts
Re: COM object Interface issue
Sep 04, 2009 06:48 PM|LINK
Hi Russ,
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.
KannanK7
Don't forget to click "Mark as Answer" on every post that helped you. You don't have to pick just one! ;)
This credits that member, earns you a point and marks your thread as Resolved for the sake of Future Readers.
WebRuss
0 Points
19 Posts
Re: COM object Interface issue
Sep 04, 2009 07:03 PM|LINK
Thanks for the reply
I thought so. Now How would I actually initialized them?
Doing a x As New interface generates an error.
atconway
All-Star
16846 Points
2756 Posts
Re: COM object Interface issue
Sep 23, 2009 08:54 PM|LINK
Did you get this solved here on your other thread which appears to be the same issue:
http://forums.asp.net/p/1468080/3393167.aspx
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:
http://www.cybersource.com/support_center/implementation/downloads/
http://apps.cybersource.com/library/documentation/sbc/api_guide/html/