I'm a newbie too and have had the same problem applying the MFC example to my own app. The problem was that wasn't giving a complete path. Use szPathName instead of szFilename from the MFC file dialog.
Another way is to have the directory containning your data in your PATH environment variable. This, however is not very elegant. - Nick - ________________________________ > From: [EMAIL PROTECTED] > To: [email protected] > Date: Tue, 28 Aug 2007 13:18:52 -0400 > Subject: [osg-users] osgviewerMFC example crash in 2.1.8 > > I’m still finding my way around OSG so I wanted to find out if this issue is > mine before I continue pulling my hair out. > I downloaded and built OSG 2.1.8. I took the code from one of the examples to > test, prior to integrating OSG into my app. This is on WinXP SP2 x86 and the > dev env is VC++ in VS8. > - I created a new project using the code from the “osgViewerMFC” example. > - It compiled fine in both release and debug and it launches with no issues. > - When I use the open command (from menu or toolbar) and direct it to any > test osg file, it crashes with both debug and release builds. > - I used the VS debugger to walk through and find the crash in the debug > build. > - Line 143 of “optimizer.cpp” caused an unhandled exception because node was > a NULL point. > - I walked up the call stack back into the osgViewerMFC code and found the > cause is that mModel in cOSG::InitSceneGraph (“MFC_OSG.cpp”) is also NULL. > - It turns out osgDB::readNodeFile, earlier in InitSceneGraph, returned a > NULL mModel even though the filename passed was valid. > To verify it wasn’t my settings when creating the example project from > scratch I chose another example, specifically osgShadow example. I created a > new project added the source, compiled, and both debug and release work > perfectly. > Is this a known issue with osgViewerMFC? If not any suggestion on what might > be causing it? > Thanks! > Ricko _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

