473,385 Members | 1,890 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,385 software developers and data experts.

CLSID not found

7
Hello everyone!

I want to call a method written in C# from a C++ level.

To do this I create a C# class, I wrap it with [ComVisible(true)] atribute, rightclick on a project , I click "register for COM interop" and rebuild the whole solution (just a standard procedure recommended in this situation)

Then I start a new project in C++ and I want to call my COM object using a construction : "HRESULT hr = CoCreateInstance(CLSID_... " - but, by using an intellicense, I can't find my class (created in c#).

Any idea why my c# COM object didn't received an CLSID number after being build in .NET?

or maby my problem has anothers bases?
Jul 10 '07 #1
3 1721
Frinavale
9,735 Expert Mod 8TB
Hello everyone!

I want to call a method written in C# from a C++ level.

To do this I create a C# class, I wrap it with [ComVisible(true)] atribute, rightclick on a project , I click "register for COM interop" and rebuild the whole solution (just a standard procedure recommended in this situation)

Then I start a new project in C++ and I want to call my COM object using a construction : "HRESULT hr = CoCreateInstance(CLSID_... " - but, by using an intellicense, I can't find my class (created in c#).

Any idea why my c# COM object didn't received an CLSID number after being build in .NET?

or maby my problem has anothers bases?
Have you registered the C# Com DLL with windows?
(using the regsvr32 command line tool is the easiest way I've found)

If it has been registered, have you given your C++ project permissions to use it?

-Frinny
Jul 10 '07 #2
Mannie
7
Have you registered the C# Com DLL with windows?
(using the regsvr32 command line tool is the easiest way I've found)

If it has been registered, have you given your C++ project permissions to use it?

-Frinny
When I use VS 2005 application isn't it so that it does the whole job for me?? (and I don't have to use regsvr32)? - or maybe regsvr32 does something more ?

What kind of permissions in C++ project do I have to give? Could you explain me this, or perhaps send me an useful URL with explanation,please?

King regards,
Jul 10 '07 #3
Frinavale
9,735 Expert Mod 8TB
When I use VS 2005 application isn't it so that it does the whole job for me?? (and I don't have to use regsvr32)? - or maybe regsvr32 does something more ?

What kind of permissions in C++ project do I have to give? Could you explain me this, or perhaps send me an useful URL with explanation,please?

King regards,
Well the RegSvr32 registers your DLL into the Windows Registry. This is how your other applications will be able to look it up and use it.

To register you DLL in windows
  • Pick a folder to install the DLL into (your system32 folder is where all your system DLLs are installed into).
  • Move your DLL there.
  • Open a Command Line window.
  • Go to the folder where your DLL is installed.
  • Type: regsvr32 NameOfTheDLL.dll

I'd try registering the DLL and re-referencing it in your project before we get into any permissions stuff.

-Frinny
Jul 10 '07 #4

Sign in to post your reply or Sign up for a free account.

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...
4
by: Shiraz | last post by:
Hi I just made an installer package for an application in .NET which also uses COM dlls. It seems to work fine on my machine but when tried it on a co-worker's machine, the application installs,...
0
by: VB Programmer | last post by:
I tried to make a VB.NET version of this: http://neevia.com/ex036csharp.htm I keep getting this error: Server Error in '/ProposalGenerator' Application....
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...
11
Frinavale
by: Frinavale | last post by:
Hi guys, I've created a VB.Net project and have compiled it, run it, tested it on a machine that has a 32bit processor. I am now trying to move this project onto a 64bit processor server that is...
9
by: DKn | last post by:
Hi , I am having a .Net Activex control. I have done coding for COMRegistering and Unregistereing in C#.Net. The code is follows.. static void ComRegister(Type t) { ...
0
by: DKn | last post by:
Hi , I am having a .Net Activex control. I have done coding for COMRegistering and Unregistereing in C#.Net. The code is follows.. static void ComRegister(Type t) { ...
0
by: gago | last post by:
Hello, I have a problem, I have activex written in C# and deployed using the hook to run the msi file inside a cab. (based on article found here:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.