cover

FAQ (installation, compiling, MFC, etc)

Essentials of Interactive Computer Graphics: Concepts and Implementation

 

 


 

If you are question is regarding to:

 

 


 

Run time Libraries:

 

Question: What are the libraries I need to work with the tutorials?

Answer:  This is a compound question, with many-part answers. In short, it all depends on which version of the APIs you want to work with. In general, if you are only interested in running the tutorials, you should run the C++/D3D/MFC version of the tutorials and please refer to here for instructions of runtime library installation. If you want to work with the source code, develop/compile the provided tutorials, you will need to have Microsoft Visual Studio 2005 installed on your machine. In addition, since the concepts presented in the book are implemented in three sets of APIs, you will need to install separate Graphics APIs:

 

Question: Which version of Direct3D should I install and how/where do I go to download?

Answer:  Most of the DX9 releases will work:

  • Click here for general information on DirectX.
  • For example, any of these release will do:
    • August 2007 DX SDK – Click here to download the SDK.
    • June 2007 DX SDK – Click here to check out the download site.
    • August 2006 DX SDK – Click here to check out the download site.

 

Question: Where do I go to download the XNA framework and the SDK?

 

Answer:  Please refer to instructions here for more detail. Please refer to XNA Creator’s club for more details.

 

Run time problems:

 

Question: When I double click on the provided Tutorials, I get an error message complaining about

This application has failed to start because the application configuration is incorrect Reinstalling the application may fix this problem”.

Answer:  You do not have VS2005 installed on your machine. All tutorials from this book are developed based on Microsoft Visual Studio 2005, if you do not have access to this program you will not be able to compile the tutorials in the book. However, it is still possible for you to run the compiled tutorials. You will need to install two run-time libraries (both free of charge):

After you have downloaded and installed the above two “redistributable” libraries all compiled tutorials off the book websites should run.

 

Question: I have a fancy graphics card why does my Direct3D program runs so slowly?

 

Answer:  You are probably running the debug version of Direct3D. Do this

  • Go to your Control Panel
  • Find the DirectX property page
  • Go to the Direct3D tab
  • Under Debug/Retail D3D runtime -- select Use Retail Version of Direct3D

 

 

Visual Studio Specific Questions:

Question: I tried running the example exe that was posted for MP1. However, when I try to run it on two of my computers, I get the following error: "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem". Is it trying to link to something that my computers don't have? Does anyone have the same issue, ideas?

Answer: You probably have an earlier version of Visual Studio. You need Visual Studio 2005 with the Service Pack-1 (SP1).

 

 

MFC Specific Questions:

Question: Cannot change control variable category in the MFC wizard.

Answer:  Send me an email with your project, I have not been able to reproduce this problem.

Question: I am working with more than one sets of MFC Radio buttons, the operations of the two sets of buttons seem to interfere.

Answer: You have to make sure the two sets of radio buttons belong to two separate groups. Here is how:

  • Sequence: of the radio buttons: for each radio button group, make sure the buttons are in sequence.
    1. Tabbing order of control elements: when in MFC resource editor type ctrl-D to toggle the tabbing order of GUI elements. This is the ordering, or when you type <tab> to advance to the next GUI element, you will observe focus changing in this order.
    2. Changing the sequencing: with the <tab> sequencing order visible, you can change the ordering by clicking on the numbers.
    3. MAKE SURE radio buttons in a group have tabbing numbers in sequence.
    4. Remember the first radio button (with smaller number) of each group. You want to make sure only the first radio button of each group has the group-property set to true.
  • Grouping: type another ctrl-D to switch off the tabbing sequence.  For each group of radio buttons, right-mouse-button click on the first radio button and bring up the property sheet. Look for the “Group” property and make sure it is set to true. Now make sure all “non-first radio buttons” have their “Group” property set to false. Now you can type ctrl-T to try out your radio buttons. It should work now.
  • Initialization: don’t forget to initialize your radio buttons by calling CheckRadioButton() for each radio-button-group in OnInitDialog().

 

Question: How can call the GetCheckRadioButton(Symbol_A, Symbol_B) function to determine which radio button is clicked.


Answer:
you should:

  1. Look at Resource.h (edit this file)
  2. Look for "symbol_A" and "symbol_B" in the Resource.h file
  3. Look at the numbers that these symbols are defined: Make sure
    1. symbol_A and symbol_B corresponds to the first and last of your radio
    2. make sure all radio buttons in the group have _CONSECUTIVE_ numbers (you can hand-edit this, just make sure you use unique numbers)

For example:  I have radio button, b1, b2, b3, b4 on my GUI, and  in resource.h I have ...

#define IDC_B1   1012

#define IDC_B2   1110

#define IDC_B3   1013

#define IDC_B4   1000

Notice IDC_B1 does not have the smallest number, and notice the numbers are not in any consecutive ordering, so I would type modify the above to make sure:

  1. b1 has the smallest number in the group
  2. b1,b2,b3,b4 are consecutive numbers
  3. all numbers are unique, for example, I may do the following editing:

#define IDC_B1  9000

#define IDC_B2  9001

#define IDC_B3  9002

#define IDC_B4  9003

Now when I call: GetCheckedRadiuButton(IDC_B1, IDC_B4), I will be ok. (The above ctrl-D, should do the trick, but sometimes it may fail, and you have to do all these by hand).

 

 

Question: I know the Quit button will cause my application to exit, but, in general, how can I quit my application?

Answer:  Send oneself the “WM_CLOSE” message will cause a window to close. For example, to close a dialog window in that window you can call:

  • SendMessage(WM_CLOSE)

 

 

Compile-time/Compiler problems:

 

Question: I have downloaded and installed Direct3D SDK, however, when compiling the tutorial projects, I get tons of errors complaining about undefined Direct3D include files and symbols.

 

Answer:  You need to tell the IDE about the Direct3D SDK. Here is how: in Visual Studio ...

  • Tools ->Options
  • Under the Project folder
  • VC++ Directories
  • “Show directories for”: Include files
    • add in “C:\DX_PATH\include or wherever you have installed you DXSDK. Make sure this path comes before any of the existing paths.
  • Show directories for- Library files
    • add in “C:\DX_PATH\Lib\x86 or wherever you have installed you DXSDK. Once again, make sure this path comes before any of the existing paths.

DX_PATH – depending on your DX version and your exact installation, this path is usually under:

    • C:\Program Files\Microsoft DirectX _SOME_VERSION_NUM\

 

 

Question: When I compile I get this strange compiler error complaining about:

 

“UWBMFC_SliderCotrlWithEcho” type redefinition”.

Answer:  Sometimes MFC resource editor will automatically add in “#include uwbgl_mfcsliderctrlwithecho1.h“ input your source files (.cpp/..h). Open your GUI source files and check you are not “including” the SliderCtrlWithEcho.h file more than once.

 

Linker problems:

 

Question: I am calling ReplaceDialogControl() function (defined in MFC_Library1), when linking I got this error:

 

Error 1  error LNK2019: unresolved external symbol "bool __cdecl ReplaceDialogControl(class CDialog &,unsigned int,class CDialog &,unsigned int)" (?ReplaceDialogControl@@YA_NAAVCDialog@@ I0I@Z) referencedin function "protected: virtual int __thiscall CMP1Dlg::OnInitDialog(void)" (?OnInitDialog@CMP1Dlg@@MAEHXZ)    MP1Dlg.obj 

 

Answer:  You need to tell the linker to refer to the MFC library file. Refer to William Frankhouser’s tutorial 7 for how to do this. Here is the link: Tutorial 7 of Chapter 2.

 

 

Question: When I try to link with the MFC library, I got tons of errors!


Answer:  You are probably mixing DLL with static MFC compilation flags.

 

  1. MFC with DLL: The MFC library (and ALL of our tutorials) are build to run with DLLs
  2. Your code: must also be compiled with the MFC DLL option, here is how:
    1. Set your “Configuration”  to “Debug
    2. In the solution view, RMB to call up the property sheet of your project
    3. Under General: Use of MFC: make sure you select “Use of MFC in a Shared DLL
    4. Open up the “C++” tab, under “Code Generation
    5. Runtime Library”: make sure you select “Multi-threaded Debug DLL
    6. Now set your “Configuration” to “Release” and repeat the above steps.

 

 

 


nsf4c.gif

This material is based upon work supported by the National Science Foundation under Grant No. 0442420. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Nation Science Foundation.

mslogo-2.jpg

The refinement of this course material is supported by a grant from Microsoft Research under the Computer Gaming Curriculum in Computer Science RFP, Award Number 15871.


Kelvin Sung  |   Kelvin Research Page  |   CSS Home  |   UW Bothell  |   UW Seattle


purple_badge
18115 Campus Way NE
Bothell, WA 98011-8246

(425) 352-5000
(425) 352-5303 (TDD)

*

University of Washington, Bothell
Copyright ©2008, UWB. All rights reserved.
Comments to Kelvin Sung: ksung@u.washington.edu
Information about UWB: uwbothel@u.washington.edu
Last updated: Jun 2008 KS