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

Calling MC++ methods in C# application

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
Jul 21 '05 #1
3 1570
"QINGFENG" <qf*****@yahoo.com> wrote in message
news:f7****************************@phx.gbl...
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.

Jul 21 '05 #2
"DM McGowan II" <no****@nospam.net> wrote in message
news:74********************@comcast.com...
"QINGFENG" <qf*****@yahoo.com> wrote in message
news:f7****************************@phx.gbl...
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?

Jul 21 '05 #3


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!
Jul 21 '05 #4

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

Similar topics

8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
3
by: QINGFENG | last post by:
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...
1
by: MC-Advantica | last post by:
Does anyone have a simple "Hello World" like application that demonstrates unmanaged C++ calling managed C++ developed in VS2005? I'm confused by many posts as they discuss managed extensions from...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
7
by: Jeremy Chaney | last post by:
I have an application written in C# that uses objects written in a managed C++ DLL. When I exit my app, my C# classes have their destructors called, but the MC++ objects that those classes hold...
3
by: koredump | last post by:
Is the following legal/recommended? (It compiles w/o error or warnings) class MyClass() { public MyClass() { } private string NonStaticMethod()
1
by: jsavagedesign | last post by:
This is a project I have been working on lately and I keep running into problems. The idea is to be able to attaching an animation to a movie clip and call it later. Or multiple animation at once. ...
1
by: A. Nonymous | last post by:
First off, I would like to state that I'm using VS.2003 / .NET Framework 1.1 and the MC++ that comes with it. I am stuck with this IDE for the time being as I am supporting some older platforms. ...
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: 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...
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:
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
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
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.