BCB6中没有IStrings类型?

lenyunzi 2009-07-06 11:40:28
BCB6中没有IStrings ?

使用MIDAS定制接口方法时,主菜单 View-->Type Library中添加接口方法,参数中没有了IStrings类型。

而在..\Borland\CBuilder6\Examples\Midas\Adhoc的adhcsrvr.bpr工程中却有。经编译后发现图标是CB5的。

既然BCB6打开CB5的工程都能使用IStrings类型,那么CB6应该有IStrings类型,要如何才能在CB6中启用IStrings类型?
...全文
54 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
fxworld 2009-07-07
  • 打赏
  • 举报
回复
在 Type Library Editor 中选择类型库,然后在右边Uses标签下点鼠标右键,在弹出菜单中选 View All Type libaries,

然后在 Type libary 列表中选择 Borland standard vcl type libary.
fxworld 2009-07-07
  • 打赏
  • 举报
回复
在你的例子中,bcb6编译时要做类型转换的地方

AdhcServ->GetDBNames( (IStrings**)Value );
fxworld 2009-07-07
  • 打赏
  • 举报
回复
在你说的列子中:

在:adhcsrvr_TLB.h有如下说明

// *********************************************************************//
// Forward reference of some VCL types (to avoid including STDVCL.HPP)
// *********************************************************************//
namespace Stdvcl {class IStrings; class IStringsDisp;}
using namespace Stdvcl;
typedef TComInterface<IStrings> IStringsPtr;
typedef TComInterface<IStringsDisp> IStringsDispPtr;




在bcb6 的Include\\vcl下的STDVCL.HPP 中找到:IStrings

__interface IStrings;
typedef System::DelphiInterface<IStrings> _di_IStrings;
__interface INTERFACE_UUID("{EE05DFE2-5549-11D0-9EA9-0020AF3D82DA}") IStrings : public IDispatch
{

public:
OleVariant operator[](int Index) { return ControlDefault[Index]; }

public:
virtual HRESULT __safecall Get_ControlDefault(int Index, OleVariant &Get_ControlDefault_result) = 0 ;
virtual HRESULT __safecall Set_ControlDefault(int Index, const OleVariant Value) = 0 ;
virtual HRESULT __safecall Count(int &Count_result) = 0 ;
virtual HRESULT __safecall Get_Item(int Index, OleVariant &Get_Item_result) = 0 ;
virtual HRESULT __safecall Set_Item(int Index, const OleVariant Value) = 0 ;
virtual HRESULT __safecall Remove(int Index) = 0 ;
virtual HRESULT __safecall Clear(void) = 0 ;
virtual HRESULT __safecall Add(const OleVariant Item, int &Add_result) = 0 ;
virtual HRESULT __safecall _NewEnum(System::_di_IInterface &_NewEnum_result) = 0 ;
#pragma option push -w-inl
/* safecall wrapper */ inline OleVariant _scw_Get_ControlDefault(int Index) { OleVariant r; HRESULT hr = Get_ControlDefault(Index, r); System::CheckSafecallResult(hr); return r; }
#pragma option pop
__property OleVariant ControlDefault[int Index] = {read=_scw_Get_ControlDefault, write=Set_ControlDefault/*, default*/};
#pragma option push -w-inl
/* safecall wrapper */ inline OleVariant _scw_Get_Item(int Index) { OleVariant r; HRESULT hr = Get_Item(Index, r); System::CheckSafecallResult(hr); return r; }
#pragma option pop
__property OleVariant Item[int Index] = {read=_scw_Get_Item, write=Set_Item};
};


所以在bcb6下完全可以使用。参数中只是没有显示 IStrings 类型。
jaffy 2009-07-06
  • 打赏
  • 举报
回复
markmark
jaffy 2009-07-06
  • 打赏
  • 举报
回复
mark
fairchild811 2009-07-06
  • 打赏
  • 举报
回复
是不是可以#include "IString.hpp"
xjq2003 2009-07-06
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 nbzip 的回复:]
你看一下 utilcls.h 好像,把IStrings定义是个类.

用于TComInterface接口.

IStringsPtr 一般都用这个指向TComInterface

===========================================================
Stdvcl::IStrings *a=new Stdvcl::IStrings;
a->Clear();
delete a;
a=NULL;
[/Quote]测试一下吧
nbzip 2009-07-06
  • 打赏
  • 举报
回复
学习C语言,最重要的是追踪溯源........把包来包去的文件,用灵敏的鼻子去找出来.

:>

祝楼主好运!
nbzip 2009-07-06
  • 打赏
  • 举报
回复
你看一下 utilcls.h 好像,把IStrings定义是个类.

用于TComInterface接口.

IStringsPtr 一般都用这个指向TComInterface

===========================================================
Stdvcl::IStrings *a=new Stdvcl::IStrings;
a->Clear();
delete a;
a=NULL;
nbzip 2009-07-06
  • 打赏
  • 举报
回复
IStrings 没用到过.不太理解该函意.

一般来说前一个版本有的,后一个版本应该是支持的.
lenyunzi 2009-07-06
  • 打赏
  • 举报
回复
高手帮忙下吧

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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