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?
3 1721
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
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,
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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,...
|
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....
|
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...
|
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...
|
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)
{
...
|
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)
{
...
|
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:...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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: 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...
| |