visual-studio-2008migrationatlcom

Building Proxy/Stub dll in VS 2008


I have a ATL COM project migrated from VC6 to VS 2008. How do I build the PS DLL on VS2008?

New ATL projects in VS 2008 have a separate PS project which builds the PS DLL. But the migration from VC6 did not create this project.

I tried to invoke nmake on the PS mk file but that gives a redefinition error for an enum type that exists in both our source file as well as an automatically included windows header file. In the solution we fixed this by defining the WIN32_LEAN_AND_MEAN preprocessor which excludes unnecessary header files. Can I do the same while using nmake?

Is there any other way of creating the PS DLL?


Solution

  • Eran's suggestions seem logical but I was not able to find some of the items he was talking about. So I tried a different approach.

    I created an Empty ATL (Server) project in VS 2008. This automatically creates a ps project along with the normal atl project.

    I copied the vcproj file for the ps project into my project folder and renamed it to myprojectnameps.vcproj.

    Then I opened my solution and added the newly copied project to it. I renamed the project (in VS 2008) to myprojectnameps and removed all the files that were already included in it.

    Next I included my _i.c, _p.c, dlldata.c and the .def file into the project. In the settings under Linker > Input > Module definition file, I added my def file name.

    That's it! Worked like a charm.