Re: Working with a VB COM Component
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Sun, 25 Mar 2007 10:27:43 +0200
"David C" <profnachos@xxxxxxxxx> wrote in message news:1174809711.795443.311750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is my first time having to integrate a COM component into my
dotnet project. The COM component is from a VB developer, so I have
no control over his code.
I am having the following issues after importing the COM object into
Visual Studio (2003, not 2005).
When I create an instance of a class (Jobs jobs = new Jobs()), I get
the following error message.
COM object with CLSID {6FC1CF2C-BC59-4B78-AF18-B162F2D12CA6} is either
not valid or not registered.
Also, I expected the property I needed (Let's call this UserID) to be
a string. But its datatype is System.IntPtr. Huh? What is that?
But then when I force a string and compile just to see, I get the
following compilation error.
Property, indexer, or event 'UserId' is not supported by the language;
try directly calling accessor method
'OdysseyCO._PetroToolsJobs.set_UserId(ref string)'
Now that's interesting. So I followed the recommendation and
tried .set_UserId(ref string). .set_UserId does not show up in my
intellisense, but the code compiles!
So unless there are other things I should try (can't imagine there are
any), what should I tell the VB developer?
How does the COM interface and coclass definition looks like when using oleview.exe on the typelib?
Are you sure you have registered the correct dll before importing? Try to re-register the dll using regsvr32.exe
Willy.
.
- Follow-Ups:
- Re: Working with a VB COM Component
- From: David C
- Re: Working with a VB COM Component
- References:
- Working with a VB COM Component
- From: David C
- Working with a VB COM Component
- Prev by Date: Re: Visibility of Form1 question.
- Next by Date: Re: Add new users to SQL Server mdf
- Previous by thread: Re: Working with a VB COM Component
- Next by thread: Re: Working with a VB COM Component
- Index(es):
Relevant Pages
|