Camillia
asked on
COM Interop error
We have a COM code written in a proprietory language that's similar to VB4.
I registered the dll. Created a new instance, call it's method with the parameters but I get this error:
An exception of type 'System.Runtime.InteropSer vices.COME xception' occurred in mscorlib.dll but was not handled in user code. Additional information: Exception from HRESULT: 0x800A017C (CTL_E_INVALIDPROPERTYVALU E)
Anyone's seen this error. This is my code:
Imports System.Runtime.InteropServ ices
Imports IBM.Data.DB2.iSeries
Dim cnn As New iDB2Connection("....")
cnn.Open()
Dim test As New SysWD001.AlcCardD
test.PopScreen("A00036", "06", " ", "100", "Database100", "HEAT", "LAPTOP", "100", "ENGLISH", " ", " ")
cnn.Close()
I registered the dll. Created a new instance, call it's method with the parameters but I get this error:
An exception of type 'System.Runtime.InteropSer
Anyone's seen this error. This is my code:
Imports System.Runtime.InteropServ
Imports IBM.Data.DB2.iSeries
Dim cnn As New iDB2Connection("....")
cnn.Open()
Dim test As New SysWD001.AlcCardD
test.PopScreen("A00036", "06", " ", "100", "Database100", "HEAT", "LAPTOP", "100", "ENGLISH", " ", " ")
cnn.Close()
ASKER
i think so as well. Making one change to that proprietory code and see. Then I guess i have to break the bad news to my manager.
Do you have VB6? It might be possible to create a .NET COM wrapper from a VB6 wrapper for the proprietary code set.
Bob
Bob
ASKER
my coworker has the academic version of VB6...
How can I created a .Net COM wrapper from a VB6 wrapper?
How can I created a .Net COM wrapper from a VB6 wrapper?
VB6 ActiveX DLLs can be added through the 'Add Reference' dialog on the 'COM' tab. You need to make sure that the ActiveX DLL is registered correctly on the development and target machines.
Bob
Bob
ASKER
Sorry, I'm lost...
I have the proprietory dll...i have .Net... but where does that VB6 ActiveX DLL comes into play??
I do see "Add Reference" /COM tab when I right click on References in .Net.
I have the proprietory dll...i have .Net... but where does that VB6 ActiveX DLL comes into play??
I do see "Add Reference" /COM tab when I right click on References in .Net.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ah, silly me. Thanks
Kamila.
Kamila.
ASKER
I had to install VB6 on my laptop..
I opened an ActiveX dll project, referenced the proprietory dll by using "projects/references".
I created a Sub but Not sure why i get "compile error : ="
Public Sub MyTest()
Dim test As New AlcCard
test.PopScreen("A36", "06", " ", "100", "Database100", "HEATH", "LAPTOP", "100", "ENGLISH", " ", " ")
End Sub
*** That whole test.Popscreen line is red and that's where i get the error. I cant get past this to compile it into a dll...
I opened an ActiveX dll project, referenced the proprietory dll by using "projects/references".
I created a Sub but Not sure why i get "compile error : ="
Public Sub MyTest()
Dim test As New AlcCard
test.PopScreen("A36", "06", " ", "100", "Database100", "HEATH", "LAPTOP", "100", "ENGLISH", " ", " ")
End Sub
*** That whole test.Popscreen line is red and that's where i get the error. I cant get past this to compile it into a dll...
ASKER
wonder why i dont get an error with this code. My code above in VB.Net gives me no errors. I guess the syntax is different:
Dim test As New AlcCard
test = AlcD.PopScreen("A36", "06", " ", "100", "Database100", "HEATH", "LAPTOP", "100", "ENGLISH", " ", " ")
Dim test As New AlcCard
test = AlcD.PopScreen("A36", "06", " ", "100", "Database100", "HEATH", "LAPTOP", "100", "ENGLISH", " ", " ")
ASKER
i think i found my answer. Compiled it into a dll. Will try it from .Net.
Bob