Hy!
The problem, is that I tried everything I could to convert. The following examples are already useless:
//Example 1:
CString text;
char *ch_text = new char[text.GetLength( )+1];
strcpy(ch_text, text);
//Example 2:
CString text;
char *ch_text = text.GetBuffer( );
///some code////
text.ReleaseBuf fer();
//Example 3:
CString...
User Profile
Collapse
-
How to do CString to char * convertion ???
-
I found something and it works, but I don't know exactly if it is correct to use:
if I typecast the hex, I don't have any problem ( winStr=(char)0x 0D ). -
Nope!
If I try:
if(t[0]==0x0A)
{}
it works!
So the problem is not there.
And btw t is a reference variable.
i will paste my code to show you the exact function.
void CRSADlg::WriteO nScreen(CEdit t, CString &str)
{
CString winStr;
t.GetWindowText W(winStr);
t.SetSel(winStr .GetLength(),wi nStr.GetLength( ));
winStr="";...Leave a comment:
-
MFC CString problem
To get the proper idea of my problem, I think it would be best to show you a part of my code:
void some_function(C Edit x, CString t)
{
CString w;
//some code
if ( t[0] == 0x0A)
w=0x0D; //this is the line where I get the error
}
When I try to compile the code, I get the error:
"error C2593: 'operator =' is... -
Thanks a lot guys. I guess I have some points of start in continuing my work. If any of you knows another solution besides inserting a field in structure, e.g. using some special function or creating another test variable, then please tell me. As I said I need the most efficient way in this matter.
Thank you again!Leave a comment:
-
How can I test if a value is assigned ?
I have a problem in my code.
Let's say we have a variable named X, and X must be tested if any value is assigned to it, and if not, then X is assigned.
I need to tell you that X is in fact a structure and I thought that the easiest way to do the test is to insert another field:
typedef struct X
{
field 1;
field 2;
int test; ->>the test variable, which is 0 if X.field_1 is not assigned...
No activity results to display
Show More
Leave a comment: