errors in every step i do

samsamsam

17-08-2008 21:31:16

i wrote this code::
/////
class GuiFrameListener : public ExampleFrameListener, public OIS::KeyListener, public OIS::MouseListener
{
private:
MyGUI::Gui * mGUI;
bool mShutdownRequested;

public:
// NB using buffered input, this is the only change
GuiFrameListener(RenderWindow* mWindow,Camera* cam) : ExampleFrameListener(mWindow,cam, true, true, true),
mShutdownRequested(false)
{
MyGUI::Gui * mGUI=new MyGUI::Gui();
mGUI->initialise(mWindow);
MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::ALIGN_DEFAULT, "Main");
button->setCaption("exit");
mMouse->setEventCallback(this);
mKeyboard->setEventCallback(this);
}
bool GuiFrameListener::frameStarted(const Ogre::FrameEvent& evt)
{
mGUI->injectFrameEntered(evt.timeSinceLastFrame);
return true;
}

bool GuiFrameListener::mouseMoved( const OIS::MouseEvent &arg )
{
mGUI->injectMouseMove(arg);
return true;
}

bool GuiFrameListener::mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
mGUI->injectMousePress(arg, id);
return true;
}

bool GuiFrameListener::mouseReleased( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
mGUI->injectMouseRelease(arg, id);
return true;
}

bool GuiFrameListener::keyPressed( const OIS::KeyEvent &arg )
{
mGUI->injectKeyPress(arg);
return true;
}

bool GuiFrameListener::keyReleased( const OIS::KeyEvent &arg )
{
mGUI->injectKeyRelease(arg);
return true;
}
};
//////////

but when i try to make a new insatnce of that class in my ogre program and try to do this:

GuiFrameListener* mFrameListener= new GuiFrameListener(mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);

i had this error in running time::
Unhandled exception at 0x0083f884 (MyGUI_d.dll) in test.exe: 0xC0000005: Access violation reading location 0xcdcdce51.

so any help pls.... :(

mrmclovin

17-08-2008 21:50:49

Hi!

Have you copied the media resources located in MyGUI_Media folder to your own media folder (and/or set folder-path in your resources.cfg?)?

I guess your code should work. Post MyGUI and Ogre logs located in your .exe folder

samsamsam

17-08-2008 21:55:46

thank u for helping.
i found the error by chance:
just replace the code::
public:
// NB using buffered input, this is the only change
GuiFrameListener(RenderWindow* mWindow,Camera* cam) : ExampleFrameListener(mWindow,cam, true, true, true),

by the code:

public:
// NB using buffered input, this is the only change
GuiFrameListener(RenderWindow* mWindow,Camera* cam) : ExampleFrameListener(mWindow,cam),

samsamsam

17-08-2008 22:35:45

i think that my problem is with the instruction::
mGUI->injectFrameEntered(evt.timeSinceLastFrame);

cause my code code works without it,
but still the mouse pointer stucked in upper left corner of the screen,
i think cause i don't update the GUI classes which is done by that instruction.
but as i said when i but it i had this error:

Unhandled exception at 0x0083f884 (MyGUI_d.dll) in test.exe: 0xC0000005: Access violation reading location 0xcdcdce51.

and i think "i think" that nothing related to resources cause i copied them to media folder and added paths to the resources file
am trying now to make that important instruction works but still no result. :oops:

samsamsam

17-08-2008 22:43:29

sorryyyyyyyyyyyyy
i noticed that u said hi with this mark " ! "
and then i noticed that i asked without saying HI :oops:
so am sorry but am too confused now cause am working and asking and errors every where,"am making errors in my program larger than forgetting to say hi".
and about that i found the solution in my seconed post, i decovered that am not;
and i still have the same problem which is in
mGUI->injectFrameEntered(evt.timeSinceLastFrame);

samsamsam

17-08-2008 23:28:55

hi

if u mean build log i copied it:

Build Log Build started: Project: test, Configuration: Debug|Win32
Command Lines Creating temporary file "c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\RSP00016F28764004.rsp" with contents
[
/Od /I "include" /I "c:\OgreSDK\include" /I "c:\OgreSDK\samples\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /Gy /fp:fast /Fo"obj\Debug\\" /Fd"obj\Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP ".\src\test.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\RSP00016F28764004.rsp" /nologo /errorReport:prompt"
Creating temporary file "c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\RSP00017028764004.rsp" with contents
[
/OUT:"bin\Debug\test.exe" /INCREMENTAL /LIBPATH:"c:\OgreSDK\lib" /MANIFEST /MANIFESTFILE:"obj\Debug\test.exe.intermediate.manifest" /DEBUG /PDB:"bin\Debug/test.pdb" /SUBSYSTEM:WINDOWS /OPT:NOWIN98 /MACHINE:X86 OgreMain_d.lib OIS_d.lib MyGUI_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

".\obj\Debug\test.obj"

".\obj\Debug\test.exe.embed.manifest.res"
]
Creating command line "link.exe @"c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\RSP00017028764004.rsp" /NOLOGO /ERRORREPORT:PROMPT"
Creating temporary file "c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\RSP00017128764004.rsp" with contents
[
/out:".\obj\Debug\test.exe.embed.manifest" /notify_update /manifest

".\obj\Debug\test.exe.intermediate.manifest"
]
Creating command line "mt.exe @"c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\RSP00017128764004.rsp" /nologo"
Creating temporary file "c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\BAT00017228764004.bat" with contents
[
@echo Manifest resource last updated at %TIME% on %DATE% > ".\obj\Debug\mt.dep"
]
Creating command line """c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\BAT00017228764004.bat"""
Creating temporary file "c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\BAT00017328764004.bat" with contents
[
@echo off

copy "bin\Debug\test.exe" "c:\OgreSDK\Bin\Debug"

if errorlevel 1 goto VCReportError

goto VCEnd

:VCReportError

echo Project : error PRJ0019: A tool returned an error code from "Copying exe to samples bin directory ..."

exit 1

:VCEnd
]
Creating command line """c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\BAT00017328764004.bat"""
Output Window Compiling...
test.cpp
c:\documents and settings\administrator\desktop\test\test\src\test.cpp(162) : warning C4101: 'mFountainNode' : unreferenced local variable
Linking...
Embedding manifest...
Copying exe to samples bin directory ...
1 file(s) copied.
Results Build log was saved at "file://c:\Documents and Settings\Administrator\Desktop\test\test\obj\Debug\BuildLog.htm"
test - 0 error(s), 1 warning(s)




i use VS 2005, OgreSDKSetup1.4.7_VC80p1.exe and, MyGUI_2.2.0_RC1

and the problem still exist