Article View: pilot.programmer.codewarrior
Article #52Re: StrCopy is breaking my Popup Trigger
From: 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
Technical Details
Message-ID:
<9jqrqi$gui$1@zappa.falch.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!server2.massena.com!news.falch.net!not-for-mailReferences:
<XfTJFrjFBHA.2432@server2.massena.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d41,cb37c6ec4e8d9f23 X-Google-Attributes: gid109d41,public X-Google-Thread: 10c638,cb37c6ec4e8d9f23 X-Google-Attributes: gid10c638,public X-Google-Thread: 10baa0,cb37c6ec4e8d9f23 X-Google-Attributes: gid10baa0,public X-Google-ArrivalTime: 2001-07-26 22:10:31 PST From: "Ben Combee" <combee@techwood.org> Subject: Re: StrCopy is breaking my Popup Trigger Date: Thu, 26 Jul 2001 23:48:51 -0500 Organization: Falch.net as Lines: 65 Message-ID: <9jqrqi$gui$1@zappa.falch.net> References: <XfTJFrjFBHA.2432@server2.massena.com> X-Complaints-To: usenet@zappa.falch.net NNTP-Posting-Date: 27 Jul 2001 04:48:18 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Newsgroups: pilot.programmer.codewarrior,pilot.programmer,codewarrior.palm Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!server2.massena.com!news.falch.net!not-for-mail NNTP-Posting-Host: zappa.falch.net 193.69.105.131