Article View: borland.public.cppbuilder.database.ado
Article #4007Re: Partial decision...
From: Jurko
Date: Mon, 15 Apr 2002 10:03
Date: Mon, 15 Apr 2002 10:03
66 lines
3135 bytes
3135 bytes
> {
> Properties* properties;
> Property* pr1;
> Variant propValue;
>
> properties =
> CellSet1->
> Axes->get_Item(1)->
> Positions->get_Item(0)->
> Members->get_Item(0)->
> Properties;
> pr1 = properties->get_Item(1); // This is the part that was missing!
//
> <- It will generate error!
> propValue = pr1->get_Value(); //<- It also will generate an error
> }
hmmm here my guess is you had only one item in your properties collection
and it was accessible under index 0 while tring to access a property under
index 1 was an error... if this is so then your variable name is
misleading...
shouldn't be called pr1 and mean 'property with the index 0'. But I presume
this is just quick test code, and that your production code uses variables
with more meaningful names...
> {
> Property* pr1;
> Variant propValue;
>
> pr1 = CellSet1->
> Axes->get_Item(1)->
> Positions->get_Item(0)->
> Members->get_Item(0)->
> Properties->get_Item(0); // <- It works fine:
> propValue = pr1->get_Value(); //<- But it generates an error
> }
> {
> Variant propValue;
>
> propValue = CellSet1->
> Axes->get_Item(1)->
> Positions->get_Item(0)->
> Members->get_Item(0)->
> Properties->get_Item(0)->get_Value(); // it works fine
> }
What is the type returned by
CellSet1->
Axes->get_Item(1)->
Positions->get_Item(0)->
Members->get_Item(0)->
Properties->get_Item(0);
Is it Property* ? If it is then there is NO difference in the type snippets
posted above...
One was I could see this problem happening is if you were getting
a pointer to a class derived from Property and get_Value() wasn't
a virtual function... but then again this is just a guess...
Try to separate it all into variables... and then trace through the code...
try to call some other Property methods and see if they return the
expected results... (like get_Name() perhaps?)...
HTH,
Jurko
Technical Details
Message-ID:
<vg8e9a.pgu.ln@news.ve-mil.hr>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!fu-berlin.de!newscore.univie.ac.at!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!dnews!news.ve-mil.hr!not-for-mailReferences:
<3cb5bd44$1_1@dnews> <3cb6b1c4_2@dnews> <dpn69a.c1g.ln@news.ve-mil.hr> <3cba7252$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,699ad39162d2b5f9 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-04-15 03:09:23 PST From: "Jurko" <Jurko@ve-mil.hr> Newsgroups: borland.public.cppbuilder.database.ado References: <3cb5bd44$1_1@dnews> <3cb6b1c4_2@dnews> <dpn69a.c1g.ln@news.ve-mil.hr> <3cba7252$1_1@dnews> Subject: Re: Partial decision... Date: Mon, 15 Apr 2002 12:03:22 +0200 Lines: 69 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <vg8e9a.pgu.ln@news.ve-mil.hr> NNTP-Posting-Host: 195.29.221.130 X-Trace: dnews 1018865147 195.29.221.130 (15 Apr 2002 03:05:47 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!fu-berlin.de!newscore.univie.ac.at!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!dnews!news.ve-mil.hr!not-for-mail