Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Join Date
    Dec 2005
    Posts
    97
    I happened to just do this, but I don't 100% understand everything I did. I also partially followed some other tutorial, but I can't find the link (so can't give credit).

    So start with opening the wxWidgets project file and compiling (I assume you got that part done...if not, I can go over it). I did this by setting OpenGL to be added (I forget how and need to hurry to get this done). I assume your output directory will be C:\wxWidgets-2.8.8.

    Start VS 2008, and start a new, empty, console project. Now, I don't understand this next part...but it works for me. Create a file and save it somewhere. I called this file "wx.vsprops". In this file (use a text editor, or whatever) put the following:

    <?xml version="1.0" encoding="Windows-1252"?>
    <VisualStudioPropertySheet
    ProjectType="Visual C++"
    Version="8.00"
    Name="wx"
    >
    <Tool
    Name="VCCLCompilerTool"
    AdditionalIncludeDirectories="&quot;$(wxwidgets)\i nclude\msvc&quot;;&quot;$(wxwidgets)\include&quot; "
    />
    <Tool
    Name="VCLinkerTool"
    AdditionalDependencies="comctl32.lib rpcrt4.lib winmm.lib wsock32.lib"
    AdditionalLibraryDirectories="&quot;$(wxwidgets)\l ib\vc_lib&quot;"
    />
    <Tool
    Name="VCResourceCompilerTool"
    AdditionalIncludeDirectories="$(wxwidgets)\include "
    />
    <UserMacro
    Name="wxwidgets"
    Value="C:\wxWidgets-2.8.8"
    PerformEnvironmentSet="true"
    />
    </VisualStudioPropertySheet>

    Now, in your project, goto the property manager (you might have to go to View: Property Manager). Right click on your project, and go to "Add Existing Property Shet...". Find that file you saved, and apply it.

    Now, unless you compiled wxWidgets as unicode, you need to turn that off in your VS2008 file. Right click on your project (in my case called test). Go to the character set on the general tab, and set it to "Not Set".

    Now, go to Linker: System, and change the SubSystem to "Windows (/SUBSYSTEM:WINDOWS).

    That's it for me. That let me at least compile a temp app, and the wx example where you rotate a cube from 3dbuzz (from the Open GL VTM).

  2. #12
    Join Date
    Mar 2008
    Posts
    24
    So start with opening the wxWidgets project file and compiling (I assume you got that part done...if not, I can go over it).
    Thanks BlueHyrax.

    That's my biggest issue at the moment. I haven't been able to get it to compile properly to begin with. I keep getting the same error as in my last post.

    "\msw\dlmsw.cpp(316) : error C2664: 'BOOL (HANDLE,PENUMLOADED_MODULES_CALLBACK,PVOID)' : cannot convert parameter 2 from 'overloaded-function' to 'PENUMLOADED_MODULES_CALLBACK'
    1> None of the functions with this name in scope match the target type"


    If I could just get past that then maybe I could continue with my VTM.

    Oh, I decided to use wxWidgets 2.6.4 wrather than 2.8.8. The 2.6.4 file structure looks more like the VTM, and makes it easier to follow.

    Thanks again.

  3. #13
    Join Date
    Mar 2008
    Posts
    394
    Quote Originally Posted by Brusher View Post
    Oh, I decided to use wxWidgets 2.6.4 wrather than 2.8.8. The 2.6.4 file structure looks more like the VTM, and makes it easier to follow.

    Thanks again.
    Might be best! I use 2.6.4, as it's the closest to the VTMs and for now that's the best I can do. Lemme know if there are any issues with that version too! *hopes there isn't*

  4. #14
    Join Date
    Dec 2005
    Posts
    97
    Hey, I just looked and you did succeed in compiling wxWidgets.

    "I found a file in C:\Program Files\wxWidgets-2.8.8\build\msw\ "wx_dll
    Type: VC++6 Workspace"

    I used that and it seemed to build fine."

    That is exactly what I did. I don't remember the VTM, so maybe they set some options in the setup.h file (like you do have to turn OpenGL on, if you ever want to do anything with it), but that should let you create a "Hello World" app, and like I said...I did the first wxWidgets app from the OpenGL VTMs with it (so it shouldn't be a huge problem).

    That all worked for me. I know a few of the installation things look very different from what they do in the VTMs, but for the most part I think if you can compile and run a Hello World app that uses WxWidgets, you will be fine for the VTMs (as in the differences should go away once you can compile). I'm pretty sure if you use the above method to install, and do the thing I mentioned earlier, you will be set. You also should be able to compile both version of wxWidgets without too much worry.

    Maybe try doing that, and then creating a project like I suggested and trying to compile this (a hello World app I found on the web that is very simple...keeping comment with author's name in it). Just create a new .cpp file, and paste this in. Then hit F5 and a window should pop up:

    /*
    * hworld.cpp
    * Hello world sample by Robert Roebling
    */

    #include "wx/wx.h"

    class MyApp: public wxApp
    {
    virtual bool OnInit();
    };

    class MyFrame: public wxFrame
    {
    public:

    MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);

    void OnQuit(wxCommandEvent& event);
    void OnAbout(wxCommandEvent& event);

    DECLARE_EVENT_TABLE()
    };

    enum
    {
    ID_Quit = 1,
    ID_About,
    };

    BEGIN_EVENT_TABLE(MyFrame, wxFrame)
    EVT_MENU(ID_Quit, MyFrame::OnQuit)
    EVT_MENU(ID_About, MyFrame::OnAbout)
    END_EVENT_TABLE()

    IMPLEMENT_APP(MyApp)

    bool MyApp::OnInit()
    {
    MyFrame *frame = new MyFrame( _T("Hello World"), wxPoint(50,50), wxSize(450,340) );
    frame->Show(TRUE);
    SetTopWindow(frame);
    return TRUE;
    }

    MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
    : wxFrame((wxFrame *)NULL, -1, title, pos, size)
    {
    wxMenu *menuFile = new wxMenu;

    menuFile->Append( ID_About, _T("&About...") );
    menuFile->AppendSeparator();
    menuFile->Append( ID_Quit, _T("E&xit") );

    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append( menuFile, _T("&File") );

    SetMenuBar( menuBar );

    CreateStatusBar();
    SetStatusText( _T("Welcome to wxWindows!") );
    }

    void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
    {
    Close(TRUE);
    }

    void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
    {
    wxMessageBox(_T("This is a wxWindows Hello world sample"),
    _T("About Hello World"), wxOK | wxICON_INFORMATION, this);
    }

  5. #15
    Join Date
    Mar 2008
    Posts
    24
    Thanks so much Khalhern. I'll let you know.

    BlueHyrax, thank you too.

    I think I'll go ahead and try that. You're right, I did get the ver 2.8.8, wx_dll one working. I just wanted my setup to look just like the VTM so I wouldn't have any possible issues with it now, or in the future.

    Anyway, it appears that that's the only option left me. As long as I can follow the VTM, I'm fine. Thanks for putting all that info up for me. I appreciate it, and I'll try it.

    Hey, either of you guys see this vid? If not, might be worth a look.

    http://wxwidgets.info/?q=wxwidgets_and_vc2005_video

    This is guy did what I did using the wx_dll as I pointed out in an earlier post. He was using ver. 2.7.0 I think but I followed the first part, initial setup and it compiled just fine using 2.8.8 with VC 2008. It looks different from the vtms though, like I said earlier about having the wx in the names like wxjpeg, wxtiff, wxregex, etc.

    BTW, do the instructors ever pop up on the forum? I would think Buzz or one of the others could easily resolve this issue with a post explaining how to do this with the newer versions. Not just for me. I know they wouldn't have time to answer every question about all the VTMs. But maybe a sticky just to update the wxWidgets setup proccess for the VTMs?

    But then, I might have missed out on what I've learned from all the research, and trying different stuff, and meeting you guys too. So I don't know.

    ================================================== ============================================

    Edit: Correction, In the vid, the guy used the wx.dsw file, not the wx_dll. But the end result looks the same as when I used the wx_dll.dsw.
    Last edited by Brusher; 07-27-2008 at 04:39 PM.

  6. #16
    Join Date
    Dec 2005
    Posts
    97
    I used the same file that guy did. I basically did the same thing, except that file I told you to apply does what he does when he goes in and adds the include and library directories, and the libraries to link with. He also sets it to unicode, and I think you can skip my other step (to change it from a console to a window app) if you just make a window app instead of a console app to start with. He also does something different for debug and release, and does something different with the dlls he compiles (multithreading issues). I didn't need to do the last, and unless you are making a project, you shouldn't need to do the first.

    I think the buzz crew are probably busy, but I would also expect that they don't keep up with all new releases of wxWidgets, so the only way they would know better than yourself is from their own experience with programming.

    Anyways, this might also help (I didn't watch it, but found it while looking for the tutorial I read):

    http://wiki.wxwidgets.org/HOWTO:_Ins...o_Express_2008

  7. #17
    Join Date
    Mar 2008
    Posts
    24
    Thanks for the vid link.

    I watched it and he explains that quite nicely. If it works (bet it will) then I'm good to go.

    I'll let you know.

    Thanks again.

  8. #18
    Join Date
    Mar 2008
    Posts
    394
    Quote Originally Posted by Brusher View Post
    Thanks for the vid link.

    I watched it and he explains that quite nicely. If it works (bet it will) then I'm good to go.

    I'll let you know.

    Thanks again.
    Awesome! I can't wait to see if you can actually get coding wxWidgets properly! You better work hard and show us the goods after all this trouble.. haha. Good luck, I'll watch the thread to see if you do good.

  9. #19
    Join Date
    Mar 2008
    Posts
    24
    Thanks Khalhern.

    I've been drooling about getting into the meat of the VTM. I Can't wait!

    I'll let you know.

  10. #20
    Join Date
    Mar 2008
    Posts
    24
    Just a note. Upon continuing the VTM lesson, volume 4 intro, I remembered that when using the ver. 2.8.8 wx.dsw for setting up wxWidgets, it doesn't have the wxWindows program in the list of programs.

    The wxWindows, setup.h file is the one in which the VTM uses to change the wxUse_GLCANVAS setting from 0, to 1.

    However, it does have a "Base" program which has two setup.h files under "Base\Setup Headers"

    The first setup.h reads:

    #define wxUSE_GLCANVAS 0

    The second reads:

    #if defined(__WIN32__)
    #define wxUSE_GLCANVAS 1
    #else
    #define wxUSE_GLCANVAS 0
    #endif


    Please tell me if I'm wrong, but based on the above code, I'm going to assume that that portion of the lesson is already taken care of for you using this method, as long as you're making a WIN32 App.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •