473,406 Members | 2,352 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,406 software developers and data experts.

Calling c# code from c++

Hi,
I have an C++ MFC application and a c# DLL (which contains a Form class).
I want to invoke the c# dialog from the C++ application.

How do I do it ?

thanks,
Yoav.
Sep 27 '06 #1
3 3871
Hi,

You have to make the DLL visible to COM ( a check mark in the project
properties )

Then ou can use it as any other COM component
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Yoavo" <yo**@cimatron.co.ilwrote in message
news:uv****************@TK2MSFTNGP05.phx.gbl...
Hi,
I have an C++ MFC application and a c# DLL (which contains a Form class).
I want to invoke the c# dialog from the C++ application.

How do I do it ?

thanks,
Yoav.

Sep 27 '06 #2
Yoavo wrote:
Hi,
I have an C++ MFC application and a c# DLL (which contains a Form
class). I want to invoke the c# dialog from the C++ application.

How do I do it ?
If you are compiling your MFC application with VC++ 2005, then you can
easily add a managed module to your MFC application to call the C# dialog.
There's also a CWinFormsView class that lets you host a WinForms form inside
an MFC View object, so it can interact with the rest of your UI just like
any view.

If you're using VC 7 or 7.1, you can still add a managed module to your MFC
application to provide the bridge to the C# form.

If you're using VC6 or earlier, then COM interop is about your only option.

-cd
Sep 27 '06 #3
Hi Carl,
Does your first solusion ("add a managed module to your MFC...") relevant
for unmanaged application (my MFC application is unmanaged).
If so, how do I add a managed module to my MFC application ?

Yoav.

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
Yoavo wrote:
>Hi,
I have an C++ MFC application and a c# DLL (which contains a Form
class). I want to invoke the c# dialog from the C++ application.

How do I do it ?

If you are compiling your MFC application with VC++ 2005, then you can
easily add a managed module to your MFC application to call the C# dialog.
There's also a CWinFormsView class that lets you host a WinForms form
inside an MFC View object, so it can interact with the rest of your UI
just like any view.

If you're using VC 7 or 7.1, you can still add a managed module to your
MFC application to provide the bridge to the C# form.

If you're using VC6 or earlier, then COM interop is about your only
option.

-cd


Sep 28 '06 #4

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

Similar topics

5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
7
by: Klaus Friese | last post by:
Hi, i'm currently working on a plugin for Adobe InDesign and i have some problems with that. I'm not really a c++ guru, maybe somebody here has an idea how to solve this. The plugin is...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
1
by: Jesse McGrew | last post by:
Hi all, I'm trying to make a plugin DLL for a third-party application, using VC++ .NET 2003. This DLL acts as a bridge between the C++ plugin API of the application, and my actual plugin code...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
1
by: desmcc | last post by:
Hi, I am launching a modal dialog through the usual javascript (window.showmodaldialog). When the modal dialog is complete (ie user selects OK), the calling page then refreshes itself by setting...
3
by: Mike | last post by:
Timeout Calling Web Service I am calling a .NET 1.1 web service from an aspx page. The web service can take several minutes to complete its tasks before returning a message to the aspx page. ...
16
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
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,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.