Hi Jeremy,

I assume that cmbReadonly is the same as Combo?
Have you checked the value of ItemIndex and the Count of items in the
combo?
Have you tried adding one object to the combo and then retrieving it and
verifying that the pointer returned is the same as what you stored?

Regards,

Bevan


[EMAIL PROTECTED] wrote:
> 
> HI all.
> 
> I am wanting to add an integer to an Item in a combobox as I add the item.
> 
>  (I am using a pointer to a record here too, and the only item in the record is ID 
>:Integer)
> 
>  Combo.Items.Add(rs.rdoColumns[1]);
> 
>  New(pNewRec);
>  pNewRec^.ID:=rs.rdoColumns[0];
>  Combo.Items.AddObject('id',TObject(pNewRec));
> 
> this seems ok, BUT when I do the following
> 
>   ll_Provider:=pRec(cmbReadonly.items.Objects[cmbReadonly.ItemIndex])^.ID;
> 
> if I do this, I get an Access violation.....can anyone see what I am doing 
>worng....OR suggest a better wat to do it ?
> 
> Cheers, Jeremy Coulter
> 
> 
> 
> 
> Jeremy Coulter (Manager)
> Visual Software Solutions
> Christchurch, New Zealand
> PH 03-3521595
> FAX 03-3521596
> MOBILE 021-2533214
> www.vss.co.nz
> 
> ---------------------------------------------------------------------------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"

-- 
Bevan Edwards                           mailto:[EMAIL PROTECTED]
Achieve Software Limited                http://www.achieve.co.nz
Phone:  (64-9) 444-4210                 ICQ: 732011
Fax:    (64-9) 444-4201
Mobile: (64-21) 979-603
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to