473,396 Members | 2,010 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,396 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 1572
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.