Conversion Problem

Hi, I am new to these forums and it seems like the last place I can turn. I have a DirectX 9/C++ Book that requires Visual Studio .NET 2003. But, I do not want to purchase it at this time.

I want to try to convert it to Visual C++ 2005, but I do not see anyway to convert it. Is there any built - in way of converting VC++ 2003 to VC++ 2005 If so, how, because I am a little upset.




Answer this question

Conversion Problem

  • VonSch

    Well, the author of the book probably used the version of Visual Studio that was current at the time.

    It is hard to know, without knowing the book, how much it actually depends on VS .NET 2003 and how much will be easily-adaptable to VS 2005.  Your question is very general.

    Also, if you purchase VS 2005, I believe you can import VS.NET 2003 projects.  But either way, you'd need to purchase a Visual Studio edition, and the book was written on the assumption that you'd done that, so what exactly are you upset about   (There was no free version of VC++ .NET 2003, although you can get a free copy of the Microsoft C/C++ compiler without the IDE.  I assume that is not going to solve your problem.)

    You might be able to adapt the applications in Visual C++ 2005 Express Edition.  That is very situation specific.  I don't know how to advise you about that.  It depends on your experience level with C/C++ and the Visual Studio Integrated Development Environment as well as whatever the book relies on. 

    For example, if the book uses Microsoft Foundation Classes, there is no Express Edition support about that.

    The book probably requires the Platform SDK and any additional libraries that might be needed for DirectX development.  You'll need to be comfortable installing those and learning to use them successfully from VC++ 2005 Express Edition.  This can give beginners a lot of trouble.  You need to know about nmake and similar utilities.  If you have the libraries you need, you can probably adapt the book's projects to EE.  I haven't found any good starter tips on doing that, but you might be able to find something.

    What is the book   Does it have a web site and sample code for download   Also, what does it presume that you would already know   Does the code actually use .NET (the Common Language Runtime) or is it pure C/C++ and native Windows libraries   All of these factors matter.

     



  • Patrick Flynn

    Thanks Orcmid for the response. Here is some example code that they give you for the very first program in the book.

    #include <windows.h>

    HINSTANCE hInst; //Global Handle to Hold All the App Instance

    HWND wndHandle; //Global Variable to Hold All The Window Handle

    //forward declarations

    bool initWindow( HINSTANCE hInstance );

    LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );

    //This is winmain, the main entry point for the application

    int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,

    LPTSTR lpCmdLine, int nCmdShow )

    {

    //Initialize the Window

    if ( !initWindow ( hInstance ) )

    return false;

    //Main Message Loop

    MSG msg;

    ZeroMemory( &msg, sizeof( msg ) );

    while( msg.message!=WM_QUIT )

    {

    TranslateMessage( &msg );

    DispatchMessage( &msg );

    }

    }

    return (int) msg.wParam;

    }

    bool initWindow( HINSTANCE hInstance )

    {

    WNDCLASSEX wcex;

    //Fill in the WNDCLASSEX structure. This describes how the window

    //Will Look to the system

    wcex.cbsize = sizeof(WNDCLASSEX); //The Size of the Structure

    wcex.style = CS_HREDRAW | CS_VREDRAW; //The Class Style

    wcex.lpfnWndProc = (WNDPROC)WndProc; //The Windows Procedure Callback

    wcex.cbClsExtra = 0; //extra bytes to allocate for this class

    wcex.cbWndExtra = 0; //extra bytes to allocate for this instance

    wcex.hInstance = hInstance; //Handle the application instance

    wcex.hIcon = 0; //The Icon to Associate with the application

    wcex.hCursor = LoadCursor(NULL, IDC_ARROW);//The Default Cursor

    wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); //The Background Color

    wcex.lpszMenuName = NULL; //The Resource Name for the Menu

    wcex.lpszClassName = "DirectXExample"; //The Class Name being created

    wcex.hIconSm = 0; //The Handle to a small icon

    RegisterClassEx(&wcex);

    //Create the window

    wndHandle = CreateWindow(

    "DirectXExample", //The windows class to use

    "DirectXExample", //The title bar text

    WS_OVERLAPPEDWINDOW, //The window style

    CW_USEDEFAULT, //The Starting x coordinate

    CW_USEDEFAULT, //The Starting y coordinate

    640, //Pixel Width of the window

    480, //Pixel Height of the window

    NULL, //The Parent Window, NULL for Desktop

    NULL, //The Menu for the Application, NULL for none

    hInstance, //The Handle to the Application Instance

    NULL); //No Values passed to the window

    //Make sure that the window handle that is created is valid

    if (!wndHandle)

    return false;

    //Display the window on the screen

    ShowWindow(wndHandle, SW_SHOW);

    UpdateWindow(wndHandle);

    return true

    }

    LRESULT CALLBACK WndProc(HWND hWnd, UNIT message, WPARAM wParam)

    {

    //Check any available messages from the queue

    switch (message)

    {

    case WM_DESTROY:

    PostQuitMessage(0);

    break;

    }

    //Always Return the message to the default window

    //procedure for further processing

    return DefWindowProc(hWnd, message, wParam, lParam);

    }

    Just for displaying a window is the tutorial.



  • Bineon

    I took my time to compose a careful response to what you provided and it was dumped after I was forced through log-in when I hit post. Now I'm the unhappy one. I need to find a better way than trusting a web form for material that I can't knock off in a minute or two.

    Now I need to go cool off and get back into my day. Sorry.

    Here's a hasty version:

    1. The initial program is a standard Windows Application written against the Windows API.

    2. You can do that with VC++ 2005 Express Edition after you download and integrate the Windows SDK. There are additional instructions for properly installing the SDK properly with the Express Edition.

    3. There's more and I'm out of time. (Grumble, grumble.) I'll see if I can pick this up again later.



  • am05

    Ok, Thanks Orcmid, any help you can give me whenever that is OK. I will see how I can install that SDK

  • Conversion Problem