Page 1 of 4

BUG in _CXSTR ... someplace

Posted: Fri Oct 31, 2003 10:51 pm
by MacroFiend
When trying to read the data from the Text member, you only get 1 character. To see an example of this, rename your MQChat window. It will only save 1 character to the INI file.

If you change your INI to have a full name, it will load the whole thing.

I have no idea how to get the struct to be dynamic based on MaxLength for the Text field ... but I'm pretty sure that is where the problem is.

Code: Select all

//5-15-2003   eqmule 
typedef struct _CXSTR {
/*0x00*/   DWORD   Font;            // maybe, dont know.  04 = Window 01 = button
/*0x04*/   DWORD   MaxLength;
/*0x08*/   DWORD   Length;
/*0x0c*/   BOOL    Encoding; // 0: ASCII, 1:Unicode 
/*0x10*/   PCRITICAL_SECTION pLock;
[color=cyan]/*0x14*/   CHAR    Text[1]; // Stub, can be anywhere from Length to MaxLength (which is how much is malloc'd to this CXStr) [/color]
} CXSTR, *PCXSTR;

Posted: Fri Oct 31, 2003 11:00 pm
by Ohmz
It probably has a constructor that does this

Posted: Sat Nov 01, 2003 12:04 am
by Plazmic
The struct definition is correct. The save code may be bugged though.

Posted: Tue Nov 04, 2003 5:13 pm
by Lax
Oh.. yeah the bug with this is most likely unicode string :) Making a function to grab the text correctly now.

Posted: Tue Nov 04, 2003 9:38 pm
by Plazmic
I have that function written... it's used in the editmacro saving...

Posted: Tue Nov 04, 2003 9:43 pm
by Lax
Didn't see it. Oh well, GetCXStr(PCXSTR pCXStr,PCHAR buffer, DWORD maxlen=MAX_STRING);

is in CVS

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:42 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:43 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:44 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:45 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:46 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:47 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:49 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:50 am
by xyilla

Re: BUG in _CXSTR ... someplace

Posted: Mon Sep 29, 2025 8:51 am
by xyilla