Calling methods of a C++ dll from VBscript

sattu

Newcomer
Joined
Mar 30, 2012
Hi Everyone,

Basically I want to call methods of my C++ dll from VBscript. I searched for it in google, but everywhere I got solutions regarding .net dll rather than c++ dlls.

An example of one of my C++ methods is:

Code:
extern "C" __declspec(dllexport) int __cdecl test()
{
return 20;
}

Now, i want to call this method 'test' from a VBscript. I would really be grateful if I would get some help regarding this.

Thanks in advance,
sattu
 

snarfblam

Ultimate Contributor
Joined
Jun 10, 2003
Location
USA
From what I understand the short answer is you can't do that.

There are some workarounds, but I have no experience with these solutions. Apparently there are third-party COM components designed for calling native DLLs. You can also create your own COM wrapper with VB6 or .NET that you can then call from VBscript. One way or another you'll need a middle layer that can work with both VBscript and native code.
 
Top Bottom