PC Review


Reply
Thread Tools Rate Thread

Call a dot-net dll from C++

 
 
AHN
Guest
Posts: n/a
 
      20th Sep 2005
Hi, please instruct somebody how to call a dll written in dot-net from a C++
program. Thanks


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      20th Sep 2005
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]
- (E-Mail Removed)

"AHN" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, please instruct somebody how to call a dll written in dot-net from a
> C++
> program. Thanks
>
>



 
Reply With Quote
 
AHN
Guest
Posts: n/a
 
      20th Sep 2005
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]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
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]
- (E-Mail Removed)

"AHN" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi, please instruct somebody how to call a dll written in dot-net from a
> C++
> program. Thanks
>
>




 
Reply With Quote
 
Andrew Kirillov
Guest
Posts: n/a
 
      21st Sep 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
AHN
Guest
Posts: n/a
 
      21st Sep 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>




 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      21st Sep 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.
>>

>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a javascript when i call an aspx page with a form html not running on server Fabio Mastria Microsoft ASP .NET 4 28th Jan 2008 09:05 AM
Warning 1684 CA2214 : Microsoft.Usage : 'RandomShade..ctor(Int32, Int32, Int32, Int32, Int32)' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences: steve bull Microsoft C# .NET 4 7th Jul 2005 05:54 PM
Are we new users supposed to call this number? I have auto dial on my XP in the dialer but am I required to call? Windows XP New Users 12 26th May 2005 03:47 PM
An outgoing call cannot be made since the application is dispatching an input-synchronous call Sagaert Johan Microsoft C# .NET 4 6th Apr 2005 12:12 AM
Re: Please help - How to call functions that exists in the main application. The call should be initiated from one of the components. Baavgai Microsoft C# .NET 0 4th Sep 2004 05:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.