Reputation: 2751
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?
Upvotes: 4
Views: 2613
Reputation: 2751
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.
Upvotes: 3
Reputation: 22030
It's been a while since I've done it, and even then I haven't had any up to date instructions, but looking back at the project now I'll try to reconstruct the process:
This is what I could get from postmorteming a project of mine. I might have skipped some steps, and there might be a better way to do that. OTOH, I haven't had any problems with the generated PS, and you might be able to fill the gaps as you go. If you do try this and find any misses, please add a comment for future reference.
Upvotes: 1