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? 5 1256
"David C" <pr********@gmail.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
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?
"David C" <pr********@gmail.comwrote in message
news:11**********************@d57g2000hsg.googlegr oups.com...
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.
>
How does the COM interface and coclass definition looks like when using oleview.exe on the
typelib?
I did look at it using oleview and the class I am interested in should
have a property called UserID, but it is listed as a method. This is
what it looks like.
[id(0x6803000e), propput]
void UserId([in, out] BSTR* rhs);
I don't have the slightest idea what I am looking at. I asked the VB
developer to just make it a string property (UserID, that is), but I
don't know what oleview is telling me.
Are you sure you have registered the correct dll before importing? Try to re-register the
dll using regsvr32.exe
After I posted, I did just that and I am not getting the "COM
object ....not registered" error any more. I thought I could treat
the interlop assembly like any other .NET assemblies, but I guess
not. The memories of DLL registration hell coming back...
"David C" <pr********@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
>
>> How does the COM interface and coclass definition looks like when using oleview.exe on the typelib?
I did look at it using oleview and the class I am interested in should
have a property called UserID, but it is listed as a method. This is
what it looks like.
[id(0x6803000e), propput]
void UserId([in, out] BSTR* rhs);
I don't have the slightest idea what I am looking at. I asked the VB
developer to just make it a string property (UserID, that is), but I
don't know what oleview is telling me.
>Are you sure you have registered the correct dll before importing? Try to re-register the dll using regsvr32.exe
After I posted, I did just that and I am not getting the "COM
object ....not registered" error any more. I thought I could treat
the interlop assembly like any other .NET assemblies, but I guess
not. The memories of DLL registration hell coming back...
A COM dll stay's a COM dll, and must be registered, this has nothing to do with .NET. Note,
that I don't know how you were able to set a reference to a non-registered COM DLL though,
you must have done something wrong.
The UserId property is passing a BSTR (Basic String), which will be marshaled as a CLI
Object.String by the COM interop marshaler when returned from COM. That means that a
'string' is the correct type for the property in C#.
Willy.
>
A COM dll stay's a COM dll, and must be registered, this has nothing to do with .NET. Note,
that I don't know how you were able to set a reference to a non-registered COM DLL though,
you must have done something wrong.
I did Project->Add Reference. Clicked on the Com tab, clicked
"Browse" and found the COM dll and just imported it that way. From
there, I was able to use it.
The UserId property is passing a BSTR (Basic String), which will be marshaled as a CLI
Object.String by the COM interop marshaler when returned from COM. That means that a
'string' is the correct type for the property in C#.
MyClass.UserId does not compile. I cannot read it or assign a value
to it. And in .NET, the data type is System.Inptr, not string. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sheri |
last post by:
Our working environment traditionally has a new project
(application) that has multiple developers within the
development of that project. I need to know the best way
to start development. Is it...
|
by: Doug |
last post by:
I am working on an existing .NET (C Sharp) component that had a com
interface that was used by a VB component. When it was originally
written, it had the SSEAssemblyCom class below - minus the two...
|
by: Kelly |
last post by:
hi all,
it's me again. i'm using ASP.NET Web Application, using a "File Field"component under HTML tab and i do a right click on the component and select "Run As Server Control". This was done...
|
by: Notlwonk |
last post by:
Not sure where to post this Q
I am trying to write a Managed Exchange Server Event Sink (as a class library) in C#
I have been following this tutorial step-by-step
...
|
by: Kelly |
last post by:
hi all,
it's me again. i'm using ASP.NET Web Application, using a "File Field"component under HTML tab and i do a right click on the component and select "Run As Server Control". This was done...
| |
by: Kelly |
last post by:
hi all,
it's me again. i'm using ASP.NET Web Application, using a "File Field"component under HTML tab and i do a right click on the component and select "Run As Server Control". This was done...
|
by: erin.sebastian |
last post by:
Hello Everyone,
I have code that uploads files in asp. It seems to be working however
on files > 200kb it bombs and i don't know why. Does anyone have any
idea of why this would occur and what i...
|
by: tshad |
last post by:
This has been driving me crazy.
I have been trying to get the error handling working on my system and can
get parts of it working and others won't work at all.
I found that you can't access...
|
by: Don |
last post by:
Getting errors after following the MSDN article on using VB.NET (and VS2005)
for "Implementing a Managed OnSave Event Sink" for Exchange Server 2007. Not
sure, but part of the problem may be that...
|
by: wvueagle84 |
last post by:
I have the following code in which I am attempting to break a large
image up in 16x16 blocks and perform some processing on those blocks.
For debugging I would like to save each of the 16x16 blocks...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |