PC Review


Reply
Thread Tools Rate Thread

Calling MC++ methods in C# application

 
 
QINGFENG
Guest
Posts: n/a
 
      20th May 2004
Hi,

I am writing a Managed C++ wrapper DLL for some C
functions in a statically linked library, such that I can
use those C functions (through the C++.NET Wrapped
mehtods) in a C# Windows User Control.

The C function is: someFunction(HINSTANCE hinst); // the
parameter is HINSTANCE.

How can I write a correct wrapper function in MC++ for the
above function? In another word, What can I pass in as a
HINSTANCE? Note that this MC++ method will be called in C#
program.

Thanks
 
Reply With Quote
 
 
 
 
DM McGowan II
Guest
Posts: n/a
 
      20th May 2004
"QINGFENG" <(E-Mail Removed)> wrote in message
news:f78601c43e05$a4b3c560$(E-Mail Removed)...
> Hi,
>
> I am writing a Managed C++ wrapper DLL for some C
> functions in a statically linked library, such that I can
> use those C functions (through the C++.NET Wrapped
> mehtods) in a C# Windows User Control.
>
> The C function is: someFunction(HINSTANCE hinst); // the
> parameter is HINSTANCE.
>
> How can I write a correct wrapper function in MC++ for the
> above function? In another word, What can I pass in as a
> HINSTANCE? Note that this MC++ method will be called in C#
> program.
>
> Thanks


Perhaps Marshal.GetHINSTANCE.

 
Reply With Quote
 
DM McGowan II
Guest
Posts: n/a
 
      21st May 2004
"DM McGowan II" <(E-Mail Removed)> wrote in message
news:74WdncdQu7ENsTHdRVn-(E-Mail Removed)...
> "QINGFENG" <(E-Mail Removed)> wrote in message
> news:f78601c43e05$a4b3c560$(E-Mail Removed)...
> > Hi,
> >
> > I am writing a Managed C++ wrapper DLL for some C
> > functions in a statically linked library, such that I can
> > use those C functions (through the C++.NET Wrapped
> > mehtods) in a C# Windows User Control.
> >
> > The C function is: someFunction(HINSTANCE hinst); // the
> > parameter is HINSTANCE.
> >
> > How can I write a correct wrapper function in MC++ for the
> > above function? In another word, What can I pass in as a
> > HINSTANCE? Note that this MC++ method will be called in C#
> > program.
> >
> > Thanks

>
> Perhaps Marshal.GetHINSTANCE.
>


So is that what you were looking for or are you just one of those new
generation types that asks for help but doesn't know how to be gracious and
tell someone yes that worked or no that wasn't it?

 
Reply With Quote
 
DUAN
Guest
Posts: n/a
 
      28th Jul 2004


You are right. I should have replied back with some points. Actually, I
did not try the proposed method. Just in my case, I passed a
System.IntPtr(0) and it worked fine.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Re: Calling .Net 2.0 Methods from .Net 1.1 Ignacio Machin \( .NET/ C# MVP \) Microsoft Dot NET Framework 0 15th Dec 2006 08:11 PM
All calling methods John Bailo Microsoft Dot NET 2 15th Aug 2006 09:35 PM
Calling methods Jon Microsoft VB .NET 1 3rd Oct 2005 10:43 AM
Calling MC++ methods from VB.NET =?Utf-8?B?Um9i?= Microsoft VC .NET 4 15th Mar 2004 05:01 AM
Calling methods in a VB.NET dll from VB 6.0 Gayanga Alagiyawanna Microsoft Dot NET 1 21st Jul 2003 11:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 PM.