Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

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.InteropServices.COMException' occurred in mscorlib.dll but was not handled in user code. Additional information: Exception from HRESULT: 0x800A017C (CTL_E_INVALIDPROPERTYVALUE)

Anyone's seen this error. This is my code:

Imports System.Runtime.InteropServices
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()



 
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

There are too many unknowns here, and I haven't seen that error, but my first guess is that you are not going to get that to work.

Bob
Avatar of Camillia

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
my coworker has the academic version of VB6...

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
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.




ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ah, silly me. Thanks

Kamila.
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...
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", " ", " ")
i think i found my answer. Compiled it into a dll. Will try it from .Net.