• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 919
  • Last Modified:

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()



 
0
Camillia
Asked:
Camillia
  • 7
  • 4
1 Solution
 
Bob LearnedCommented:
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
0
 
CamilliaAuthor Commented:
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.
0
 
Bob LearnedCommented:
Do you have VB6?  It might be possible to create a .NET COM wrapper from a VB6 wrapper for the proprietary code set.

Bob
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CamilliaAuthor Commented:
my coworker has the academic version of VB6...

How can I created a .Net COM wrapper from a VB6 wrapper?
0
 
Bob LearnedCommented:
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
0
 
CamilliaAuthor Commented:
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.




0
 
Bob LearnedCommented:
Let's try this a little slower:

1) Create a VB6 Active DLL project

2) Add a class to the VB6 project that will call the VB4 project, and provides public methods, properties, and/or events, outside of the class.

3) Build the DLL

4) Go the .NET project, and add a reference to the VB6 ActiveX DLL through the COM tab on the 'Add Reference' dialog.

Bob
0
 
CamilliaAuthor Commented:
ah, silly me. Thanks

Kamila.
0
 
CamilliaAuthor Commented:
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...
0
 
CamilliaAuthor Commented:
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", " ", " ")
0
 
CamilliaAuthor Commented:
i think i found my answer. Compiled it into a dll. Will try it from .Net.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now