Thread View: pilot.programmer.codewarrior
3 messages
3 total messages
Started by John Shehata
Fri, 27 Jul 2001 01:22
StrCopy is breaking my Popup Trigger
Author: John Shehata
Date: Fri, 27 Jul 2001 01:22
Date: Fri, 27 Jul 2001 01:22
164 lines
7532 bytes
7532 bytes
This is a multi-part message in MIME format.
------=_NextPart_000_0063_01C11619.19F89700
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi all,
I have been having one heck of a time working with my popup triggers. I =
have a problem and i have narrowed it down to my StrCopy function to get =
the label. What it does is it seems to make my trigger inoperable. Once =
it is set, if you click on the trigger on my form, it doesn't popup. =
Nothing happens really, it just blinks.
My trigger works fine if i do not try to set a value for it when the =
form is being initialized. The code that is causing a problem is as =
follows...
// loading the data into my list
stringH =3D DmGetResource('tAIS', DueDtAppInfoStr);
duedt =3D (char *) MemHandleLock(stringH);
acnoholds =3D SysFormPointerArrayToString(duedt, 4);
listP =3D /*(ListPtr)*/ GetObjectPtr(frmPrefsDueDtListList);
LstSetListChoices(listP, (char **)MemHandelLock(acnoholds), 4);
ctlP =3D GetObjectPtr(frmPrefsDueDtTriggerPopTrigger);
//setting the item i want based on a preffernece that is contained
//within index (currently set to 1)
LstSetSelection(listP, index);
LabelP =3D (char *) CtlGetLabel(ctlP);
//here is the line that i know is causing the problem. I know this =
because if i do
//not copy the string this works fine, i just don't have this item =
displayed.
StrCopy(labelP, LstGetSelectionText(listP, LstGetSelection(listP)));
CtlSetLabel(ctlp, labelP);
I know that all of this code compiles and runs so if i made an error =
typing it in here just ignore it.
Any help on this would be greatly appreciated.
--=20
-John
AOL IM: tut00
ground-0-zero software engineering
http://www.ground-0-zero.com
------=_NextPart_000_0063_01C11619.19F89700
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>Hi =
all,</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>I have been =
having one heck=20
of a time working with my popup triggers. I have a problem and i have =
narrowed=20
it down to my StrCopy function to get the label. What it does is it =
seems to=20
make my trigger inoperable. Once it is set, if you click on the trigger =
on my=20
form, it doesn't popup. Nothing happens really, it just =
blinks.</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>My trigger =
works fine if i=20
do not try to set a value for it when the form is being initialized. The =
code=20
that is causing a problem is as follows...</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>// loading =
the data into my=20
list</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>stringH =3D=20
DmGetResource('tAIS', DueDtAppInfoStr);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>duedt =3D =
(char *)=20
MemHandleLock(stringH);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>acnoholds =3D =
SysFormPointerArrayToString(duedt, 4);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>listP =3D =
/*(ListPtr)*/=20
GetObjectPtr(frmPrefsDueDtListList);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2>LstSetListChoices(listP,=20
(char **)MemHandelLock(acnoholds), 4);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>ctlP =3D=20
GetObjectPtr(frmPrefsDueDtTriggerPopTrigger);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>//setting the =
item i want=20
based on a preffernece that is contained</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>//within =
index (currently=20
set to 1)</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2>LstSetSelection(listP,=20
index);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>LabelP =3D =
(char *)=20
CtlGetLabel(ctlP);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>//here is the =
line that i=20
know is causing the problem. I know this because if i do</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>//not copy =
the string this=20
works fine, i just don't have this item displayed.</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2>StrCopy(labelP,=20
LstGetSelectionText(listP, LstGetSelection(listP)));</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2>CtlSetLabel(ctlp,=20
labelP);</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>I know that =
all of this=20
code compiles and runs so if i made an error typing it in here just =
ignore=20
it.</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 =
size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2>Any help on =
this would be=20
greatly appreciated.</FONT></DIV>
<DIV><FONT face=3D"Comic Sans MS" color=3D#000080 size=3D2><BR>-- =
<BR>-John<BR>AOL IM:=20
tut00<BR>ground-0-zero software engineering<BR><A=20
href=3D"http://www.ground-0-zero.com">http://www.ground-0-zero.com</A></F=
ONT></DIV></BODY></HTML>
------=_NextPart_000_0063_01C11619.19F89700--
Re: StrCopy is breaking my Popup Trigger
Author: Ben Combee
Date: Fri, 27 Jul 2001 04:48
Date: Fri, 27 Jul 2001 04:48
62 lines
3388 bytes
3388 bytes
John
1) Please post here using plain text -- its hard to quote messages
written in HTML.
2) I think your problem is the original label to which you set the popup
trigger. You need to make sure the label you give it in Constructor is
at least as large as what you're copying in, or you will overwrite data
beyond the control.
3) Perhaps you should use CtlSetLabel, which just changes the embedded
pointer. Then, you could have it point into the same string resource
and avoid the copy which may be corrupting your form.
"John Shehata" <jshehata@ground-0-zero.comNOJUNK> wrote in message
news:XfTJFrjFBHA.2432@server2.massena.com...
Hi all,
I have been having one heck of a time working with my popup triggers. I
have a problem and i have narrowed it down to my StrCopy function to get
the label. What it does is it seems to make my trigger inoperable. Once
it is set, if you click on the trigger on my form, it doesn't popup.
Nothing happens really, it just blinks.
My trigger works fine if i do not try to set a value for it when the
form is being initialized. The code that is causing a problem is as
follows...
// loading the data into my list
stringH = DmGetResource('tAIS', DueDtAppInfoStr);
duedt = (char *) MemHandleLock(stringH);
acnoholds = SysFormPointerArrayToString(duedt, 4);
listP = /*(ListPtr)*/ GetObjectPtr(frmPrefsDueDtListList);
LstSetListChoices(listP, (char **)MemHandelLock(acnoholds), 4);
ctlP = GetObjectPtr(frmPrefsDueDtTriggerPopTrigger);
//setting the item i want based on a preffernece that is contained
//within index (currently set to 1)
LstSetSelection(listP, index);
LabelP = (char *) CtlGetLabel(ctlP);
//here is the line that i know is causing the problem. I know this
because if i do
//not copy the string this works fine, i just don't have this item
displayed.
StrCopy(labelP, LstGetSelectionText(listP, LstGetSelection(listP)));
CtlSetLabel(ctlp, labelP);
I know that all of this code compiles and runs so if i made an error
typing it in here just ignore it.
Any help on this would be greatly appreciated.
--
-John
AOL IM: tut00
ground-0-zero software engineering
http://www.ground-0-zero.com
Re: StrCopy is breaking my Popup Trigger
Author: John Shehata
Date: Fri, 27 Jul 2001 11:48
Date: Fri, 27 Jul 2001 11:48
74 lines
3712 bytes
3712 bytes
Thanks for the tip. I will also post here using Plain Text from now on.
--
-John
AOL IM: tut00
ground-0-zero software engineering
http://www.ground-0-zero.com
"Ben Combee" <combee@techwood.org> wrote in message
news:9jqrqi$gui$1@zappa.falch.net...
> John
>
> 1) Please post here using plain text -- its hard to quote messages
> written in HTML.
>
> 2) I think your problem is the original label to which you set the popup
> trigger. You need to make sure the label you give it in Constructor is
> at least as large as what you're copying in, or you will overwrite data
> beyond the control.
>
> 3) Perhaps you should use CtlSetLabel, which just changes the embedded
> pointer. Then, you could have it point into the same string resource
> and avoid the copy which may be corrupting your form.
>
> "John Shehata" <jshehata@ground-0-zero.comNOJUNK> wrote in message
> news:XfTJFrjFBHA.2432@server2.massena.com...
> Hi all,
>
> I have been having one heck of a time working with my popup triggers. I
> have a problem and i have narrowed it down to my StrCopy function to get
> the label. What it does is it seems to make my trigger inoperable. Once
> it is set, if you click on the trigger on my form, it doesn't popup.
> Nothing happens really, it just blinks.
>
> My trigger works fine if i do not try to set a value for it when the
> form is being initialized. The code that is causing a problem is as
> follows...
>
> // loading the data into my list
> stringH = DmGetResource('tAIS', DueDtAppInfoStr);
> duedt = (char *) MemHandleLock(stringH);
>
> acnoholds = SysFormPointerArrayToString(duedt, 4);
>
> listP = /*(ListPtr)*/ GetObjectPtr(frmPrefsDueDtListList);
> LstSetListChoices(listP, (char **)MemHandelLock(acnoholds), 4);
> ctlP = GetObjectPtr(frmPrefsDueDtTriggerPopTrigger);
>
> //setting the item i want based on a preffernece that is contained
> //within index (currently set to 1)
> LstSetSelection(listP, index);
>
> LabelP = (char *) CtlGetLabel(ctlP);
>
> //here is the line that i know is causing the problem. I know this
> because if i do
> //not copy the string this works fine, i just don't have this item
> displayed.
> StrCopy(labelP, LstGetSelectionText(listP, LstGetSelection(listP)));
> CtlSetLabel(ctlp, labelP);
>
>
> I know that all of this code compiles and runs so if i made an error
> typing it in here just ignore it.
>
> Any help on this would be greatly appreciated.
>
> --
> -John
> AOL IM: tut00
> ground-0-zero software engineering
> http://www.ground-0-zero.com
>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads