I have a working C# COM component dll, with a class called MyComponent in the ap namespace, which is added to the GAC and registered successfully. I added a Add() call to it, tested it with a win32 c++ exe and called the Add() call successfully, so its all working.
However I want to test the call in WSF (windows script) I put the code below in a file called test.wsf, when I run the code I get an error:
Error: Could not connect object, on the line:
WScript.ConnectObject(appos,"ap_");
Why is it not connecting! Help!
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/WindowsScriptHost">
<job>
<?job debug="true" ?>
<script language="JScript">
<![CDATA[
// Create action provider
var appos = WScript.CreateObject ("ap.MyComponent");
WScript.ConnectObject (appos, "ap_");
// Initialise voucher provider with store and terminal id strings
appos.Add(1,99);
// Release object
appos = null;
WScript.StdIn.Read(1);
]]>
</script>
</job>
</package>