|
Thanks, worked like a champ..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I am using try{}catch(...) handlers extensively to handle all types of exceptions that are thrown.
In particular, I am catching hardware exceptions such as access violations and so on.
How can I find out exactly what hardware exception occurred within the catch(...) handler?
Do I have to use SEH to do this?
|
|
|
|
|
Does std::exception::what() help you? Or do you need to differtiate the exception objects at runtime and react on their type? Then typeid may help you (look for RTTI in MSDN)to determine the type of the exception-object you caught.
But maybe you simply can replace the catch(...) with a list of catches for the exception classes you need.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
|
DaGlynn wrote:
Do I have to use SEH to do this?
according to the docs, yes.
You can use GetExceptionInformation() to do that - but this can be called only insode the __except() filter
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Within a class I need to have an object in the heap. Within the constructor I make a new object and I can access the data members. When I try to access them in different member functions however I get memory access errors. I call the delete in the destructor, and not before. I'm not sure what is wrong.
|
|
|
|
|
Could you post your code?
|
|
|
|
|
|
Here's your problem:
In CParticleEngine::init(int nParticles) you have the following line:
CParticle *m_pParticles = new CParticle[nParticles];
Change it to m_pParticles = new CParticle[nParticles]; and your code will work. By declaring the m_pParticles variable again in the init() function, you have made a new variable that only has scope in the init() function, and happens to be named the same as your member variable m_pParticles. Thus the member variable never gets assigned, and you (rightfully) get memory errors when you later try and delete it.
--Dean
|
|
|
|
|
Excellent. Thanks a bunch!
|
|
|
|
|
while(nCount != nParticles)
should be
while(nCount < nParticles) //0 based indexes in C++
|
|
|
|
|
Ok, here is the situation. I have a CAxDialogImpl modal dialog created using a dialog I created. Let us call it CMyDialog. I set the caption in CMyDialog's resource editor. The dialog style is Overlapping and Resizing. Everything is right with the world. When the dialog is created via CAxDialogImpl<cmydialog>::DoModal, the caption in the resource is, predictably, displayed.
But now I want to change the caption of the dialog dynamically when the dialog is created ( It is instantiated from another dialog ). I modify the OnShowWindow function so that I may change the caption with SetWindowText(). Guess what; though the function returns success, the caption does not change.
I want to change the caption. SetWindowText isn't doing it. Anyone got any ideas? A grateful person awaits your learned replies.
"Never play drinking games with coffee."
|
|
|
|
|
Set the dialog's caption in OnInitDialog().
|
|
|
|
|
I discovered the problem; a previously overwritten WS_SETTEXT command. Thanks for the suggestion, though.
"Never play drinking games with coffee"
|
|
|
|
|
|
I need to make a time stamp every second but, I need the format to be a double.
I know about the Now().FormatString("ddddd hh:nn:ss"); function, but I really need it in a double or float type.
any ideas?
sj
|
|
|
|
|
::VariantTimeToSystemTime
::SystemTimeToVariantTime
|
|
|
|
|
I want to include a background image in my programs about dialog, which is derived from CDHtmlDialog. Using the toolbar, I added the image and it inserted the following code:
This works fine on my computer but when I try the program on another computer it can't find the image since the path doesn't exist. I've tried using a relative path like but that doesn't work, even on my computer. VC doesn't seem to follow nornal HTML coding rules. Can someone please explain how to code this so the image will display properly on any computer?
|
|
|
|
|
You can put the image into your exe and use the res:// protocol in your body background tag.
onwards and upwards...
|
|
|
|
|
Can res:// be used to access a resource like a file in any application?
|
|
|
|
|
|
|
Thanks for the help. That took care of it.
|
|
|
|
|
Does anyone know any good Speech Recognition SAPI 5 Tutorials (preferably for Visual C++ .NET)
that really works?
I've found some on the net, but I can't get them all to work!
thanx
Superstein
|
|
|
|
|
hello,
I have a code that raise this error "Not enough storage is available to process this command." when I try to Realloc a buffer ....
temp = (DWORD)GlobalReAlloc((HGLOBAL)eyeConClients[msg - SOCKET_ID - 1].buffer, szTemp, GMEM_MOVEABLE);
this works ok many times ... and randomly raise that error ....
any suggestions ? please help ....
thanks !!!
|
|
|
|