473,385 Members | 1,752 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.

Call a dot-net dll from C++

AHN
Hi, please instruct somebody how to call a dll written in dot-net from a C++
program. Thanks
Nov 17 '05 #1
5 6950
AHN,

You have two options. The first is to expose your .NET dll through COM,
and then access your .NET objects through COM in your C++ program.

The other option is to use mixed mode development in C++, which will
allow you to run sections of managed and unmanaged code together.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"AHN" <an****@excite.com> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
Hi, please instruct somebody how to call a dll written in dot-net from a
C++
program. Thanks

Nov 17 '05 #2
AHN
Thanks a lot, could you please be a little more specific. A small code
snippet, maybe. How'm I exposing dll through COM?
Where to look? Thank you.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eV**************@TK2MSFTNGP15.phx.gbl...
AHN,

You have two options. The first is to expose your .NET dll through COM,
and then access your .NET objects through COM in your C++ program.

The other option is to use mixed mode development in C++, which will
allow you to run sections of managed and unmanaged code together.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"AHN" <an****@excite.com> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
Hi, please instruct somebody how to call a dll written in dot-net from a
C++
program. Thanks


Nov 17 '05 #3
Hello

You can use REGASM (Assembly Registration Tool) for it, which allows COM
clients to create .NET Framework classes transparently.

See here:
http://msdn.microsoft.com/library/de...lregasmexe.asp

--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"AHN" <an****@excite.com> wrote in message
news:ec**************@tk2msftngp13.phx.gbl...
Thanks a lot, could you please be a little more specific. A small code
snippet, maybe. How'm I exposing dll through COM?
Where to look? Thank you.

Nov 17 '05 #4
AHN
That is just for registering the dll. After that you need to reach it from
code which is elementary from unmanaged VB but very hard from (mainframe)
c++. Until now I haven't succeeded. The recipes in the help don't work so
far for me. Actually, you can create an old vb app calling a dot.net dll and
then access that vb dll from c++.

Andrew Kirillov" <an*************@gmail.com> wrote in message
news:e8**************@TK2MSFTNGP15.phx.gbl...
Hello

You can use REGASM (Assembly Registration Tool) for it, which allows COM
clients to create .NET Framework classes transparently.

See here:
http://msdn.microsoft.com/library/de...lregasmexe.asp

--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"AHN" <an****@excite.com> wrote in message
news:ec**************@tk2msftngp13.phx.gbl...
Thanks a lot, could you please be a little more specific. A small code
snippet, maybe. How'm I exposing dll through COM?
Where to look? Thank you.


Nov 17 '05 #5
What exactly do you mean with (mainframe) C++?
Managed code can be called from C++ by means of:
- COM interop (this is the regasm stuff), or
- using a managed wrapper written in ME C++ (or the upcoming VS2005
C++/CLI).
Willy.

"AHN" <an****@excite.com> wrote in message
news:uM**************@TK2MSFTNGP12.phx.gbl...
That is just for registering the dll. After that you need to reach it from
code which is elementary from unmanaged VB but very hard from (mainframe)
c++. Until now I haven't succeeded. The recipes in the help don't work so
far for me. Actually, you can create an old vb app calling a dot.net dll
and
then access that vb dll from c++.

Andrew Kirillov" <an*************@gmail.com> wrote in message
news:e8**************@TK2MSFTNGP15.phx.gbl...
Hello

You can use REGASM (Assembly Registration Tool) for it, which allows COM
clients to create .NET Framework classes transparently.

See here:
http://msdn.microsoft.com/library/de...lregasmexe.asp

--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
"AHN" <an****@excite.com> wrote in message
news:ec**************@tk2msftngp13.phx.gbl...
Thanks a lot, could you please be a little more specific. A small code
snippet, maybe. How'm I exposing dll through COM?
Where to look? Thank you.


Nov 17 '05 #6

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

Similar topics

2
by: Julien Phalip | last post by:
Hi everyone! I am doing an XSL transformation from the following XML file: <foo> <attribute>a</attribute> </foo> The xslt file is:
1
by: lars | last post by:
Hi, we use DoxyGen together with the DOT tool of AT&T to document our sources. Here now is my problem (trying to explain as well as I can): I intend to generate call graphs with the help of...
3
by: Epetruk | last post by:
If I have a snippet of javascript code like this: var str = "This is a snippet; str.replace(/ */gi,' '); what should the call to replace do? My actual tests show that it inserts spaces...
7
by: Tim ffitch | last post by:
Hi I have created a VB dll file that contains common functions I use across various projects in VB, Access and Excel. Rather than have to code the functions in each I decided to use the dll...
2
by: BUX | last post by:
I have to call Forms!myForm.myControl_AfterUpdate using myString = "Forms!myForm.myControl_AfterUpdate". I have tried with Application.Run myString Call myString eval myString
4
by: supermamie | last post by:
I need to call a function in a C++ dll from a C# program. I can pass a string for an input parameter, but how do I get the returned string? The original C++ function : TransformString(char*) sb...
26
by: Paul | last post by:
public class A { public A () { // here I would like to call the second version of _ctor, how to accomplish this ? } public A (int a, int b, int c) {
2
by: J.J. Feminella | last post by:
Is it possible to use reflection to get the name of methods on the call stack as well as their supplied parameters and method signatures? Thanks in advance. Best wishes, j^2
7
by: horacius.rex | last post by:
Hi, I want to profile a C program I am writting, so I compile it with -pg options and use gprof to obtain information about call graphs, which I am really interested in. I look at the text files...
34
by: Srinu | last post by:
Hi all, Can we assign return value of a function to a global variable? As we know, main() will be the first function to be executed. but if the above is true, then we have a function call before...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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.