This blog is about developing Windows applications using Visual Studio. All postings on this weblog are provided "AS IS" with no warranties, and confer no rights. Use of any samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Your host Nikola Dudar is a Program Manager in Windows division of Microsoft Corporation. He has been working on Windows Web Services API during Windows 7 and various additions to Visual C++ during VS2005 and VS2008. More details are in LinkedIn profile under Nikola's formal name Mykola Dudar.
If you are interested in program management and project management, check out my other blog at http://www.pmsnack.com/ where I collect best practices and other topics interesting to program and project managers.
To send feedback, comments or requests for new posts, please use the contact form.
Today when I have been cleaning folders on my hard drive, I have found yet another demo project. I have built it sometime ago to demonstrate how how one can have C# and C++ project in one solution and link them both into one binary using C++ linker. It looks like it had never found its way to my blog and I have decided to fix this by posting it today.
For this demo, I have generated WCF service server and client in C# and then build C# code into a .netmodule and linked it together with C++ code into one binary. Same time I build C# as another client just for testing purpose. Most if not all code is generated from IDE using standard wizards.
To achieve this I had to do the following in addition to generating all C# code:
1) I created a Pre-Build event using information from Build.log for C# project to link C# code into a .net module
2) I changed linker settings for C++ code.
a. I have added path to C# .netmodule to Add Module Assembly (/ASSEMBLYMODULE)
b. I had to change to use LTCG in Debug mode also
c. and Additional Includes settings in command line
3) Added #using<> in my cpp code to reference C# .net module
4) Changed Additional include settings such that compiler can find .netmodule when compiling C++ code.
That should be all one has to do to repeat this task. When I worked on the sample, I was primarily interested in demonstrating that using similar approach one can keep most of application native and rebuild one component as managed (/clr) in order to start using C# code and VS IDE wizards for generating WCF service clients. Perhaps someone else may find this sample interesting. I am attaching a zip file with source code to the post.
Today when I have been cleaning folders on my hard drive, I have found yet another demo project. I have
Interesting example. Since it is the mix of C# and C++, how can we debug into the C# code?