>// C#
>public void LoadProperty( object o ){
Log.Info( o.ToString() ); //CallPutSchedule
Log.Info( o.GetType().ToString() ); //System.String
o.GetType().GetMethods(); //Returns methods for System.String }
>Would someone be able to explain this very perplexing behavior to me?
It's not clear to me how LoadProperty is called in C# and How o.ToString is
supposed to call CallPutSchedule. Also, I am unclear on what the Interop
question is. You said it was a .NET class Convertible and you can get at it
from COM via Interop but then your question is about C# to a .NET class (no
Interop involved)? I'm confused...
---------------------------------------------------------------------
Sam Gentile
Microsoft .NET Consultant
*
Web Site:http://www.samgentile.com/
*
My O'Reilly Articles: http://www.oreillynet.com/pub/au/1070
*
Read my .NET Web Blog! http://dotnetweblogs.com/sgentile/
*
Come hear me speak at Win-Dev! http://butrain.bu.edu/windev/bios.asp
----------------------------------------------------------------
-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Akshay Arora
Sent: Wednesday, May 28, 2003 11:33 AM
To: [EMAIL PROTECTED]
Hi everyone,
(This is a repost from the CLR group, no one there had a response for
me, so hopefully someone here will)
-----------------------------
I'm having a strange problem. Let me present it:
I have a bunch of Classes in .Net (C#). Most of them are accessible via
COM (I have supplied a Guid attribute and a ClassInterface attribute).
Below is a basic structure of what I am accessing.
Class Convertible{
public CallPutSchedule CallPutSchedule{
get{ return callPutSchedule; }
set{ this.callPutSchedule = value; }
}
private CallPutSchedule callPutSchedule
}
I can get/set this property just fine.
I also have a WinForm called PropMaster which takes a given object with
some defined accessor methods (Add, Get, Remove) and properties (Count).
CallPutSchedule has these defined.
In a complex VBA Excel file (which also has it's own clsCallPutSchedule
which is used in clsInstrument which has a property CallPutSchedule,
same as in .Net), I get a problem. I can send CallPutSchedule to my
PropMaster and it will do some stuff for me and let me edit all the
objects within it very easily, but here is what happens.
'' VB
MsgBox convertible.CallPutSchedule.GetType().ToString()
''CallPutSchedule
Call propMaster.LoadProperty( convertible.CallPutSchedule )
// C#
public void LoadProperty( object o ){
Log.Info( o.ToString() ); //CallPutSchedule
Log.Info( o.GetType().ToString() ); //System.String
o.GetType().GetMethods(); //Returns methods for System.String
}
Would someone be able to explain this very perplexing behaviour to me?
Thanks,
Akshay