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

Using C# dll as COM in an MFC application

Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.

I use the code as follow:
_NewActivationPtr myActivation = NULL;

HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaAct ivation));

I don't what to do.

Do I have to use GACUtil to register?

If I want to use GACUtil do I have to sign my project?

Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a compilation
error, caused because the 3rd party library is not signed, I guess).

Please help,

Thanks,

Janiv Ratson.
Aug 17 '06 #1
3 1902
"Janiv Ratson" <janivr@gmailcomwrote in message
news:uE**************@TK2MSFTNGP03.phx.gbl...
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.
I'm not sure if it will help, but I posted a step-by-step example of using a
managed assembly as a COM object from native code here:

http://groups.google.com/group/micro...153307ba483255

Regards,
Will
Aug 17 '06 #2
Hi,
In addition to DePalo post take a look at the latest number of MSDN
magazine, it has one article about that precise subject.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Janiv Ratson" <janivr@gmailcomwrote in message
news:uE**************@TK2MSFTNGP03.phx.gbl...
Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.

I use the code as follow:
_NewActivationPtr myActivation = NULL;

HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaAct ivation));

I don't what to do.

Do I have to use GACUtil to register?

If I want to use GACUtil do I have to sign my project?

Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a
compilation error, caused because the 3rd party library is not signed, I
guess).

Please help,

Thanks,

Janiv Ratson.


Aug 17 '06 #3
Did you RegAsm the Assembly? Importing may register only the type library.

"Janiv Ratson" <janivr@gmailcomwrote in message
news:uE**************@TK2MSFTNGP03.phx.gbl...
Hello,
I have written a C# dll in VS2005.
One interface and class are exported using Interop Services.
I want to use this c# dll in my MFC application, using VS2003.
It compiles after I imported the dll to my MFC app.
On runtime I get class not registered HR error in my MFC project.

I use the code as follow:
_NewActivationPtr myActivation = NULL;

HRESULT hr = myActivation.CreateInstance(__uuidof(NewSupernaAct ivation));

I don't what to do.

Do I have to use GACUtil to register?

If I want to use GACUtil do I have to sign my project?

Trying do it had failed, because my third party library I'm using in my C#
dll is not signed (so if I choose to sign my project, there is a
compilation error, caused because the 3rd party library is not signed, I
guess).

Please help,

Thanks,

Janiv Ratson.


Aug 17 '06 #4

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

Similar topics

11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
12
by: Charlie | last post by:
Hi: My host will not allow me use a trusted connection or make registry setting, so I'm stuck trying find a way to hide connection string which will be stored in web.config file. If I encrypt...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
5
by: Mike in Santa Rosa | last post by:
I'm trying to get a simple c# app built that can launch/manipulate an excel workbook, sheet. I've chased down several examples and can't any of them to work. So I must be doing somethnig obviouslt...
1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
8
by: inpuarg | last post by:
I 'm developing a c# (.net 2.0) windows forms application and in this application i want to connect to a java servlet page (HTTPS) (which is servlet 2.4 and which may be using Web Based SSO Sun...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi all, I have a publishing Click Once of my application. Now I want create new version of my application for modify some files, like app.config.
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
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...
0
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 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.