Multiple Instances COM

Please post any questions regarding the program here.

Moderator: 2020vision

Multiple Instances COM

Postby jc0r » Sat Sep 07, 2019 7:46 am

Hi

Does anyone know of a way that i can use COM to multiple instances of BA? It oinly ever sends to the first instance?

Thanks
User avatar
jc0r
 
Posts: 67
Joined: Wed Mar 15, 2006 6:13 pm
Location: Birmingham

Re: Multiple Instances COM

Postby osknows » Tue Sep 10, 2019 7:06 pm

I haven't tried it myself on multiple instances so I don't know. However, in the COM settings there are settings for IP address and port. The COM also has a function setIPAddress(ip:String) which allows setting IP address (and perhaps port?)

You could try the same localhost IP address with different ports.
Instance 1: 127.0.0.1:8000
COM1: 127.0.0.1:8000

Instance 2: 127.0.0.1:8080
COM2: 127.0.0.1:8080

If that doesn't work try different IP, eg 127.0.0.1 on one instance and 127.0.0.99 on the other.

This is only a suggestion and no idea if it works?

Os
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Re: Multiple Instances COM

Postby osknows » Tue Sep 10, 2019 7:12 pm

It looks like setIPAddress also accepts arguments for port, eg setIPAddress("127.0.0.1","8000")
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Re: Multiple Instances COM

Postby jc0r » Wed Sep 11, 2019 3:03 pm

Hi, thanks for the response. I've had a look at the settings and even the userguide would suggest that you can change the IP, however, i've had no such luck. I even tried from another compter on the network but still nothing. The problem i have is whenever i trigger anything via COM, it always errors saying it cannot find 127.0.0.1. Even though i can change the options in BA, it would appear i need to make the changes in Excel. If i could change the IP address of the COM reference in Excel then i might stand a chance.
User avatar
jc0r
 
Posts: 67
Joined: Wed Mar 15, 2006 6:13 pm
Location: Birmingham

Re: Multiple Instances COM

Postby jc0r » Wed Sep 11, 2019 3:31 pm

Ive had a look at the COM DLL but its far beyond my scope. The only was i know at the moment is to run a VM inside of another computer.
User avatar
jc0r
 
Posts: 67
Joined: Wed Mar 15, 2006 6:13 pm
Location: Birmingham

Re: Multiple Instances COM

Postby osknows » Thu Sep 12, 2019 1:55 pm

I just tried it now and it does work.

Open 2 instances and enable the COM
Instance1 127.0.0.1:8000
Instance2 127.0.0.1:8080

The following VBA code works.

Code: Select all
Dim i1 As BettingAssistantCom.ComClass
Dim i2 As BettingAssistantCom.ComClass

Sub test()
Dim success As String

    Set i1 = New BettingAssistantCom.ComClass
    i1.SetIPAddress "127.0.0.1", "8000"
    success = i1.openmarket(161782354, 1)
   
    Set i2 = New BettingAssistantCom.ComClass
    i2.SetIPAddress "127.0.0.1", "8080"
    success = i2.openmarket(161782354, 1)

End Sub


You can use a single instance of the COM and SetIPAddress to the other instance if you only want to use a single instance of the COM. Eg

Code: Select all
Dim i1 As BettingAssistantCom.ComClass

Sub test()
Dim success As String

    Set i1 = New BettingAssistantCom.ComClass
    i1.SetIPAddress "127.0.0.1", "8000"
    success = i1.openmarket(161782354, 1)
   
    i1.SetIPAddress "127.0.0.1", "8080"
    success = i1.openmarket(161782354, 1)

End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Re: Multiple Instances COM

Postby jc0r » Thu Sep 12, 2019 6:03 pm

That's great. Thank you so much for this!
User avatar
jc0r
 
Posts: 67
Joined: Wed Mar 15, 2006 6:13 pm
Location: Birmingham


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 41 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.