Hello,
I have been using the Amibroker program . It provides SDK to automate the work programatically.
The application webpage http://www.amibroker.com/guide/objects.html#AWindow describes all methods and properties of the application objects.
The quote from the help guide:
[blockquote]Application object is main OLE automation object for AmiBroker. You have to create it prior to accesing any other objects. To create Application object use the following code:
JScript:
AB = new ActiveXObject(“Broker.Application”);
VB/VBScript:
AB = CreateObject(“Broker.Application”)[/blockquote]
However when I try to use the object the cmdlet new-object seems to fail.
PS C:\..\SkyDrive\Powershell\ $AB = New-Object Broker.Application
New-Object : Cannot find type [Broker.Application]: verify that the assembly containing this type is loaded.
At line:1 char:7
+ $AB = New-Object Broker.Application
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
I tried to add the following lines that I found on the web but it still does not work.
PS C:\..\SkyDrive\Powershell\ Add-Type Broker.Application
Add-Type : c:\Users\Tomasz\AppData\Local\Temp\hduuug3r.0.cs(1) : A namespace cannot directly contain members such as fields or methods
c:\Users\Tomasz\AppData\Local\Temp\hduuug3r.0.cs(1) : >>> Broker.Application
At line:1 char:1
+ Add-Type Broker.Application
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\Tomasz...elds or methods:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
The following code that I found on the web displays Broker.Application object in the list
gci HKLM:\Software\Classes -ea 0| ? {$_.PSChildName -match '^\w+\.\w+$' -and
(gp "$($_.PSPath)\CLSID" -ea 0)} | Out-GridView
So the question is how do I create a new Broker.Application object in Powershell ?
Thanks
Tomasz