|
errrrr
from what i remember of that kind of programming doing this is a very dodgy thing to do while a machine is running an OS ... i dont know if its even possible under modern OS's ... on a dos machine you would have to force a remote reboot for the change to come into effect which you can't do without having some kind of network-aware resident app running that would do the reboot on a received command
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Dear all,
How can I read a text file and put all the text into ONE CString?
Thanks for your help!
Vickie
|
|
|
|
|
Perhaps you could open the file binary, get the length, then
read it all into a CString by calling CString::GetBufferSetLength()
first with the size of the file.
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
Just kidding...
Seriously, I'm almost finished (*GASP*) with my program and I wanted to thank the following folks for taking the time to lead me in the right direction:
Erik Funkenbusch
ov
lauren
Christian Graus
Chris Losinger
Tim Deveaux
Thanks a million folks! If we could only meet, I'd buy a round for everybody, hehe!
Being a complete and unadulterated newbie, I've tried hard to find information before posting here, only to find out that (in some cases) I didn't look hard enough. Your comments and replies to my questions were a great help.
Just thought I'd thank you folks and give you a little feedback. You are appreciated!
|
|
|
|
|
awwwwwww
thats so sweet
thank you for saying so
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Cool! - a nice warm fuzzie to end the work week! Thanks for the thanks - and for putting my name in such good company! (Ed. No, Tim, we don't have a brown nosed emoticon).
|
|
|
|
|
Well, thank you.
I'm glad it's come together for you, and that I was able to help. As I didn't get the chance to go to Uni, I am 'self educated', which is usually a misnomer - it means I had no formal education, but relied heavily on books and forums like this one. It is gratifying to know I am able to offer the sort of help that got me going when I was starting out.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hi,
I am writing a string class in VC++.I am using array to take user input and to display them to the user.
1.in one function I want to change the complete input to uppercase.
2.In second function I want to change first character to uppercase.
I am giving code for my main class.
main()
{
String A;
cout<<"enter Words:";
String Sentence[ArSize];
char temp[MaxLen];
int i;
int wordLen;
for(i=0;i
|
|
|
|
|
look in the MSDN for "strupr" and "toupper"
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Make a loop. Search for spaces and other characters (like brackets).
Make the next character uppercase, then search for the next character
after that that is a space...
void _MakeSentenceCase(CString& sNewName)
{
int iChar = 0, iLen;
iLen = sNewName.GetLength();
char charUpper;
while (iChar < iLen) {
charUpper = sNewName.GetAt(iChar);
if ((charUpper != '(') && (charUpper != '[')) {
charUpper = *strupr(&charUpper);
sNewName.SetAt(iChar, charUpper);
iChar = sNewName.Find(" ", iChar);
}
iChar++;
if (iChar == 0)
break;
}
}
HTH,
Daniel
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
Does anyone know how to create a CSplitterWnd within a CMDIFrameWnd, with only one view (at the left side), and the CMDIFrameWnd at the right side???
CString Dutch = "Double Dutch";
|
|
|
|
|
If you're looking to have a docking view (or just a dockbar)
on the left and the MDICLIENT on the right check out www.datamekanix.com.
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
In the CTreeCtrl you can define 15 icons as overlay icons. (Common controls > v4.71)
But as far as I know you can't combine two or more of them.
This means that if you need a combination of two overlays,
you also need to define the combined overlay icon.
This means that if you want to combine every icon with each other
- with 15 possible overlay icons - you can only define 4 different icons.
The rest of the 15 'places' is occupied by the combinations.
Does anyone ever did "CTreeCtrl icon overlaying" himself?
Geert.
|
|
|
|
|
|
Hi
I would like to suppress the "Open Attachment Warning" message when I open an exe from the Web browser.
Kindly let me know how to do the same.
Thanks
Karthik
|
|
|
|
|
I need to change the background color in a rich edit. But, when I change the background color, it changes for the whole rich edit, while my intent is to change only the background of the selected text . How can I do this!?!?
|
|
|
|
|
Search MSDN for CHARFORMAT2.
"das leid schlaft in der maschine" -Einstürzende Neubauten
|
|
|
|
|
A quick C++ language question for you experts - if I have a class X with no default destructor, and I want to declare an array of Xs as a member of class Y, how do I do it - the Xs must be initialised in the constructor initialiser list of Y:Y(), but there doesn't seem to be a way of initialising an array in a constructor initialiser list, although I've searched Stroustrup etc. and it doesn't specifically say that you can't do it, just doesn't say how.
Any offers
Dave
Dave
|
|
|
|
|
so u want to embed a class within another class and init some array in the embedded class?
just write a constructor for the embedded class that fills the array with the necessary values
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I want to embed an array of objects of type X in class Y. Why don't you read the question? I also don't like being called an idiot by someone who apparently can't read, and apparently can't write either.
Dave
Dave
|
|
|
|
|
You could try init your array of objects in a loop or something like this:
ClassX *MyClassXObejcts[SIZE];
for ( int x=0 ; x < = SIZE-1 ; x++ )
MyClassXObjects[x] = new ClassX( .... );
Now you will call the constructor of ClassX size-times. Within every call of the constructor you can init each ClassX own array.
Hope that is what you are looking for
Greatings Mario ///
----------------------
www.klangwerker.de
mario@klangwerker.de
----------------------
|
|
|
|
|
Yes indeed - that is actually what I have done to 'get around' the problem. But I am puzzled that I can't do what I actually want to do, which is initialise the array in the initialiser list. It isn't even possible to initialise an array of integers in the initialiser list, and this seems to me to be a 'hole' in the language definition.
Dave
|
|
|
|
|
It's kind of a hole, but filling it would cause inconsistancies
class X
{
X(char* c);
};
class Y
{
Y() : ???
{}
X x[100];
}
How would we specify the initializer for all the elements in x?
x("Blah") tries to apply the constructor for X on the array itself - a type mismatch. You are also only able to initialise all the elements to the same value, which you can do with a default constructor on X anyway.
x[0]("Blah"), x[1]("Blah")... initialises each element individually, which would be pretty tedious for a very large array!
So the best solution was to not provide a mechanism for doing this and force you to workaround the problem.
Simon
|
|
|
|
|
Thanks Simon, that makes sense. The main thing is you've confirmed that it can't be done, and it's not just that I couldn't find out how to do it.
I appreciate your making the point about signatures too, in your other message. Thanks.
Dave
|
|
|
|
|
Thanks Simon, that makes sense. The main thing is you've confirmed that it can't be done, and it's not just that I couldn't find out how to do it.
I appreciate your making the point about signatures too, in your other message. Thanks.
Dave
|
|
|
|