Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Thu, 8 Dec 2005 07:29:46 -0800,    group: microsoft.public.platformsdk.com_ole        back       


Accessing OLE Object properties from C#   
Hi there,

I am trying to use a COM object (written in C++) from an Excel add-in in C#.
So far, in every directions I looked, I have been unable to access the
properties of my COM component. Here is what I did:

- use Interop conversion
- instantiate the class
- try to access the properties (which are visible for Intellisence) ->
exception "catastrophic error"
- get the list of properties (by gettting the Type and calling
GetProperties), my properties are visible, use InvokeMember to set or get my
properties: an exception is thrown.

My COM component is valid (very simple, and visible from Excel throught the
"More Control" option of the toolbox. When I instantiate the component this
way, the properties are visible and accessible (i.e. I can modify them)
through the property panel of my OLEObject.

I am quite conviced this is possible, and that I am missing something
obvious. Any guess?

Thanks,

Marc
date: Thu, 8 Dec 2005 07:29:46 -0800   author:   Marc

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us