Link to home
Start Free TrialLog in
Avatar of DevLSS
DevLSSFlag for United States of America

asked on

Calling a VB.Net call from a VB6 program

Hello all,
I built a VB.Net (2010) class with the idea that it should be callable from a VB6 program. I used as reference the instructions here: http://support.microsoft.com/kb/817248 and here http://www.codeproject.com/KB/vb/MusaExposingCOM.aspx in building the class.
I added the tlb file to the VB6 references and all the class members as visible to the VB6 Object Browser. All good news so far.
The VB6 program instantiates the class this way:
Dim myclass As New ComHL7ClassLibrary1.ComHL7FileClass

Open in new window

However when I try to set the first property:
myclass.HL7Filename = "C:\Users\myfile.txt”

Open in new window

I get a runtime error:
Runtime error: -2147467261(80004003)
Automation error
Invalid pointer

The property code is pretty standard:
Public Property HL7Filename As String
        Get
            Return pFilename
        End Get
        Set(ByVal value As String)
            If File.Exists(value) Then
                pFilename = value
            End If
        End Set
    End Property

Open in new window

I tried instantiating the class with a CreateObject call. That didn’t work either.

Any ideas?
Thanks In advance.
ASKER CERTIFIED SOLUTION
Avatar of DevLSS
DevLSS
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