|
Does anyone know any way to get the selected item off of a CTreeCtrl on a different dialog? The only thing I have thought of is to save the index of the selected value to a database every time it changes.
Thanks
-- modified at 17:05 Friday 13th July, 2007
|
|
|
|
|
Can we discuss the design criteria for the usage of set_new_handler. Why is it used instead of using exceptions.
Also what is the implication os using the same at a class level.
|
|
|
|
|
tom groezer wrote: Can we discuss the design criteria for the usage of set_new_handler. Why is it used instead of using exceptions.
Because you cannot handle memory leaks with exceptions. When an app runs out of memory it's mostly due to memory leaks(1). By definition you cannot recover memory leaks. So the best thing to do is to just terminate the app via the new handler.
(1) only Java Swing apps run out memory inherently.
|
|
|
|
|
you would only use this if you're developing a debugger or some kind of diagnostic application use to monitor a process access to memory. other than this you don't need to worry about it!
Yours Truly, The One and Only!
|
|
|
|
|
How do I subscribe to comp.lang.C++.moderated in outlookexpress or in RSS reader? Also are there any good C++/VC++ admirable newsgroup to which one can subscribe to?
|
|
|
|
|
Try first the non-moderated comp.lang.c++
No subscription necessary, just post the same way as to any other newsgroup. Before posting read the C++ FAQ[^].
|
|
|
|
|
How can it be used form outlook or an rss reader?
|
|
|
|
|
tom groezer wrote: How can it be used form outlook or an rss reader?
Sorry, I don't use Outlook. Put the following line into your browser's address field and see what happens:
news://comp.lang.c++
|
|
|
|
|
tom groezer wrote: How can it be used form outlook
It can't, without a plugin of some sort. You can use OE, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I cant seem to find this anywhere, but does anyone know what WinAPI to call when doing a lookup of the windows Domain/Workspace ? Ive searched MSDN over and over and cant find a thing that has to do with what im trying to do. I thought GetDomainName() would work, but to no avail. It doesnt, thanx in advance!
|
|
|
|
|
main()<br />
{<br />
int x=2.4;<br />
if(x==2.4)<br />
cout<<"true";<br />
else<br />
cout<<"false";<br />
return 0;<br />
}
Well it is not working, help me out please!
Spread wat u Know!
|
|
|
|
|
You cannot compare FP numbers in this fashion. You'll need something like:
if (fabs(x - 2.4) < 0.00001)
cout << "true" << endl; See here for more.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thnx but I did visit Bruce Dawson
But couldnt get it in nutshell
Please will u?
Spread wat u Know!
|
|
|
|
|
in short, a computer cannot "always" represent a floating point number accurately in binary format, and a precision error will be inserted when converting back and forth between the floating point number and the binary representation.
for example :
2.4 can be "errored" to something like either 2.39999999 or 2.40000001
|
|
|
|
|
Thnkx a lot..............
Does this mean IEEE32/64 arent good enough to store FPs accurately AND wat when we use the same number to print on screen......i mean how is that FP printed accurately?
N sorry it is actually float x=2.4;
Spread wat u Know!
|
|
|
|
|
Cmania wrote: int x=2.4;
you need to go look at the definition of "int"
|
|
|
|
|
Here's an CodeProject article that discusses this issue:
http://www.codeproject.com/tips/FloatingPointEquality.asp[^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am writing an MFC DLL and I am getting the following linker error:
error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > CApp::m_sDllVersion" (?m_sDllVersion@CApp@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
I have the CApp class decalred thus:
#pragma once<br />
<br />
#ifndef __AFXWIN_H__<br />
#error include 'stdafx.h' before including this file for PCH<br />
#endif<br />
<br />
#include "resource.h"
#include <string><br />
<br />
using namespace std;<br />
<br />
class CApp : public CWinApp<br />
{<br />
public:<br />
CApp();<br />
<br />
static const char* GetDllVersion( void );<br />
<br />
public:<br />
virtual BOOL InitInstance();<br />
<br />
DECLARE_MESSAGE_MAP()<br />
<br />
private:<br />
static string m_sDllVersion;<br />
};
|
|
|
|
|
You have to initialise static member variables, for instance
static string CApp::m_sDllVersion="";
inside one .cpp source file.
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.
|
|
|
|
|
No that isn't it, but thanks anyway.
I had both VS6 and VS2003 installed and I think it was trying to use the wrong lib. I have now un-installed VS6 and cleared out my system path and lib variables of any reference to VS6 folders. Have re-started the PC and still have the error. At work I managed to get around the problem by telling the linker to link to a VS2003 MFC lib but I cannot now remember which one it was!
I am still getting the linker error! If anyone knows of the answer I would appreciate their input. If I solve this I will post what I did in here, in case someone else encounters the same issue.
|
|
|
|
|
Andy H wrote: No that isn't it
Sure? AFAIK you MUST initialize static members.
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.
|
|
|
|
|
That is true, but maybe he's just not showing us that he has initialized it in his .cpp file. He should make it clear to us whether he has or has not done this.
|
|
|
|
|
I agree, on the other hand, the Linker error message content supports my hypothesis...
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.
|
|
|
|
|
class A<br />
{<br />
public:<br />
virtual void f(){cout << "I'm into base \n";}<br />
};<br />
<br />
class B : public A<br />
{<br />
public:<br />
virtual void f(){cout << "I'm into derived \n";} <br />
};
In the above code will there be two virtual tables that will be created or the creation of a virtual table depends on what objects is being created. Lets say if a pointer to derived class B is obtained by doing a static_cast on the pointer returned from a dynamic creation of object of class A when I see the debugger it shows the __vfptr to some address with const A::'vftable'. Does it mean that there is only one vtable that is created.
So basically the query boils down to the fact that how many vtable are created on declaration of classes with virtual functions.
|
|
|
|
|
tom groezer wrote: So basically the query boils down to the fact that how many vtable are created on declaration of classes with virtual functions.
One vtable per class (not per object). Each object with virtual functions contains one (hidden) pointer to one vtable. At least that's an educated guess because compilers are free to implement polymorphisms any way they want, even without a vtable mechanism.
|
|
|
|