Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

[carbon] GetControlByID return an unknow control code from my custom ditl

Hi,

i’m trying to understand why GetControlByID return -30584 while i’m find a
progress bar item in a ressourse based DITL.

i’m find to get the item number and set it to a new value.

the item number is rigth, is set to 1, but for the famous signature , hmmmm, i’m not

the ditl have 10 elments

the CountDITL(theDialog); return is ok

const ControlID         kLargeCheck                     = { ‘PROG’, 1 };

  theDialog = GetNewDialog(1000,NULL, (WindowPtr)-1);

cout << "\n count : " <<

SetRect(&contentBounds, 10, 50, 400, 400);

        if(!theDialog)
        return 0;

int err = GetControlByID( GetDialogWindow(theDialog), &kLargeCheck, &control );
cout<< "\n err : "<<err;
if(control){
SetControlValue( control, GetControlValue( control ) +GetControlValue( control ) );

}else{

SysBeep(50);

}

thanks to all
sebastien

.
posted by admin in Uncategorized and have Comment (1)

One Response to “[carbon] GetControlByID return an unknow control code from my custom ditl”

  1. admin says:

    In article <41b9f010$0$29992$8fcfb…@news.wanadoo.fr>,

     sebosac <sebo…@wanadoo.fr> wrote:
    > i’m trying to understand why GetControlByID return -30584 while i’m find a
    > progress bar item in a ressourse based DITL.

    > i’m find to get the item number and set it to a new value.

    > the item number is rigth, is set to 1, but for the famous signature , hmmmm,
    > i’m not

    Control IDs are completely unrelated to DITL item numbers. You need to use
    GetDialogItemAsControl.

    hth

    meeroh


    If this message helped you, consider buying an item
    from my wish list: <http://web.meeroh.org/wishlist&gt;