裸体跪求solution!

Microsoftadherent 2004-04-26 04:04:54
各位高手,我现在遇到一个问题,我用ATL做了个集合,打算在C#中使用,集合中包括三个属性:
interface ICol : 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);
};
但是在C#中使用时,只有Count属性可见外,其他属性都不可见,而在VB或者VB。NET中没有此类问题,我该如何做?
。。。。。。
如果谁能告诉我在C#中使用这些属性的方法,什么条件我都。。。答应,200分和我的一个KISS奉上
...全文
25 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
Microsoftadherent 2004-04-28
  • 打赏
  • 举报
回复
结贴了!
PiggyXP 2004-04-27
  • 打赏
  • 举报
回复
友情up

顺便笑话wangweixing2000(星) ,笑死了:D
PiggyXP 2004-04-27
  • 打赏
  • 举报
回复
友情up了
顺便笑话wangweixing2000(星) ,笑死了:D
yaoyuhang 2004-04-27
  • 打赏
  • 举报
回复
把 _NewEnum 改成 NewEnum

vb中不支持_开头.
Microsoftadherent 2004-04-27
  • 打赏
  • 举报
回复
It probably *is* working OK. The underscore is usually interpreted by the
development environment to mean the method won't show up in IntelliSense,
etc. In C#, the Item property will be used when you index the property e.g.
myTestWords[0] = "Hello";
myTestWords[1] = "World";
The _NewEnum property will be called by a "for each"-style loop.

这是从老外那里得到的!
http://www.fuzzysoftware.com/
欢迎大家去啊!
Microsoftadherent 2004-04-26
  • 打赏
  • 举报
回复
我的枚举器接口是IEnumVARIANT,枚举器用的是CComEnumOnSTL来实现的,现在的问题是当我在C#下,我无法看到那两个方法,没有提示。我强行的调用,编译时告诉我这个方法不存在。我用微软给的集合的例子,同样出现这样的问题!!!!
多谢楼上的,估计楼上的哥们一定是个怕老婆的,连上网的时候都会想着老婆呢,呵呵
ayqlj 2004-04-26
  • 打赏
  • 举报
回复
关注
wangweixing2000 2004-04-26
  • 打赏
  • 举报
回复
是老兄!我写错了!抱歉!哈哈!
wangweixing2000 2004-04-26
  • 打赏
  • 举报
回复
好了!老婆兄我做了个测试可以用呀!
[propget, id(2), helpstring("属性 MyInterface")] HRESULT MyInterface([out, retval] IUnknown** pVal);
[propput, id(2), helpstring("属性 MyInterface")] HRESULT MyInterface([in] IUnknown* newVal);
[propget, id(3), helpstring("属性 MyVariant")] HRESULT MyVariant([in] LONG index, [out, retval] VARIANT* pVal);
[propput, id(3), helpstring("属性 MyVariant")] HRESULT MyVariant([in] LONG index, [in] VARIANT newVal);

C#端
private void Form1_Load(object sender, System.EventArgs e)
{
axCSelection21.MyInterface(m_IXXX);
axCSelection21.get_MyVariant(1);
}
哈哈!
wangweixing2000 2004-04-26
  • 打赏
  • 举报
回复
不太懂c#!帮你up
zhp80 2004-04-26
  • 打赏
  • 举报
回复
你的枚举器和枚举接口是怎么定义的,贴出来
我估计是枚举类型有问题
Microsoftadherent 2004-04-26
  • 打赏
  • 举报
回复
我的那个KISS只奉献给女士,男式们就免了,补充。

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧