Converting VC++ 6.0 executable code to .Net DLL

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

I wish to convert c++ code written using VC++ 6.0 to the .Net development
environment (Visual Studio 2005).

So far I have copied the code into a new C++ Class Library project and
recompiled it. I got some errors from the linker and had to change the
configuration of the project to use the MFC as a shared dll even though the
code is mostly pure C++ - I guess there must be a reference somewhere.

Anyhow, the environment generated a main class for me, shown below, as
probably was expecting managed c++ code.

My problem is that I do not know how to export the interfaces my client C#
code would be interested in. Only the generated class is visible and the
C++ classes are not visible from within this class. The c++ code does not
belong to any namespace, as is just a large collection of classes developed
a while ago.

What would I need to do to export my C++ interfaces?

Can anyone provide a mini example of unmanaged C++ code compiled in visual
studio 2005 being called from a C# program?

Thanks in advance.

#pragma once

using namespace System;

namespace Project1 {

public ref class Example
{
// TODO: Add your methods for this class here.
};
}
.



Relevant Pages

  • Re: Win DDK 3790 cannot compile with VS 6.0, but linking error with VS. NET
    ... I guess I was spoiled by visual studio where I can put Preprocessor ... Same question also applies even with DDK build.exe utility, ... >>Windows 2000 and Windows XP drivers is expected within the shipping ... >>build environment. ...
    (microsoft.public.development.device.drivers)
  • Microsoft Express Tools (WAS: c++ programming evironment)
    ... Here is a link to the Express editions for the Microsoft tools... ... If your app is a simple utility that is designed to be Windows only, then the Express editions should do the trick nicely. ... i've seen some references to the visual studio for windows. ... developer coming from a Windows environment. ...
    (Fedora)
  • Re: Symbol macros dont capture their lexical environments?
    ... namespace you find a much more general definition, ... this case you are binding x and y in the '*bindings* namespace. ... *bindings* environment. ... the variable namespace of the global environment, or of the compiler ...
    (comp.lang.lisp)
  • Re: Startup default language in VS 8 Pro
    ... actually shows it as Visual Studio 9.0.30729.1 SP1 on the About screen, ... all of the MSDN documentation file for the installed Help content ... documentation installation which is an earlier version and is so designated ... Would using a run command that is targeted to the environment profile ...
    (microsoft.public.vstudio.general)
  • Re: VB or VC++ for DirectShow programming ?
    ... because I didn't have access to the full Visual Studio ... considering it's a free development ... the only development environment one would need. ... discussion of what everything manifests do and are used for. ...
    (microsoft.public.win32.programmer.directx.video)