如何使用Dll动态创建的对象?

酷心 2014-01-09 11:23:55
最近在看一个代码编辑控件Scintilla,DLL是SciLexer.dll(不需要注册),其中看到一个SCI_CREATELOADER后台加载文件,意思好像是创建了一个具有ILoader接口的对象,返回值是看起来像是指向该对象的指针,每次都不同,它的原文如下:
Loading in the background

An application can load all of a file into a buffer it allocates on a background thread and then add the data in that buffer into a Scintilla document on the user interface thread. That technique uses extra memory to store a complete copy of the file and also means that the time that Scintilla takes to perform initial line end discovery blocks the user interface.

To avoid these issues, a loader object may be created and used to load the file. The loader object supports the ILoader interface.

SCI_CREATELOADER(int bytes)
Create an object that supports the ILoader interface which can be used to load data and then be turned into a Scintilla document object for attachment to a view object. The bytes argument determines the initial memory allocation for the document as it is more efficient to allocate once rather than rely on the buffer growing as data is added. If SCI_CREATELOADER fails then 0 is returned.

ILoader
class ILoader {
public:
virtual int SCI_METHOD Release() = 0;
// Returns a status code from SC_STATUS_*
virtual int SCI_METHOD AddData(char *data, int length) = 0;
virtual void * SCI_METHOD ConvertToDocument() = 0;
};
来自:http://www.scintilla.org/ScintillaDoc.html

我想问在VB6.0中如何使用该对象,CopyMemory?但是不知道该对象的长度如何确定。像这种dll自己创建的对象并提供了一个指针该如何使用该对象呢?各位帮帮忙,感激不尽!
...全文
291 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

863

社区成员

发帖
与我相关
我的任务
社区描述
VB COM/DCOM/COM+
c++ 技术论坛(原bbs)
社区管理员
  • COM/DCOM/COM+社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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