|
Hi!
When I run my project, a window opens and immediately colses showing exception. When I break this exception, program control goes to a file called CEGUIDynamicModule.cpp. The output Window shows this:
'CricketGUI.exe': Loaded 'E:\CricketGUI\CricketGUI\Debug\CricketGUI.exe', Symbols loaded.
'CricketGUI.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'CricketGUI.exe': Loaded 'E:\CricketGUI\CricketGUI\Debug\CEGUIBase_d.dll', Symbols loaded.
'CricketGUI.exe': Loaded 'C:\Windows\System32\winmm.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\user32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\ole32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\oleacc.dll'
'CricketGUI.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcp90d.dll', Symbols loaded.
'CricketGUI.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll', Symbols loaded.
'CricketGUI.exe': Loaded 'E:\CricketGUI\CricketGUI\Debug\CEGUIIrrlichtRenderer_d.dll', Symbols loaded.
'CricketGUI.exe': Loaded 'E:\CricketGUI\CricketGUI\Debug\Irrlicht.dll', Binary was not built with debug information.
'CricketGUI.exe': Loaded 'C:\Windows\System32\opengl32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\glu32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\ddraw.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\dciman32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\setupapi.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\shimeng.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\apphelp.dll'
'CricketGUI.exe': Loaded 'C:\Windows\AppPatch\AcLayers.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\shell32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\shlwapi.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\userenv.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\secur32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\winspool.drv'
'CricketGUI.exe': Loaded 'C:\Windows\System32\mpr.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\imm32.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\msctf.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\lpk.dll'
'CricketGUI.exe': Loaded 'C:\Windows\System32\usp10.dll'
'CricketGUI.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18005_none_5cb72f96088b0de0\comctl32.dll'
Irrlicht Engine version 1.7.1
Microsoft Windows Vista Professional Service Pack 2 (Build 6002)
'CricketGUI.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
First-chance exception at 0x7608fbae in CricketGUI.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x002bd0f4..
Unhandled exception at 0x7608fbae in CricketGUI.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x002bd0f4..
How to solve this exception and run my application?
|
|
|
|
|
have you tried single step debugging/tracing it and/or logging information ?
'g'
|
|
|
|
|
I have no idea what the library you're using is doing, but have you looked up the documentation for that exception and found what sort of thing is happening when it's thrown?
Perhaps catch the exception and have a look and see if there's any hints as to what caused it? Has it a message function that'll give you a clue as to what happened? Line number of file information as to where it happened?
Cheers,
Ash
|
|
|
|
|
|
Hi,
Does anyone know if there's a built in function in c++ or mfc in which you can pass a double or long double and declare how many places you'd like the value to be rounded to? For example, pass it 12.125 and n=2 decimal places, and out comes 12.13, etc.
Thanks!
P.S. Formatting the values during cout won't work for me, I need to store the rounded values in a new variable.
|
|
|
|
|
I don't do a lot of numeric stuff anymore so take this with a pinch of salt.
First off I don't know any C++ standard library facilities that would help. C had floor and ceil which take doubles and return an integer either truncating the value or rounding up to the next highest number. With these and pow you can write something that'll be good enough for most things.
Off the top of my head it'd look like:
double round_to( double number, unsigned number_of_decimal_places )
{
double exponent( pow( 10, number_of_decimal_places ) );
number *= exponent;
number += 0.5;
return floor( number ) / exponent;
}
which is a bit cheesy - it won't work for negative numbers or any number that causes the line with the "disaster line!" comment to overflow an integer. However they might give you a handle if no one comes up with a better idea!
Cheers,
Ash
Edited to remove a spurious brace...
modified on Friday, June 18, 2010 3:52 PM
|
|
|
|
|
|
You may use the dirty old town's trick:
double rounded(double x, int n)
{
double d = pow(10, (double)n);
return ((int)(x * d + .5))/d;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Excellent, this did exactly what I was needing. Thanks!
One thing I noticed was when I used -265.3215894 with n=2, it returns -265.31 instead of -265.32
Any thoughts on this?
|
|
|
|
|
As Aescleal stated, that doesn't work for negative numbers. However you may test for the sign and act accordingly (subtracting .5 , instead of adding it).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Where do I update my program to create user data? The program data needs to be global to all users on the machine and must not be in a hidden or protected folder because occasionally users do have to access the data to get a file or place a file.
Currently it's written to sub-directories off of "c:\Program Files\ProgramNameAndVersionHere"
Do I need to just do this the Win 3.1 way and write to "c:\ProgramNameHere"?
Thanks in advance.
|
|
|
|
|
Check out this[^] method, i hope it can help you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers don't kill programs, users kill programs <
> "It doesn't work, fix it" does not qualify as a bug report. <
|
|
|
|
|
Thanks for responding. Please see my response to Maximilien.
|
|
|
|
|
In general, it's a bad idea to let ordinary users modify something in the installation path ("c:\program files", ...)
What about using the path "CSIDL_COMMON_APPDATA" or "CSIDL_COMMON_DOCUMENTS" both can be fetch with the <code> SHGetFolderPath API.
There's also the "C:\Users\Public" folder, but I'm not certain about that one.
Watched code never compiles.
|
|
|
|
|
Thanks for both responses.
"CSIDL_COMMON_APPDATA" corresponds to "c:\ProgramData" which is a hidden folder in Win7.
The documentation says "CSIDL_COMMON_DOCUMENTS" corresponds to "... A typical path is 'C:\Documents and Settings\All Users\Documents' ...". What does that mean in Win7? There is no "c:\Documents and Settings" folder.
The "C:\Users\Public" seems the most promising, but how do I get the folder from code since I didn't see any CSIDL or FOLDERID that seemed to correspond?
|
|
|
|
|
I really have not much win7 experience yet (still running XP here), but isn't there also an "All Users" inside c:\users, althorough that might be also hidden.
You could try "trial and error" (if google doesn't help), just query for the special folder locations one by one, maybe c:\users\public turns up for one of those CSIDs...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Computers don't kill programs, users kill programs <
> "It doesn't work, fix it" does not qualify as a bug report. <
|
|
|
|
|
In Windows 7, Documents and Settings no longer exists...instead there is a folder named Users that has the indivudal user info. Either way, using the GetFolderPath method will return the proper name - Vista or Windows 7.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
|
Trying to rebuild our application with VS2010 (latest beta) ...
We get weird errors from atlbase.h.
...<br />
2> myfile.cpp<br />
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlbase.h(4957): error C3861: 'GetMessage': identifier not found<br />
2>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlbase.h(4957): fatal error C1903: unable to recover from previous error(s); stopping compilation<br />
...<br />
It does not happend on all files, but only a few, so that it's not something that should be in the settings (?) or the precompiled header (?)
Any idea what could be the cause of that weird error ? missing some "#include" on my side ?
and contrary to popular belief, this is not urgent... just exploratory.
Thanks.
Watched code never compiles.
|
|
|
|
|
Hi,
Could it be something related to using the beta release? The finished item's been out a while so it might be worth looking at a full release version first.
Cheers,
Ash
|
|
|
|
|
I want to load a dll library of mine before i trigger vs' debug menu?
In another word, i want to inject my dll to the new debugged process(and my dll should be loaded before any other dll except kernel32.dll). What should i do?
|
|
|
|
|
|
Dear All,
I am creating a SplitterWnd which consist of Three Views. One View is a Tree Control & other are Two Form Views. When Click the Tree Items i am deleting these tow Form Views.
From Tree View it is getting no Problem.
My Problme is When i select a Menu Item which is having same Items populated in TreeCtl Items. When i focus the Cursor to any one of the Form View and slect the Menu Item it is giving Assertion.
CSplitterwnd.DeleteView(1,0) //---> Second View is Getting Assertion from Menu selected.
Please help me out.
Thanks & Regards,
Uday.
|
|
|
|
|
Hi,
I am having cstring stringToBeConverted;
And,i trimmed the above string as
stringToBeConverted.Trim(stringToBeConverted[0]);
If i use std string instead of cstring how can i trim and succeeds the above functionality..
how to use boost::trim????
thanx
|
|
|
|
|
See this[^] SO thread. It contains both usage of trim from Boost's string algorithms and custom trim implementations.
|
|
|
|