views:

94

answers:

1

When I create a project in vs2005. I can also create Win32->Win32Project. I can choose "console application" or "dll" or "static library"

if I created a static library project. How can I convert it to dll project. I found in setting panel of the created project. General->Configuration Type, I can switch Static Library(.lib) to DLL However, after this setting. I does get a dll. but I do not have a lib with it. and I can not use it in other project. How to convert a static library project into a dll project in VS2005 many thanks!

A: 

The way I've done this, and this may not be the "best" way, was to create a new project with the right settings (DLL in this case) and then create the stub methods with the wizards that I want to expose from the static library.

Then you have two choices, you can leave the real code in the static library and just have your stubs in the DLL call into the static library, or you can copy the code out of the static library project and retire the static library entirely.

The advantage of the first option is that you can support both the static library and the DLL without having to duplicate a lot of work. But if you can get rid of supporting the static library entirely the second option is probably better because you don't have to make changes in two different projects (adding the stub method in the DLL and the real code to the static lib) every time you want to add a new method/property. YMMV

Doug Boone