How to call DLL function in vbscript [closed]
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()
精彩评论