🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pilot.programmer.codewarrior
Article #53

Re: StrCopy is breaking my Popup Trigger

#53
From: John Shehata
Date: Fri, 27 Jul 2001 11:48
74 lines
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
>
>
>
Technical Details
Message-ID: <lu11JIpFBHA.3472@server2.massena.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!news-out.nibble.net!news-in.nibble.net!telocity-west!TELOCITY!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!server2.massena.com
References: <XfTJFrjFBHA.2432@server2.massena.com> <9jqrqi$gui$1@zappa.falch.net>

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-27 05:03:43 PST
From: "John Shehata" <jshehata@ground-0-zero.comNOJUNK>
References: <XfTJFrjFBHA.2432@server2.massena.com> <9jqrqi$gui$1@zappa.falch.net>
Subject: Re: StrCopy is breaking my Popup Trigger
Date: Fri, 27 Jul 2001 07:48:15 -0400
Lines: 76
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
Message-ID: <lu11JIpFBHA.3472@server2.massena.com>
Newsgroups: pilot.programmer.codewarrior,pilot.programmer,codewarrior.palm
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!news-out.nibble.net!news-in.nibble.net!telocity-west!TELOCITY!enews.sgi.com!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!server2.massena.com
NNTP-Posting-Host: 206.232.172.20