]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/projgen/makeproj.cpp
info about removal of wxhtml.rc
[wxWidgets.git] / utils / projgen / makeproj.cpp
index 1d00771ccb24beef1f9b54733308a2a618186264..0f0fdf76a94317a5e808f1db1c1383717db0fab7 100644 (file)
 #include "wx/wx.h"
 #include "wx/resource.h"
 
 #include "wx/wx.h"
 #include "wx/resource.h"
 
-#include "iostream.h"
-#include "fstream.h"
+#if wxUSE_IOSTREAMH
+#include <iostream.h>
+#include <fstream.h>
+#else
+#include <iostream>
+#include <fstream>
+#endif
 
 #include "makeproj.h"
 #include "projgenrc.h"
 
 #include "makeproj.h"
 #include "projgenrc.h"
@@ -41,6 +46,8 @@
 // private classes
 // ----------------------------------------------------------------------------
 
 // private classes
 // ----------------------------------------------------------------------------
 
+const wxStringList wxEmptyStringList;
+
 // Define a new application type, each program should derive a class from wxApp
 class MyApp : public wxApp
 {
 // Define a new application type, each program should derive a class from wxApp
 class MyApp : public wxApp
 {
@@ -54,7 +61,9 @@ public:
     virtual bool OnInit();
 
     bool GenerateSample(const wxString& projectName, const wxString& targetName,
     virtual bool OnInit();
 
     bool GenerateSample(const wxString& projectName, const wxString& targetName,
-        const wxString& path, const wxStringList& sourceFiles, const wxString& relativeRootPath = "../..");
+        const wxString& path, const wxStringList& sourceFiles, const wxString& relativeRootPath = "../..",
+        const wxStringList& extraLibsDebug = wxEmptyStringList,
+        const wxStringList& extraLibsRelease = wxEmptyStringList);
     void GenerateSamples(const wxString& dir); // Takes wxWindows directory path
 };
 
     void GenerateSamples(const wxString& dir); // Takes wxWindows directory path
 };
 
@@ -158,29 +167,31 @@ bool MyApp::OnInit()
     MyDialog* dialog = new MyDialog("VC++ MakeProject");
     dialog->ShowModal();
 
     MyDialog* dialog = new MyDialog("VC++ MakeProject");
     dialog->ShowModal();
 
+    delete dialog;
+
     return FALSE;
 }
 
 bool MyApp::GenerateSample(const wxString& projectName, const wxString& targetName,
     return FALSE;
 }
 
 bool MyApp::GenerateSample(const wxString& projectName, const wxString& targetName,
-    const wxString& path, const wxStringList& sourceFiles, const wxString& relativeRootPath)
+    const wxString& path, const wxStringList& sourceFiles, const wxString& relativeRootPath,
+    const wxStringList& extraLibsDebug, const wxStringList& extraLibsRelease)
 {
     wxString relativeIncludePath(relativeRootPath + wxString("/include"));
     wxString relativeLibPath(relativeRootPath + wxString("/lib"));
 {
     wxString relativeIncludePath(relativeRootPath + wxString("/include"));
     wxString relativeLibPath(relativeRootPath + wxString("/lib"));
-    wxString relativeDebugPath(relativeRootPath + wxString("/src/Debug"));
-    wxString relativeReleasePath(relativeRootPath + wxString("/src/Release"));
-    wxString relativeDebugPathJPEG(relativeRootPath + wxString("/src/jpeg/Debug"));
-    wxString relativeReleasePathJPEG(relativeRootPath + wxString("/src/jpeg/Release"));
-    wxString relativeDebugPathTIFF(relativeRootPath + wxString("/src/tiff/Debug"));
-    wxString relativeReleasePathTIFF(relativeRootPath + wxString("/src/tiff/Release"));
+    wxString relativeIncludePathContrib(relativeRootPath + wxString("/contrib/include"));
+    wxString relativeLibPathContrib(relativeRootPath + wxString("/contrib/lib"));
 
     wxProject project;
 
     // For all samples
 
     wxProject project;
 
     // For all samples
-    project.SetIncludeDirs(wxStringList((const char*) relativeIncludePath, 0));
-    project.SetResourceIncludeDirs(wxStringList((const char*) relativeIncludePath, 0));
-    project.SetLibDirs(wxStringList((const char*) relativeLibPath, 0));
-    project.SetDebugLibDirs(wxStringList((const char*) relativeDebugPath, (const char*) relativeDebugPathJPEG, (const char*) relativeDebugPathTIFF, 0));
-    project.SetReleaseLibDirs(wxStringList((const char*) relativeReleasePath, (const char*) relativeReleasePathJPEG, (const char*) relativeReleasePathTIFF, 0));
+    project.SetIncludeDirs(wxStringList((const char*) relativeIncludePath, (const char*) relativeIncludePathContrib, 0));
+    project.SetResourceIncludeDirs(wxStringList((const char*) relativeIncludePath, (const char*) relativeIncludePathContrib, 0));
+    project.SetLibDirs(wxStringList((const char*) relativeLibPath, (const char*) relativeLibPathContrib, 0));
+
+//    project.SetExtraLibsDebug(wxStringList("opengl32.lib", "glu32.lib", 0));
+//    project.SetExtraLibsRelease(wxStringList("opengl32.lib", "glu32.lib", 0));
+    project.SetExtraLibsDebug(extraLibsDebug);
+    project.SetExtraLibsRelease(extraLibsRelease);
 
     project.SetProjectName(projectName);
     project.SetTargetName(targetName);
 
     project.SetProjectName(projectName);
     project.SetTargetName(targetName);
@@ -222,10 +233,20 @@ void MyApp::GenerateSamples(const wxString& dir)
     GenerateSample("DynamicVC", "dynamic", dir + wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0));
     GenerateSample("DrawingVC", "drawing", dir + wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
     GenerateSample("ExecVC", "exec", dir + wxString("/samples/exec"), wxStringList("exec.cpp", 0));
     GenerateSample("DynamicVC", "dynamic", dir + wxString("/samples/dynamic"), wxStringList("dynamic.cpp", 0));
     GenerateSample("DrawingVC", "drawing", dir + wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
     GenerateSample("ExecVC", "exec", dir + wxString("/samples/exec"), wxStringList("exec.cpp", 0));
-    GenerateSample("GridVC", "test", dir + wxString("/samples/grid"), wxStringList("test.cpp", 0));
+    GenerateSample("EventVC", "event", dir + wxString("/samples/event"), wxStringList("event.cpp", 0));
+    GenerateSample("GridVC", "grid", dir + wxString("/samples/grid"), wxStringList("grid.cpp", 0));
     GenerateSample("NewGridVC", "griddemo", dir + wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0));
     GenerateSample("HelpVC", "demo", dir + wxString("/samples/help"), wxStringList("demo.cpp", 0));
 
     GenerateSample("NewGridVC", "griddemo", dir + wxString("/samples/newgrid"), wxStringList("griddemo.cpp", 0));
     GenerateSample("HelpVC", "demo", dir + wxString("/samples/help"), wxStringList("demo.cpp", 0));
 
+    // OpenGL samples
+    GenerateSample("CubeVC", "cube", dir + wxString("/samples/opengl/cube"), wxStringList("cube.cpp", "cube.h", 0),
+        "../../..", wxStringList("opengl32.lib", "glu32.lib", 0), wxStringList("opengl32.lib", "glu32.lib", 0));
+    GenerateSample("IsosurfVC", "isosurf", dir + wxString("/samples/opengl/isosurf"), wxStringList("isosurf.cpp", "isousrf.h", 0),
+        "../../..", wxStringList("opengl32.lib", "glu32.lib", 0), wxStringList("opengl32.lib", "glu32.lib", 0));
+    GenerateSample("PenguinVC", "penguin", dir + wxString("/samples/opengl/penguin"), wxStringList("penguin.cpp", "penguin.h",
+        "lw.cpp", "lw.h", "trackball.c", "trackball.h", 0),
+        "../../..", wxStringList("opengl32.lib", "glu32.lib", 0), wxStringList("opengl32.lib", "glu32.lib", 0));
+
     // wxHTML samples
     GenerateSample("AboutVC", "about", dir + wxString("/samples/html/about"), wxStringList("about.cpp", 0),
         "../../..");
     // wxHTML samples
     GenerateSample("AboutVC", "about", dir + wxString("/samples/html/about"), wxStringList("about.cpp", 0),
         "../../..");
@@ -251,42 +272,51 @@ void MyApp::GenerateSamples(const wxString& dir)
     GenerateSample("ListctrlVC", "listtest", dir + wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
     GenerateSample("MdiVC", "mdi", dir + wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
     GenerateSample("MemcheckVC", "memcheck", dir + wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
     GenerateSample("ListctrlVC", "listtest", dir + wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
     GenerateSample("MdiVC", "mdi", dir + wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
     GenerateSample("MemcheckVC", "memcheck", dir + wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
-    // Note: MFC sample will be different.
-    GenerateSample("MfcVC", "mfc", dir + wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
-    GenerateSample("MiniframVC", "test", dir + wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
+    // Don't always generate this project since it has to be tweaked by hand.
+    // GenerateSample("MfcVC", "mfctest", dir + wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
+    GenerateSample("MiniframVC", "minifram", dir + wxString("/samples/minifram"), wxStringList("minifram.cpp", "minifram.h", 0));
     GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
     GenerateSample("NativdlgVC", "nativdlg", dir + wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
     GenerateSample("DialupVC", "nettest", dir + wxString("/samples/dialup"), wxStringList("nettest.cpp", 0));
     GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
     GenerateSample("NativdlgVC", "nativdlg", dir + wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
     GenerateSample("DialupVC", "nettest", dir + wxString("/samples/dialup"), wxStringList("nettest.cpp", 0));
-    GenerateSample("NotebookVC", "test", dir + wxString("/samples/notebook"), wxStringList("test.cpp", "test.h", 0));
+    GenerateSample("NotebookVC", "notebook", dir + wxString("/samples/notebook"), wxStringList("notebook.cpp", "notebook.h", 0));
     GenerateSample("OleautoVC", "oleauto", dir + wxString("/samples/oleauto"), wxStringList("oleauto.cpp", 0));
     GenerateSample("OwnerdrwVC", "ownerdrw", dir + wxString("/samples/ownerdrw"), wxStringList("ownerdrw.cpp", 0));
     GenerateSample("PngVC", "pngdemo", dir + wxString("/samples/png"), wxStringList("pngdemo.cpp", "pngdemo.h", 0));
     GenerateSample("PrintingVC", "printing", dir + wxString("/samples/printing"), wxStringList("printing.cpp", "printing.h", 0));
     GenerateSample("OleautoVC", "oleauto", dir + wxString("/samples/oleauto"), wxStringList("oleauto.cpp", 0));
     GenerateSample("OwnerdrwVC", "ownerdrw", dir + wxString("/samples/ownerdrw"), wxStringList("ownerdrw.cpp", 0));
     GenerateSample("PngVC", "pngdemo", dir + wxString("/samples/png"), wxStringList("pngdemo.cpp", "pngdemo.h", 0));
     GenerateSample("PrintingVC", "printing", dir + wxString("/samples/printing"), wxStringList("printing.cpp", "printing.h", 0));
-    GenerateSample("ProplistVC", "test", dir + wxString("/samples/proplist"), wxStringList("test.cpp", "test.h", 0));
+    GenerateSample("ProplistVC", "proplist", dir + wxString("/samples/proplist"), wxStringList("proplist.cpp", "proplist.h", 0));
+    GenerateSample("PropsizeVC", "propsize", dir + wxString("/samples/propsize"), wxStringList("propsize.cpp", 0));
     GenerateSample("RegtestVC", "regtest", dir + wxString("/samples/regtest"), wxStringList("regtest.cpp", 0));
     GenerateSample("ResourceVC", "resource", dir + wxString("/samples/resource"), wxStringList("resource.cpp", "resource.h", 0));
     GenerateSample("RichEditVC", "wxLayout", dir + wxString("/samples/richedit"), wxStringList("wxLayout.cpp",
         "kbList.cpp", "wxllist.cpp", "wxlparser.cpp", "wxlwindow.cpp", 0));
     GenerateSample("SashtestVC", "sashtest", dir + wxString("/samples/sashtest"), wxStringList("sashtest.cpp", "sashtest.h", 0));
     GenerateSample("ScrollVC", "scroll", dir + wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
     GenerateSample("RegtestVC", "regtest", dir + wxString("/samples/regtest"), wxStringList("regtest.cpp", 0));
     GenerateSample("ResourceVC", "resource", dir + wxString("/samples/resource"), wxStringList("resource.cpp", "resource.h", 0));
     GenerateSample("RichEditVC", "wxLayout", dir + wxString("/samples/richedit"), wxStringList("wxLayout.cpp",
         "kbList.cpp", "wxllist.cpp", "wxlparser.cpp", "wxlwindow.cpp", 0));
     GenerateSample("SashtestVC", "sashtest", dir + wxString("/samples/sashtest"), wxStringList("sashtest.cpp", "sashtest.h", 0));
     GenerateSample("ScrollVC", "scroll", dir + wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
-    GenerateSample("SplitterVC", "test", dir + wxString("/samples/splitter"), wxStringList("test.cpp", 0));
-    GenerateSample("TabVC", "test", dir + wxString("/samples/tab"), wxStringList("test.cpp", "test.h", 0));
+    GenerateSample("ScrollsubVC", "scrollsub", dir + wxString("/samples/scrollsub"), wxStringList("scrollsub.cpp", 0));
+    GenerateSample("SplitterVC", "splitter", dir + wxString("/samples/splitter"), wxStringList("splitter.cpp", 0));
+    GenerateSample("StatbarVC", "statbar", dir + wxString("/samples/statbar"), wxStringList("statbar.cpp", 0));
+    GenerateSample("TabVC", "tab", dir + wxString("/samples/tab"), wxStringList("tab.cpp", "tab.h", 0));
     GenerateSample("TaskbarVC", "tbtest", dir + wxString("/samples/taskbar"), wxStringList("tbtest.cpp", "tbtest.h", 0));
     GenerateSample("TextVC", "text", dir + wxString("/samples/text"), wxStringList("text.cpp", 0));
     GenerateSample("TaskbarVC", "tbtest", dir + wxString("/samples/taskbar"), wxStringList("tbtest.cpp", "tbtest.h", 0));
     GenerateSample("TextVC", "text", dir + wxString("/samples/text"), wxStringList("text.cpp", 0));
-    GenerateSample("ThreadVC", "test", dir + wxString("/samples/thread"), wxStringList("test.cpp", 0));
-    GenerateSample("ToolbarVC", "test", dir + wxString("/samples/toolbar"), wxStringList("test.cpp", "test.h", 0));
-    GenerateSample("TreectrlVC", "treetest", dir + wxString("/samples/treectrl"), wxStringList("treetest.cpp", "treetest.h", 0));
+    GenerateSample("ThreadVC", "thread", dir + wxString("/samples/thread"), wxStringList("thread.cpp", 0));
+    GenerateSample("ToolbarVC", "toolbar", dir + wxString("/samples/toolbar"), wxStringList("toolbar.cpp", 0));
+    GenerateSample("TreectrlVC", "treectrl", dir + wxString("/samples/treectrl"), wxStringList("treectrl.cpp", "treectrl.h", 0));
     GenerateSample("TypetestVC", "typetest", dir + wxString("/samples/typetest"), wxStringList("typetest.cpp", "typetest.h", 0));
     GenerateSample("ValidateVC", "validate", dir + wxString("/samples/validate"), wxStringList("validate.cpp", "validate.h", 0));
     GenerateSample("TypetestVC", "typetest", dir + wxString("/samples/typetest"), wxStringList("typetest.cpp", "typetest.h", 0));
     GenerateSample("ValidateVC", "validate", dir + wxString("/samples/validate"), wxStringList("validate.cpp", "validate.h", 0));
-    GenerateSample("ClientVC", "client", dir + wxString("/samples/socket"), wxStringList("client.cpp", 0));
-    GenerateSample("ServerVC", "server", dir + wxString("/samples/socket"), wxStringList("server.cpp", 0));
-    GenerateSample("ClientVC", "client", dir + wxString("/samples/dde"), wxStringList("client.cpp", "client.h", "ddesetup.h", 0));
-    GenerateSample("ServerVC", "server", dir + wxString("/samples/dde"), wxStringList("server.cpp", "server.h", "ddesetup.h", 0));
+    GenerateSample("ClientVC", "client", dir + wxString("/samples/sockets"), wxStringList("client.cpp", 0));
+    GenerateSample("ServerVC", "server", dir + wxString("/samples/sockets"), wxStringList("server.cpp", 0));
+    GenerateSample("ClientVC", "client", dir + wxString("/samples/ipc"), wxStringList("client.cpp", "client.h", "ddesetup.h", 0));
+    GenerateSample("ServerVC", "server", dir + wxString("/samples/ipc"), wxStringList("server.cpp", "server.h", "ddesetup.h", 0));
     GenerateSample("CaretVC", "caret", dir + wxString("/samples/caret"), wxStringList("caret.cpp", 0));
     GenerateSample("DrawingVC", "drawing", dir + wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
     GenerateSample("ScrollVC", "scroll", dir + wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
     GenerateSample("CaretVC", "caret", dir + wxString("/samples/caret"), wxStringList("caret.cpp", 0));
     GenerateSample("DrawingVC", "drawing", dir + wxString("/samples/drawing"), wxStringList("drawing.cpp", 0));
     GenerateSample("ScrollVC", "scroll", dir + wxString("/samples/scroll"), wxStringList("scroll.cpp", 0));
-    GenerateSample("WizardVC", "wizard", dir + wxString("/samples/wizard"), wxStringList("wiztest.cpp", 0));
+    GenerateSample("WizardVC", "wizard", dir + wxString("/samples/wizard"), wxStringList("wizard.cpp", 0));
     GenerateSample("RotateVC", "rotate", dir + wxString("/samples/rotate"), wxStringList("rotate.cpp", 0));
     GenerateSample("RotateVC", "rotate", dir + wxString("/samples/rotate"), wxStringList("rotate.cpp", 0));
+    GenerateSample("ExecVC", "exec", dir + wxString("/samples/exec"), wxStringList("exec.cpp", 0));
+    GenerateSample("FontVC", "font", dir + wxString("/samples/font"), wxStringList("font.cpp", 0));
+    GenerateSample("MenuVC", "menu", dir + wxString("/samples/menu"), wxStringList("menu.cpp", 0));
+    GenerateSample("TreelayVC", "treelay", dir + wxString("/samples/treelay"), wxStringList("treelay.cpp", "treelay.h", 0));
+    GenerateSample("DragimagVC", "dragimag", dir + wxString("/samples/dragimag"), wxStringList("dragimag.cpp", "dragimag.h", 0));
+    GenerateSample("PlotVC", "plot", dir + wxString("/samples/plot"), wxStringList("plot.cpp", 0));
 
     //// Demos
 
 
     //// Demos
 
@@ -311,242 +341,81 @@ void MyApp::GenerateSamples(const wxString& dir)
         "dbbrowse.h", "browsedb.h", "dbgrid.h", "dbtree.h", "dlguser.h", "doc.h", "pgmctrl.h", "std.h", "tabpgwin.h",
         0));
 
         "dbbrowse.h", "browsedb.h", "dbgrid.h", "dbtree.h", "dlguser.h", "doc.h", "pgmctrl.h", "std.h", "tabpgwin.h",
         0));
 
+    //// Samples in contrib
+
+    // OGLEdit
+
+    GenerateSample("OGLEditVC", "ogledit", dir + wxString("/contrib/samples/ogl/ogledit"),
+        wxStringList("ogledit.cpp", "doc.cpp", "palette.cpp", "view.cpp",
+        "doc.h", "ogledit.h", "palette.h", "view.h", 0),
+        "../../../..",
+        wxStringList("ogld.lib", 0), wxStringList("ogl.lib", 0));
+
+    // OGL Studio
+
+    GenerateSample("StudioVC", "studio", dir + wxString("/contrib/samples/ogl/studio"),
+        wxStringList("studio.cpp", "cspalette.cpp", "dialogs.cpp", "view.cpp",
+        "doc.cpp", "mainfrm.cpp", "project.cpp", "shapes.cpp", "symbols.cpp", "csprint.cpp",
+        "studio.h", "cspalette.h", "dialogs.h", "view.h",
+        "doc.h", "mainfrm.h", "project.h", "shapes.h", "symbols.h", 0),
+        "../../../..",
+        wxStringList("ogld.lib", 0), wxStringList("ogl.lib", 0));
+
+    // MMedia mmboard
+
+    GenerateSample("MMboardVC", "mmboard", dir + wxString("/contrib/samples/mmedia"),
+        wxStringList("mmboard.cpp", "mmboard.h", "mmbman.cpp", "mmbman.h", 0),
+        "../../..",
+        wxStringList("mmediad.lib", 0), wxStringList("mmedia.lib", 0));
+
+    // STC (Scintilla widget)
+
+    GenerateSample("StcTestVC", "stctest", dir + wxString("/contrib/samples/stc"),
+        wxStringList("stctest.cpp", 0),
+        "../../..",
+        wxStringList("stcd.lib", 0), wxStringList("stc.lib", 0));
+
     //// Utilities
 
     // Dialog Editor
     //// Utilities
 
     // Dialog Editor
-    wxProject project;
-
-    project.SetIncludeDirs(wxStringList("../../../include", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
 
 
-    project.SetProjectName("DialogEdVC");
-    project.SetTargetName("dialoged");
-    project.SetProjectPath(dir + wxString("/utils/dialoged/src"));
-    project.SetSourceFiles(wxStringList("dialoged.cpp", "dlghndlr.cpp", "edlist.cpp", "edtree.cpp",
+    GenerateSample("DialogEdVC", "dialoged", dir + wxString("/utils/dialoged/src"),
+        wxStringList("dialoged.cpp", "dlghndlr.cpp", "edlist.cpp", "edtree.cpp",
         "reseditr.cpp", "reswrite.cpp", "symbtabl.cpp", "winstyle.cpp", "winprop.cpp",
         "dialoged.h", "dlghndlr.h", "edlist.h", "edtree.h", "reseditr.h", "symbtabl.h", "winprop.h",
         "reseditr.cpp", "reswrite.cpp", "symbtabl.cpp", "winstyle.cpp", "winprop.cpp",
         "dialoged.h", "dlghndlr.h", "edlist.h", "edtree.h", "reseditr.h", "symbtabl.h", "winprop.h",
-        "winstyle.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate Dialog Editor project");
-        wxMessageBox(msg);
-    }
+        "winstyle.h", 0),
+        "../../..");
 
     // Tex2RTF
 
     // Tex2RTF
-    project.SetIncludeDirs(wxStringList("../../../include", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
-
-    project.SetProjectName("Tex2RTFVC");
-    project.SetTargetName("tex2rtf");
-    project.SetProjectPath(dir + wxString("/utils/tex2rtf/src"));
-    project.SetSourceFiles(wxStringList("tex2rtf.cpp", "htmlutil.cpp", "readshg.cpp", "rtfutils.cpp",
+
+    GenerateSample("Tex2RTFVC", "tex2rtf", dir + wxString("/utils/tex2rtf/src"),
+        wxStringList("tex2rtf.cpp", "htmlutil.cpp", "readshg.cpp", "rtfutils.cpp",
         "table.cpp", "tex2any.cpp", "texutils.cpp", "xlputils.cpp",
         "bmputils.h", "readshg.h", "rtfutils.h", "table.h", "tex2any.h", "tex2rtf.h", "wxhlpblk.h",
         "table.cpp", "tex2any.cpp", "texutils.cpp", "xlputils.cpp",
         "bmputils.h", "readshg.h", "rtfutils.h", "table.h", "tex2any.h", "tex2rtf.h", "wxhlpblk.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate Tex2RTF project");
-        wxMessageBox(msg);
-    }
+        0),
+        "../../..");
 
     // HelpGen
 
     // HelpGen
-    project.SetIncludeDirs(wxStringList("../../../include", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
-
-    project.SetProjectName("HelpGenVC");
-    project.SetTargetName("helpgen");
-    project.SetProjectPath(dir + wxString("/utils/helpgen/src"));
-    project.SetSourceFiles(wxStringList("helpgen.cpp", "cjparser.cpp", "docripper.cpp", "ifcontext.cpp",
+
+    GenerateSample("HelpGenVC", "helpgen", dir + wxString("/utils/helpgen/src"),
+        wxStringList("helpgen.cpp", "cjparser.cpp", "docripper.cpp", "ifcontext.cpp",
         "markup.cpp", "ripper_main.cpp", "scriptbinder.cpp", "sourcepainter.cpp",
         "srcparser.cpp",
         "cjparser.h", "docripper.h", "ifcontext.h", "markup.h", "scriptbinder.h", "sourcepainter.h",
         "markup.cpp", "ripper_main.cpp", "scriptbinder.cpp", "sourcepainter.cpp",
         "srcparser.cpp",
         "cjparser.h", "docripper.h", "ifcontext.h", "markup.h", "scriptbinder.h", "sourcepainter.h",
-        "srcparser.h", "wxstlac.h", "wxstllst.h", "wxstlvec.h", 0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate HelpGen project");
-        wxMessageBox(msg);
-    }
+        "srcparser.h", "wxstlac.h", "wxstllst.h", "wxstlvec.h", 0),
+        "../../..");
 
     // ProjGen
 
     // ProjGen
-    project.SetIncludeDirs(wxStringList("../../include", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../include", 0));
-    project.SetLibDirs(wxStringList("../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../src/tiff/Release", 0));
-
-    project.SetProjectName("ProjGenVC");
-    project.SetTargetName("makeproj");
-    project.SetProjectPath(dir + wxString("/utils/projgen"));
-    project.SetSourceFiles(wxStringList("makeproj.cpp", "makeproj.h", 0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate ProjGen project");
-        wxMessageBox(msg);
-    }
+    GenerateSample("ProjGenVC", "makeproj", dir + wxString("/utils/projgen"),
+        wxStringList("makeproj.cpp", "makeproj.h", 0),
+        "../..");
 
     // hhp2cached
 
     // hhp2cached
-    project.SetIncludeDirs(wxStringList("../../include", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../include", 0));
-    project.SetLibDirs(wxStringList("../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../src/Debug", "../../src/jpeg/Debug", "../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../src/Release", "../../src/jpeg/Release", "../../src/tiff/Release", 0));
 
 
-    project.SetProjectName("hhp2cachedVC");
-    project.SetTargetName("hhp2cached");
-    project.SetProjectPath(dir + wxString("/utils/hhp2cached"));
-    project.SetSourceFiles(wxStringList("hhp2cached.cpp", 0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate hhp2cached project");
-        wxMessageBox(msg);
-    }
+    GenerateSample("hhp2cachedVC", "hhp2cached", dir + wxString("/utils/hhp2cached"),
+        wxStringList("hhp2cached.cpp", 0),
+        "../..");
 
 
-    // wxTreeLayout sample
-
-    project.SetIncludeDirs(wxStringList("../../../include", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../src/Debug", "../../../src/jpeg/Debug", "../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../src/Release", "../../../src/jpeg/Release", "../../../src/tiff/Release", 0));
-
-    project.SetProjectName("TreeSampleVC");
-    project.SetTargetName("test");
-    project.SetProjectPath(dir + wxString("/utils/wxtree/src"));
-    project.SetSourceFiles(wxStringList("test.cpp", "wxtree.cpp", "test.h", "wxtree.h", 0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate wxTreeLayout project");
-        wxMessageBox(msg);
-    }
-
-    // OGLEdit
-
-    project.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
-
-    project.SetExtraLibs(wxStringList("ogl.lib", 0));
-
-    project.SetProjectName("OGLEditVC");
-    project.SetTargetName("ogledit");
-    project.SetProjectPath(dir + wxString("/utils/ogl/samples/ogledit"));
-    project.SetSourceFiles(wxStringList("ogledit.cpp", "doc.cpp", "palette.cpp", "view.cpp",
-        "doc.h", "ogledit.h", "palette.h", "view.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate OGLEdit project");
-        wxMessageBox(msg);
-    }
-
-    // OGL Studio
-
-    project.SetIncludeDirs(wxStringList("../../../../include", "../../src", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../src/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../src/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
-    project.SetExtraLibs(wxStringList("ogl.lib", 0));
-
-    project.SetProjectName("StudioVC");
-    project.SetTargetName("studio");
-    project.SetProjectPath(dir + wxString("/utils/ogl/samples/studio"));
-    project.SetSourceFiles(wxStringList("studio.cpp", "cspalette.cpp", "dialogs.cpp", "view.cpp",
-        "doc.cpp", "mainfrm.cpp", "project.cpp", "shapes.cpp", "symbols.cpp", "csprint.cpp",
-        "studio.h", "cspalette.h", "dialogs.h", "view.h",
-        "doc.h", "mainfrm.h", "project.h", "shapes.h", "symbols.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate OGL Studio project");
-        wxMessageBox(msg);
-    }
-
-    // GLCanvas cube sample
-
-    project.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
-
-    project.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
-
-    project.SetProjectName("CubeVC");
-    project.SetTargetName("cube");
-    project.SetProjectPath(dir + wxString("/utils/glcanvas/samples/cube"));
-    project.SetSourceFiles(wxStringList("cube.cpp", "cube.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate GLCanvas Cube project");
-        wxMessageBox(msg);
-    }
-
-    // GLCanvas isosurf sample
-
-    project.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
-    project.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
-
-    project.SetProjectName("IsoSurfVC");
-    project.SetTargetName("isosurf");
-    project.SetProjectPath(dir + wxString("/utils/glcanvas/samples/isosurf"));
-    project.SetSourceFiles(wxStringList("isosurf.cpp", "isosurf.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate GLCanvas IsoSurf project");
-        wxMessageBox(msg);
-    }
-
-    // GLCanvas penguin sample
-
-    project.SetIncludeDirs(wxStringList("../../../../include", "../../win", 0));
-    project.SetResourceIncludeDirs(wxStringList("../../../../include", 0));
-    project.SetLibDirs(wxStringList("../../../../lib", 0));
-    project.SetDebugLibDirs(wxStringList("../../../../src/Debug", "../../win/Debug", "../../../../src/jpeg/Debug", "../../../../src/tiff/Debug", 0));
-    project.SetReleaseLibDirs(wxStringList("../../../../src/Release", "../../win/Release", "../../../../src/jpeg/Release", "../../../../src/tiff/Release", 0));
-    project.SetExtraLibs(wxStringList("glcanvas.lib", "opengl32.lib", "glu32.lib", 0));
-
-    project.SetProjectName("PenguinVC");
-    project.SetTargetName("penguin");
-    project.SetProjectPath(dir + wxString("/utils/glcanvas/samples/penguin"));
-    project.SetSourceFiles(wxStringList("penguin.cpp", "penguin.h",
-        "lw.cpp", "lw.h",
-        "trackball.c", "trackball.h",
-        0));
-
-    if (!project.GenerateVCProject())
-    {
-        wxString msg("Could not generate GLCanvas Penguin project");
-        wxMessageBox(msg);
-    }
 }
 
 // ----------------------------------------------------------------------------
 }
 
 // ----------------------------------------------------------------------------
@@ -697,12 +566,12 @@ bool wxProject::GenerateVCProject()
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
-    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /machine:I386\n";
-    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib jpeg.lib tiff.lib ";
-    n = m_extraLibs.Number();
+    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386\n";
+    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib ";
+    n = m_extraLibsRelease.Number();
     for (i = 0; i < n; i++)
     {
     for (i = 0; i < n; i++)
     {
-        wxString lib = m_extraLibs[i];
+        wxString lib = m_extraLibsRelease[i];
         stream << lib << " ";
     }
 
         stream << lib << " ";
     }
 
@@ -757,12 +626,12 @@ bool wxProject::GenerateVCProject()
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
-    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
-    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib jpeg.lib tiff.lib ";
-    n = m_extraLibs.Number();
+    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
+    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib ";
+    n = m_extraLibsDebug.Number();
     for (i = 0; i < n; i++)
     {
     for (i = 0; i < n; i++)
     {
-        wxString lib = m_extraLibs[i];
+        wxString lib = m_extraLibsDebug[i];
         stream << lib << " ";
     }
     stream << "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib,libcid.lib,msvcrt.lib\" /out:\"Debug/" << m_targetName << ".exe\" /pdbtype:sept";
         stream << lib << " ";
     }
     stream << "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib,libcid.lib,msvcrt.lib\" /out:\"Debug/" << m_targetName << ".exe\" /pdbtype:sept";
@@ -818,12 +687,12 @@ bool wxProject::GenerateVCProject()
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
-    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
-    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib ";
-    n = m_extraLibs.Number();
+    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\n";
+    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxdlld.lib ";
+    n = m_extraLibsDebug.Number();
     for (i = 0; i < n; i++)
     {
     for (i = 0; i < n; i++)
     {
-        wxString lib = m_extraLibs[i];
+        wxString lib = m_extraLibsDebug[i];
         stream << lib << " ";
     }
     stream << "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib\" /nodefaultlib:\"libcid.lib\" /out:\"DebugDLL/" << m_targetName << ".exe\" /pdbtype:sept";
         stream << lib << " ";
     }
     stream << "/nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:\"libcd.lib\" /nodefaultlib:\"libcid.lib\" /out:\"DebugDLL/" << m_targetName << ".exe\" /pdbtype:sept";
@@ -881,12 +750,12 @@ bool wxProject::GenerateVCProject()
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
     stream << "# ADD BASE BSC32 /nologo\n";
     stream << "# ADD BSC32 /nologo\n";
     stream << "LINK32=link.exe\n";
-    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /machine:I386\n";
-    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib wxvc.lib ";
-    n = m_extraLibs.Number();
+    stream << "# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386\n";
+    stream << "# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxdll.lib ";
+    n = m_extraLibsRelease.Number();
     for (i = 0; i < n; i++)
     {
     for (i = 0; i < n; i++)
     {
-        wxString lib = m_extraLibs[i];
+        wxString lib = m_extraLibsRelease[i];
         stream << lib << " ";
     }
     stream << "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"ReleaseDLL/" << m_targetName << ".exe\"";
         stream << lib << " ";
     }
     stream << "/nologo /subsystem:windows /machine:I386 /nodefaultlib:\"libc.lib\" /nodefaultlib:\"libci.lib\" /out:\"ReleaseDLL/" << m_targetName << ".exe\"";
@@ -1026,7 +895,7 @@ MyDialog::MyDialog(const wxString& title, const wxPoint& pos, const wxSize& size
 
 void MyDialog::OnQuit(wxCommandEvent& event)
 {
 
 void MyDialog::OnQuit(wxCommandEvent& event)
 {
-    this->Destroy();
+    this->EndModal(wxID_OK);
 }
 
 void MyDialog::OnAbout(wxCommandEvent& event)
 }
 
 void MyDialog::OnAbout(wxCommandEvent& event)