473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

COM object with CLSID {...} is either not valid or not registered


I am stuck on one silly thing.It is just about calling unmanaged code
in the C# win/web application. This is what I did:
1) Created a VB dll xyz.dll.
2) Since this is unmanaged dll, I used tlbimp.exe file to create a
managed dll that I am using in my reference of C# project.
tlbimp d:\xyz.dll /out:D:\abc.dll

3) I inculde abc.dll in my C# project and used the following code to
access the methods of this dll.

abc.clsTest myObj = new abc.clsTest();

4) as soon as the above line is hit, I get the following error:

COM object with CLSID {....} is either not valid or not registered

So I registered xyz.dll using regsvr32 utility. But I still get this
error.

I am not able to find any relevant help on this. You have any idea?

I am pretty sure I am missing a very small thing somewhere :-(

Please help me out!

Nov 19 '05 #1
4 1459
by default vb6 creates new guids on every compile. so after every compile,
you need to re-register and rerun tlbimp.exe your other option is to change
vb6's setting to not do this (don't remember how).

-- bruce (sqlwork.com)
<c.*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...

I am stuck on one silly thing.It is just about calling unmanaged code
in the C# win/web application. This is what I did:
1) Created a VB dll xyz.dll.
2) Since this is unmanaged dll, I used tlbimp.exe file to create a
managed dll that I am using in my reference of C# project.
tlbimp d:\xyz.dll /out:D:\abc.dll

3) I inculde abc.dll in my C# project and used the following code to
access the methods of this dll.

abc.clsTest myObj = new abc.clsTest();

4) as soon as the above line is hit, I get the following error:

COM object with CLSID {....} is either not valid or not registered

So I registered xyz.dll using regsvr32 utility. But I still get this
error.

I am not able to find any relevant help on this. You have any idea?

I am pretty sure I am missing a very small thing somewhere :-(

Please help me out!

Nov 19 '05 #2
On Thu, 30 Jun 2005 14:42:32 -0700, c.verma wrote:

I am stuck on one silly thing.It is just about calling unmanaged code
in the C# win/web application. This is what I did:
1) Created a VB dll xyz.dll.
2) Since this is unmanaged dll, I used tlbimp.exe file to create a
managed dll that I am using in my reference of C# project.
tlbimp d:\xyz.dll /out:D:\abc.dll

3) I inculde abc.dll in my C# project and used the following code to
access the methods of this dll.

abc.clsTest myObj = new abc.clsTest();

4) as soon as the above line is hit, I get the following error:

COM object with CLSID {....} is either not valid or not registered

So I registered xyz.dll using regsvr32 utility. But I still get this
error.

I am not able to find any relevant help on this. You have any idea?

I am pretty sure I am missing a very small thing somewhere :-(

Please help me out!

Possible that you have not established an Interop assembly. This happens
fairly automatically when you 'Add Reference' in the IDE and choose a
regeisteres COM object.

Nov 19 '05 #3
Thanks Bruce for your answer. I think I got my answer. There can be two
ways to resolve this problem:
1) Use VS.NET to create the interop wrapper instead of tlbimp.exe. Go
to your project -> rigth click -> Add Reference -> Switch to COM tab ->
If not listed, click browse and select the xyz.dll. This will
automatically generate your interop wrapper which does all the
necessary things to run.

2) If at all you are using tlbimp.exe, make sure that a new guid is not
created everytime you compile the VB dll. For that, Set Binary
Compatibility for xyz.dll. For that: Open your VB project->Project
Properties->Compononent->Select Binary Compatibility.

Also it is always a good idea to unregister the old vb dll, create a
new abc.dll using tlbimp, and then use this abc.dll in VS.NET.
Thanks once again for the answer.

Nov 19 '05 #4

Hi verma,

i am facing the same problem. Basically i am developing a windows medi
encoder application using the managed dll which i got from online. I
runs fine ony my machine but when i copied the release folder i
different machine then it started giving exception "ClSID {} either no
valid or not registered". I dont have any idea why this is happening.
tried on different machine and it worked fine. So why is this no
working on this machine???

Thanks
vino

--
eligetivPosted from http://www.pcreview.co.uk/ newsgroup acces

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ahmed | last post by:
i have tried running the csharpsite in my Microsoft Visual C#.net and after i hit the run button i keep getting the same error which is : Server Error in '/csharpsite' Application COM object with...
1
by: Cristina Malavasi | last post by:
Hi a have a COM dll made in C++ (I don't have the source code) I used tlbimp to create a managed .NET assembly dll... I reference this dll and import it with "using myDll" then I make an object...
1
by: Jen | last post by:
Hi, I'm having an issue calling a dll from an ASP.NET page. The code that tries to instantiate a COM dll (class) is in a Class Library. I can call the code successfully from a windows...
2
by: Thomas Andersson | last post by:
Hi, I am trying to use a ActiveX Com component in a aspx web page. First I have made a reference to the .dll. I have also used aspCompat="true" in the page. Then I use the code below... ...
13
by: brianbasquille | last post by:
Hello all, Am trying to modify / update the existing open-source OpenHTPC. I've renamed most of the namespaces and some forms (as well as added my own with modifications) and everything works...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.