Copy Link
Add to Bookmark
Report
creating project file for Visual C++
you can start from an empty project file as follows.
- create an empty project file.
- select the menu "File/New...", select "Win32 Application" in "Projects" tab and type the name as you wish. select the location where you want your project file to be created in "Location" field. (refer to "project structure recommended by Gamepark") as default, Visual Studio create a subfolder under the folder you select as location. be careful. if all completed, press "OK" button.
- select "An empty project" in "Step 1 of 1" and click "Finish" button. you may see the summary about project file generation.
- adding file(s)
- first, you should create a resource file as follows.
- select the menu "File/New...", select "Resource Script"m type file name and click "OK" button.
- select the menu "Insert/Resource", select "Import...", select three files "gpskin.bmp", "gpicond.ico" and "gpiconr.ico"(included in GP32 SDK) and press "Import" button. (it may show a message about not being able to display non-8bit image file. but you can ignore this.) set the ID for Bitmape to "IDB_BITMAP1", ID for 8bit icon to "IDI_MAIN_ICON", Condition for 8bit icon to "_DEBUG", id for 24bit icon to "IDI_MAIN_ICON", and Condition for 24bit icon to "NDEBUG". (you can set the properties for icons by clicking right mouse button in "Resource" tab and selecting "Properties" menu.)
- now you should modify resource.h as follows. open resource.h and change the value of IDI_MAIN_ICON to 102 and value of IDB_BITMAP1 to 109.
- add your own gpmain.c file by selecting the menu "Project/Add To Project/Files...".
- configuration for each Target
- Debug Target
- select "Use MFC in a Shared DLL" as "General/Microsoft Foundation Classes"
- add path "work/lib/win32/gpwin/include" (in relative format. e.g, ../../../lib/win32/gpwin/include) to "C/C++/Preprocessor/Additional include directories"
- add "winmm.lib gpwind.lib" in "Object/library modules" field in "Link/Input", "work/lib/gpwin/gpwinlib/debug" in "Additional library path" field. (also in relative format)
- Release Target
- select "Use MFC in a Shared DLL" as "General/Microsoft Foundation Classes"
- add path "work/lib/win32/gpwin/include" (in relative format. e.g, ../../../lib/win32/gpwin/include) to "C/C++/Preprocessor/Additional include directories"
- add "winmm.lib gpwinr.lib" in "Object/library modules" field in "Link/Input", "work/lib/gpwin/gpwinlib/release" in "Additional library path" field (also in relative format))
- time to build.
you can make your own project more easily by modifying template project file provided by us in following steps. (let me call the name of your project test.)
- copy following file from work/project/template/win32 to the location where you want to make project file.
- template.dsw : Visual C++ Workspace file
- template.dsp : Visual C++ Project file
- template.rc : Visual C++ Resource file
- resource.h : resource header file
- resources/gpskin.bmp : Skin image file
- resources/gpicond.ico : icon file for Debug target
- resources/gpiconr.ico : icon file for Release target Visual C++ doesn't allow debugging if the application icon is not made in 8bit color. we think it's a kind of bug. anyway, to debug, we provide one more icon file made in 8bit color. of course, you can use your own icon file.
- modify the names of template.dsw, template.dsp and template.rc to test.dsw, test.dsp and test.rc respectively.
- modify the contents of test.dsw and test.dsp using any text editor. just replace all the string template with test(project name).
- add your own gpmain.h and gpmain.c to the project. * more...
- include path ("Additional include directories" field of "Preprocessor" Category in "C/C++" tab)
- library file path ("Additional library path" field of "Input" Category in "Link" tab)
set the following values to the proper values for your project.