Forum Discussion
Hello Rob,
Please make sure that the routines in your DLL match the stdcall calling convention. If this does not help, please send our Support Team a sample DLL demonstrating the problem. This would help us analyze and reproduce the problem.
Also, though the script extension engine does not currently support working with DLLs via the DLL object, we have a corresponding suggestion registered in our database, and your interest in this issue has increased its rating.
I also looked into trying to use the AppDomain() approach, which needs an EXE to wrap calls to the DLL. There are no examples about how to do that. What should the EXE code look like? Which template should be used for it?
To use the AppDomain approach, you need to create an executable that loads your DLL in the application domain. For example, if you use C#, consider the following sample code:
using System.Reflection;
namespace Sample
{
public void Main()
{
Assembly SampleAssembly = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory + "Sample.dll");
}
}
For more information on loading DLLs, please refer to the MSDN Library.
How does one start the EXE from an extension?
Since the script extension engine does not provide any straightforward way to start an executable, you can use the following workaround:
AppPath = "C:\\WorkFolder\\Example.exe";
WSH = new ActiveXObject("WScript.Shell");
WSH.run(AppPath);
Note that instead of the hard-coded path to the application, you can use user forms to specify it. To learn more about forms in script extensions, please see the Using Forms in Script Extensions Help topic.
Thank you.