hi,trouble by using com in C#

W

wangwanxin1

hi,everyone,I devloped a com with ATL,and prepare to use it in C#,that interface defination as below:
interface ITestWords : IDispatch{
[id(DISPID_NEWENUM), propget] HRESULT _NewEnum([out, retval] IUnknown** ppUnk);
[id(DISPID_VALUE), propget] HRESULT Item([in] long Index,[out, retval] VARIANT* pVal);
[id(0x00000001), propget] HRESULT Count([out, retval] long * pVal);
};
but only method count can be shown in C#,the others can't,and in VB or VB.NET,it worked correctly.
How can I get the reason? how can I settle this problem? thanx so much,waiting on line!

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
M

Mattias Sjögren

but only method count can be shown in C#,the others can't,and in VB or VB.NET,it worked correctly.
How can I get the reason? how can I settle this problem? thanx so much,waiting on line!

The Item property is probably translated to an indexer for C#, so you
access it with indexing syntax (obj[index] rather than
obj.Item(index)).



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top