If you have a PH account, you can customize your PH profile.
*/

Other Views

corner
*/

CSHARP FAQ - Using VC++ 6.0 Class in C#

How do I use a class developed by VC++6.0 in C#?

A full length tutorial on how this can be done is beyond the scope of this answer. However here is a background:

C# supports calling unmanaged code. Depending on the type of C++ project, you may be able to call it using COM Interop or PInvoke. ===== 1. Platform Invocation Service: ===== Platform Invoke Services acts as a bridge between the managed and unmanaged code. They enable the managed code to call the functions which are being exposed by the dynamic link libraries such as Win32 API’s and custom DLL’s.

Supply a DllImport attribute. Declare the methods in your .NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you’re just providing declarations for method signatures.

===== 2. COM Interop Services: ===== This enables the managed code to interact with the COM objects. One way is you use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.

You can reference the Microsoft’s MSDN site for detailed examples and tutorials.

Index
corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings