That page is for Managed extensions for C++ .NET 1.1 A much better solution would be to use C++/CLI (the managed version of C++ available in .NET 2.0). Obviously this depends on whether you want backward compatability with .NET 1.1.
Just create a C++ Class Library with the wizard, create a managed (ref) class and start calling your stuff. You will need to convert some .NET types into unmanaged types and vice-versa. The System.Runtime.Interop.Marshal namespace should have all you need to do that. If you already have a C++ DLL project then you can convert it into a managed app by adding the /clr switch (selectable in the project options). Then add a managed class, etc. Cheers, Kev -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark Sent: 16 November 2007 16:58 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] calling c++ dll from C#.... Ok....seems reasonable... So you manually effectively decorate the unmanaged C++ code with managed code....which you then in turn can call from C#? Any good reference....I did find http://www.codeguru.com/cpp/cpp/cpp_managed/interop/article.php/c6867/ -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Palmer Sent: 16 November 2007 16:56 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] calling c++ dll from C#.... A better way is to create .NET wrappers (as I mentioned earlier). You create a .NET class library using C++/CLI. And call your unmanaged DLL within your C++ code (as normal) This way you can add in an additional layer to make the calls more .NET friendly. -----Original Message----- From: Kevin Palmer Sent: 16 November 2007 16:53 To: 'Discussion of advanced .NET topics.' Subject: RE: [ADVANCED-DOTNET] calling c++ dll from C#.... http://www.adp-gmbh.ch/csharp/call_dll.html -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark Sent: 16 November 2007 16:46 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] calling c++ dll from C#.... It's just a bog standard windows dll...as far as I know. Do you know of any reasonable reference to do it? -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Palmer Sent: 16 November 2007 16:41 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] calling c++ dll from C#.... If your DLL is a COM DLL you could consider using interop. Also you can write a C++/CLI component which allows access to managed & unmanaged code, create a managed (ref) class and call unmanaged code from it. -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Mark Nicholls Sent: 16 November 2007 16:25 To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: [ADVANCED-DOTNET] calling c++ dll from C#.... Hello, can someone give me some advice about calling a unmanaged C++ dll from C#.....it also uses templates from the STL......it all sounds a bit horrible....any advice....or (good) articles on the web somewhere. =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com