开发者

How to call DLL function in vbscript [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 12 years ago.

I am writing VB script in which I have to call a function of a COM DLL. The function which I want to use is in structure and t开发者_StackOverflowhus I want to create the object of that structure to access the required function.

e.g. I have a dll 'BasicCom.dll', in which

struct abc
{
    bool xyz();
} 

Now I want to call xyz(). Does anyone have any idea, how to deal with such call in Vb script?


Hans's comment is correct. This is a pure C++ method, not a method of a COM class. You cannot call it from VBScript.


Have a look at

VBScript CreateObject Function

The CreateObject function creates an object of a specified type.

Syntax

CreateObject(servername.typename[,location])  


You should to register it as COM+ component (run REGSVR32 BasicCom.dll) and do:

Set yourClass = CreateObject("BasicCom.Abc") ''// Should be ProjectName.ClassName
returnValue = yourClass.xyz()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜