|
I have only one dialog box and inside that i have a picture control. I have to access a member function of CImage which is derived class of CStatic. I have to created a control variable of picture control but by default I am able to create CStatic Variable type for picture control but not able to create CImage Variable type for the picture control
S.Yamini
|
|
|
|
|
Leaks memory when used with VS 2005. This is an issue with std::basic_iostream that is fixed in VS SP1 but also affects stringstream and others.
Can someone suggest an alternative for parsing numeric values from a string other that atoi() and its cousins?
|
|
|
|
|
Josh Gray wrote: other that atoi() and its cousins
What is it about atoi() that makes it unacceptable? Not sure I understand what your requirements are.
|
|
|
|
|
Hans Dietrich wrote: What is it about atoi() that makes it unacceptable?
What if atoi returns 0? Was it a bad string, or simply "0"?
|
|
|
|
|
Which is why functions like strtol(...) and its ilk exist. :P
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Josh Gray wrote: This is an issue with std::basic_iostream that is fixed in VS SP1 but also affects stringstream and others.
Wow! I thought they fixed it. So you probably can't use stringstream directly[^] ?
Anyway, there is strtol[^] which is much more robust than atoi, but still a low-level C function.
|
|
|
|
|
Nemanja Trifunovic wrote: Wow! I thought they fixed it. So you probably can't use stringstream directly[^] ?
Nope, anything based around basic::iostream will probably have a leak.
|
|
|
|
|
Josh Gray wrote: Can someone suggest an alternative for parsing numeric values from a string other that atoi() and its cousins?
Is strtol() considered a cousin (hint: it can differentiate between 0 and an error)?
"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
|
|
|
|
|
DavidCrow wrote: Is strtol() considered a cousin (hint: it can differentiate between 0 and an error)?
Thanks, thats what I was looking for
|
|
|
|
|
Hi,
I am setting value name and value data to a registry key in HKLM.
This function succedes and correctly sets the data correctly for this key in Windows 2000, windows 2003, Windows XP, but in Vista function succedes but if i open the registry and see it is not setting any values.
What i need to change to work with Vista also.
lRetCode=RegSetValueEx(hDckey,sourceName,0,
REG_SZ,
(LPBYTE)RegFile,
(DWORD) (_tcslen(RegFile)+1)*sizeof(TCHAR));
and also the API
RegDeleteValue(hDckey,Source);
is not deleting the value for this key eventhough this data is there for this key only in Vista it works with other platforms of Windows
|
|
|
|
|
Have a look at UAC[^] on vista.
There restriction in playing with registry from all previous platform.
Prasad
MS MVP - VC++
|
|
|
|
|
Thanks a lot!!!
I changed the "Privelege level" to "run this program as administrator",It sets the registry key values.
but i had some cout and cerr statements, those are not getting displayed on the console.do i need to do some settings for this also ? please let me know...
and also please tell me how to change this privilege level programmatically.
Any help will be appreciated!!!!!
|
|
|
|
|
Yashusid wrote: do i need to do some settings for this also ?
Yes.
You can try posting your questions in Vista[^] forum.
You will get useful answers there.
Prasad
MS MVP - VC++
|
|
|
|
|
Thank u ....i have posted this in Vista board.....
|
|
|
|
|
I have made a sdi application in that sdi application i have made a ui thread. Now my problem is i want to send a message from my ui thread to my main window and want it to display it in my list control which is in my main window.....i have simply made a object of my main class and used InsertItem but it is not working......tell me how to solve this problem.....
thanks in advance.....
|
|
|
|
|
My suggestion , better use PostMessage to intimate the Main Thread that something has changed rather using main thread object to do your work!
One more thing, is that object is new object or reference of main thread object, as what you have said is little contradictory i.e.
neha.agarwal27 wrote: i have simply made a object of my main class and used InsertItem but it is not working
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
no its not a new object its just a refrence of main object.....
|
|
|
|
|
Hi
class A
{
public:
virtual void fun()=0
{
cout<<"hai";//code inside in an pure virtual function
}
};
this works in VC++.(code inside an pure virtual function)
Is the same thing work in other compilers of C++
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
I have the following questions :
1.Which version of VC++ compiler did you use?
2.What is your understanding of pure virtual functions?
|
|
|
|
|
the version is VC++6.0
My understanding of Virtual fuction
It creates an V table, which provides run time ploymorphism,
And an pure virtual function makes the calss an Abstract base class.
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Great,
As for i am aware, the compiler should not allow it, and even if it allows what is the use of it when the class is abstract.
P.S: I have checked with VC++7.0, it gives an error
|
|
|
|
|
The error will only be displayed if you try to actually instantiate the class:
A myInstance; // This will fail
But VC6 is also a very old compiler and not fully compliant to the actual standard.
|
|
|
|
|
vibindia wrote: Is the same thing work in other compilers of C++
That sounds like a try-it-and-see question.
"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 believe that it is completely valid. Declaring a function as pure virtual does not mean that does not have an implementation, only that you have to provide one in a derived class.
This can (and has) been used to force developers to customize behavior for their derived classes, but still provide an implementation in the base class.
It should only give you an error if you try to directly instantiate an instance of that base class, or of a derived on that does not provide an implementation for the PV function.
Of course, I could be wrong here...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
In our app we have a resource manager which used a temporariy directory in the temp folder to store data while the application is runnning.
To preserve the integrity of our data we need to prevent the deletion of this folder while the application is running.
How could I lock the directory?
I'm thinking of win32 call like LockFile/LockFileEx, but I'm not sure what argument pass to these methods.
Any tips?
|
|
|
|