|
Do i need to upgrade my win98 to use the platform SDK may 2002?
The compiler complained that RC.exe the resource compiler requires a newer version of windows.
Anyone???
|
|
|
|
|
Ive looked everywhere... how the heck do i turn the lines numbers on in the IDE so I can tell where my errors are coming from?
|
|
|
|
|
Its not necessary. Line numers always appear on the IDE's status line (at the bottom of the IDE). Or you can go directly to a line number by selecting Edit | Go To ..., then entering the line number.
|
|
|
|
|
Double-click an error line and the IDE will jump right to it. You can then use F4 and shift+F4 to cycle thru the errors.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi all,
just a quick question to find out if anyone has tried making an mdi app in mfc that has direct3d display in each child window. And if anyone has tried it, what approach have you used. I can only think of one way of doing this, which entail recreating the d3d device everytime the user switches between the mdi window....or am I going about it all wrong?
Any help will be greatly appreciated.
Regards
|
|
|
|
|
I'm not 100% sure, but I think you can't do this with D3D (unless doing what you suggested, which would be so slow you might as well not do it at all).
You can however most definitely do this using OpenGL. That you get gfx code portability also, well, consider it a bonus.
|
|
|
|
|
I want to add a docking toolbar in Dialog.but all help about toolbars is on Frames, not dialogs,i also used MSToolbar Control but i havn't found the way to differentiate that which button of toolbar iz pressd from its ButtonPressed event. plz help me.........
|
|
|
|
|
Scroll down to the bottom of here to the Toolbars and Statusbars section. There are 3 or 4 tutorials on how to do it. Hope they help.
-Raffi
|
|
|
|
|
Hello, I'll admit i'm new to C++ and visual studio. Most of my programming experience comes from c# and php.
That said, I know basic C++, C, that kind of stuff, and am trying to learn to use visual C++.
So what I set out to do is make a simple dialog application that would take a input from a Edit control, change it into it's ASCII value, and replace the message with its ASCII value in the edit box.
Here is how I planed on doing it:
Take input-- UpdateData(FALSE); //get the data into the variable
Create byte array to store the chars in. (unsure)
Cycle through the bytes (for loop)
Extract the ASCII values and put them into a int array (no idea, can I
cast in visual C++, ie: (int) byte)
Somehow cycle through the int array and put them into a Cstring (unsure)
then UpdateData(TRUE) and put it back up...
So my questions:
1) Am I going about this in an ok way
2) Could I have a example of how you would put a CString into a byte array (I keep getting annoying errors about various stuff).
3) How can i get the ASCII value of a byte and put it into a int variable?
4) How can I cycle through a int array and put the values into a Cstring
Another annoying thing to me is that when i try and do
CString str;
str = "hello"
int lengh;
lengh = str.GetLengh();
I get a error that 'GetLengh' is not a member of 'CString', though according to MSDN it is.
Thanks for the help!
|
|
|
|
|
|
I mis-typed it into the web-form, I assure you I spelled it correctly in the C++ program
|
|
|
|
|
First, I think you, like may others, are confused about how computers actually store characters. In the English language (non-Englich languages may be store differently), each character (both printable and non-printable) is represented by a numeric value between 0 and 255. (Actually, at the machine level, they are represented by their binary values, but I won't go there.) You cannot put an "A" into either a CString or a char buffer. Instead, the "A" is always convertd to its numeric value. Charts are easily available that show what these numeric values are.
The Basic languages that I've used (although very seldon) have a function to convert "A" to its numeric equivalent. This is not necessary in C/C++, because they are already represented that way. So, if you have a CString that contains "Hello", then what that CString really contains is six bytes of numeric values (the 6th byte contains the null terminator 0 ).
How do you convert a "byte" to an "int" ? Simple:
char c = 'A';
unsigned char = 'A';
int x = 'A';
int x1 = 64; // numeric value of 'A'
int x2 = c; // converts a char to an int.
CString s = "Hello";
char c1 = s[1]; // extract the letter 'e' from CString
char buffer[126];
strcpy(buffer,s.GetBuffer(0)); // copy the contents of CString into a char buffer
I don't know why you would want to put a string array into an int array -- they can easily be represented in a char array (see above). But, if you did do that, you can put them into a CString like this:
int array[] = {'H','e','l','l','o',0 };
CString string;
for (int i = 0; array[i] != 0; i++)
string += (char)array[i]; // notice you need to type cast from int to char
|
|
|
|
|
Hmm... Sorry for posting so much code, but I need to give you all an idea of what im doing
CString toASCII(CString input)
{
int i = 0;
int int_buffer;
int int_output;
char byte_buffer;
CString output;
while(i < input.GetLength())
{
byte_buffer = input.GetAt(i);
int_buffer = byte_buffer;
output += int_buffer;
i++;
}
return output;
}
-----
What I get out is what I put in. What im trying to do is get the ASCII number value out.
I know that my problem is probably on this line: output += int_buffer;
The CString is reconizing my int as a byte, instead of a number. How can i do
int a = 132;
CString str;
str = a;
and have str contain "123"? At least i think thats where my problem is, maybe it isn't.
Thanks for all the help.
|
|
|
|
|
CString has a GetBuffer function which gives you a char*. Call ReleaseBuffer when you're done with it.
You cannot use += on a class object, unless operator + is defined. The [] operator works in a CString though.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Thats odd, += works fine... it doesnt appear to be the problem, I input "hi" it returns "hi".
I want it to return "104105" (h-104 i-105)
|
|
|
|
|
Then you should use Left() and Mid()
It's odd to me that += works, but I admit I've never tried it.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Yes, += works just fine. I use it quite often.
|
|
|
|
|
Doh. It concatenates strings. My first reading of that code made me think he was trying to do pointer arithmetic with it.
Thanks.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
try this:
int x = 123;
CString s;
s.Format("%d", x);
// now s = "123" -- this a string representation of the integer.
|
|
|
|
|
One more question (thanks, you have all been very helpful so far).
How can i do:
int x;
CString str = "5";
x = str;
and have x = 5? Is there a function that can be used to convert to a int from a CString? I assume its probably similar to the CString.Format()?
Thanks!
|
|
|
|
|
int x = atoi(str.GetBuffer(0));
|
|
|
|
|
Try this.
int x;
CString str ="5";
x = _ttoi(str);
I think there is another function like that for Unicode also but off the top of my head I can't think of it.
Cheers
|
|
|
|
|
Read the VC forum FAQ which has an entry on converting numbers to their string representations.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Out of topic.
Interesting to see someone from C# coming to C++.
Job requirements make you do this, or our of shear interest?
|
|
|
|
|
Hi!
Does anybody know if there´s a specific message I can send (using SendMessage()) to an already open Windows file Open/Save dialog telling it to change path?
I know this can be done but I´m not sure that this metod it the right (best) one.
Thanks!
/Jonatan
|
|
|
|