Stuffing too many characters into a char array is one common reason.  Try:

 myConNameP = (CharPtr)MemPtrNew(cncProfileNameSize+1);            // 1
added to accommodate for NULL

----- Original Message -----
From: "Gearoid Murphy" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, May 17, 2002 4:51 AM
Subject: bus error in Emulator when adding Connection profile


> Can anyone tell me why the following code would cause a bus error in POSE
> when the added connection is viewed in the Connection Preferences Panel.
The
> AddMyProfile function is taken directly from the documentation on
> CncAddProfile in the kb.
>
> // found in documentation for CncAddProfile
> void AddMyProfile()
> {
>   CharPtr myConNameP;
>   Err err;
>   myConNameP = (CharPtr)MemPtrNew(cncProfileNameSize);
>   StrCopy(myConNameP, "Foobar");
>   err = CncAddProfile(myConNameP, 'u328', 57600,
>   0, 0, "AT&FX4", 0, true, false);
>   MemPtrFree(myConNameP);
> }
>
> // and later use AddMyProfile to add connection
> case ctlSelectEvent:
> if (eventP->data.ctlSelect.controlID == MainAddConnectionButton)
> {
>   AddMyProfile();
>   Handled=true;
> }
> break;
>
> The new connection seems to be successfully added on the device but the
bus
> error occurs in POSE. To be more specific the bus error occurs when the
> 'Details.' button is tapped (i.e. the connection details form displaying
the
> speed and flow control  cannot be viewed).
> Regards,
> Ger
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to