[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: Amibroker as a COM object



PureBytes Links

Trading Reference Links

So where did you get that code?
 
Of course I've done that...
 
d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Fred
Sent: Friday, March 24, 2006 12:34 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Amibroker as a COM object

D,

Assuming that there isn't an already running invisible Broker.exe,
then isn't it fairly straight forward to check whether or not
Broker.exe is running and if not start it prior to creating the
object ?

ABisRunning = 0

Set oWinMgm = GetObject("WinMgmts://localhost")
   
For Each oProcess In oWinMgm.ExecQuery ("select * from Win32_Process
where name='Broker.EXE'")
    ABisRunning = ABisRunning + 1
Next

If ABisRunning = 0 Then
    oWSH.Run "Broker.EXE"
End If

Additionally if one is concerned that the Broker.exe that is running
is invisible or if there are two or more Broker.exe's running then
one could terminate them and re-execute one.

Set oWinMgm = GetObject("WinMgmts://localhost")
   
For Each oProcess In oWinMgm.ExecQuery ("select * from Win32_Process
where name='Broker.EXE'")
    oProcess.Terminate
Next

Am I missing something ?

F

--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxx> wrote:
>
> I've noticed the same behavior for quite sometime. I tried to add
some code
> to detect the condition and remedy it but have been only partially
> successful.  Good news about the next beta though.

> d
>
>
>   _____ 
>
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
On Behalf
> Of soundscribe_studios
> Sent: Friday, March 24, 2006 10:29 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Amibroker as a COM object
>
>
>
> Thanks Tomasz. I don't know why, but sometimes there will be two
> broker.exes running. I suppose this means the createobject line
> doesn't attach to a running instance and creates a new one. I
didn't
> think this was intended behavior and it's probably something in my
> script. I'll play around with it some more.
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@>
wrote:
> >
> > Hello,
> >
> > By default all COM/OLE objects in Windows are created (if not
> already running)
> > in "invisible" state (i.e. with main window hidden).
> > I will add ability to show the GUI in next beta.
> >
> > If AmiBroker is already running, then if you call CreateObject it
> will attach to already running instance.
> >
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "soundscribe_studios" <jgalt@>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Friday, March 24, 2006 1:57 AM
> > Subject: [amibroker] Amibroker as a COM object
> >
> >
> > > Can someone please tell me the correct way to start up
Amibroker as a
> > > COM object? I'm getting inconsistent behavior and it's driving
me
> > > crazy trying to figure out what to do.
> > >
> > > If I run the Amibroker executable and then set oAB =
> > > CreateObject("Broker.Application"), more often than not, TWO
> > > Broker.exes are running in task manager. The non-GUI Broker is
the one
> > > actually doing the work (based on CPU for the PID) and the GUI
broker
> > > is idle.
> > >
> > > If I don't run AB first and just instantiate the COM object,
one
> > > Broker.exe runs and appears to perform all of the programatic
tasks.
> > > Everything is fine, except there is no GUI displayed.
> > >
> > > If there a way to instatiate AB from a script -- a single
instance --
> > > and display the GUI?
> > >
> > > In Excel you would just --
> > >
> > > set oXL = CreateObject("Excel.Application")
> > > oXL.show()
> > >
> > > and the Excel process will exist as long as oXL is in scope.
> > >
> > > Quote seems to work this way as does the Autoanalysis object
in AB.
> > >
> > > Am I taking crazy pills?
> > >
> > >
> > >
> > >
> > >
> > >
> > > Please note that this group is for discussion between users
only.
> > >
> > > To get support from AmiBroker please send an e-mail directly
to
> > > SUPPORT {at} amibroker.com
> > >
> > > For other support material please check also:
> > > http://www.amibroker.com/support.html
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
>
>
>
>   _____ 
>
> YAHOO! GROUPS LINKS
>
>
>      
> *      Visit your group "amibroker
> <http://groups.yahoo.com/group/amibroker> " on the web.
>  
>
> *      To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>  
>
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> <http://docs.yahoo.com/info/terms/> .
>
>
>   _____
>







Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS