Hi Jon
Well, I've been around and around this all day yesterday but still can't
get anywhere with it !!
It's driving me nuts!
Can someone point me at some reference reading material to really
understand the issues involved here or any examples of passing objects
around.
I also getting really confused with what is available within the scope
etc
I guess I just missed something!
Best regards,
Roger
-----Original Message-----
From: Jon Skeet [C# MVP] [mailto:sk***@pobox.com]
Posted At: 04 August 2004 12:28
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: Can't reference Object properties
Subject: Re: Can't reference Object properties
Roger Maynard <ro***@crayford.ltd.uk> wrote:
<snip>
Also, how would I add code after the call to return the object, which
references the properties of the newly created object?
ie
object ret_obj = testmyClass.SalesRecordRead("A&B");
string AcRef = ret_obj.szRefn;
If I do the above, then the compiler bitches about ret_obj as
undefined, etc.
Yes, it would - it only knows that ret_obj is a reference to an
instance of object or a subtype. Object itself doesn't have a szRefn
member. You need to declare ret_obj to be of type SalesHeader, and
declare SalesRecordRead to return that, too.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too