[Webinar] Learn how to a build a cloud-first strategyRegister Now


How can I export a Function from c# for c++ to use?

Posted on 2011-05-04
Medium Priority
Last Modified: 2012-05-11
Hello Experts,

I need to give access tp my dll to a c++ program.  The dll is written in C# and is a form.

Basically I need to use something like " exported function ShowDialog(HWN hParent)" to be called from c++.

How would I do this?

Thank you
Question by:dbdp
1 Comment
LVL 31

Accepted Solution

Zoppo earned 2000 total points
ID: 35690135
Hi dbdp,

I have to admit that I never did such befor so I have no experience with this, but AFAIK you can do this only using COM - here's a MSDN article about how to implement an interface in the C# DLL and how to use it via COM in the native C++ code: http://support.microsoft.com/kb/828736/en-us

Hope that helps,


Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Suggested Courses

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question