May 03, 2024, 12:12:45 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


GetText() drops character

Started by Bruce Peaslee, January 06, 2006, 09:43:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruce Peaslee

It appears that:

pControl = GetControl(txtD1Owner1);
Lot.Owner1 = pControl->GetText();

misses the last character in the edit control.

As I test, I tried this, which works:

Lot.Owner1 = *(CEdit)pControl.GetLine(0);

Although there is only 1 line.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

Ionic Wind Support Team

LarryMc

Fundamental question for dummy:

QuoteLot.Owner1 = pControl->GetText();

Lot.Owner1 = *(CEdit)pControl.GetLine(0);

Can someone please tell me (in dumbese) what the right side of the eqaul sign is telling me in each case?
And type real slow!
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bruce Peaslee

January 06, 2006, 03:00:44 PM #3 Last Edit: January 06, 2006, 03:07:17 PM by peaslee
It's my code, so I'll give it a try.

The code is incomplete, but was enough for Paul to see the problem. This comes first:

pControl = GetControl(txtD1Owner1);

and provides the pointer to an edit control. ("txtD1Owner1" is my naming convention for a "text box" in dialog D1 for variable Owner1. I never use just numbers.) Once you have the pointer to the control

pControl->GetText();   // pointer function call syntax

gives you the text in it. Since there was a bug in the subroutine, I used:

*(CEdit)pControl.GetLine(0);

instead. I'm not sure why the syntax for derefencing is different, but I guess it has something to do with where the function is defined. This function is supposed to give you a specific line in a multi-line control (starting at zero), but it worked for what I needed to do while Paul does the fix.

Sorry, but I can't type any slowerÂÃ,  ;)

Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

*x.y is equivalent to x->y, but Aurora has some bugs at the moment that don't allow you to use the -> operator since it doesn't remember the type of the pointer.

Bruce Peaslee

Quote from: Parker on January 06, 2006, 03:10:08 PM
*x.y is equivalent to x->y, but Aurora has some bugs at the moment that don't allow you to use the -> operator since it doesn't remember the type of the pointer.
Thanks. I was worried about my lack of understanding. A bug is not the first thing you think of when dealing with Paul's work.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Ionic Wind Support Team

Actually it does allow it.

CControl *pControl;
CEdit *pEdit = GetControl(txtD1Owner1);
Lot.Owner1 = pEdit->GetLine(0);

See the difference ;)
Ionic Wind Support Team

Bruce Peaslee

It does. Easier to read (and type).
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

I was referring to the fact that there were a couple of times when it doesn't work, I think I found them in function calls and when using arrays. For example (not quite sure if it's right though):
DoWork(item->data[1]);

Ionic Wind Support Team

They should have all been working in the last update.
Ionic Wind Support Team