Question mCore .NET SMS Library

shapEShifter22

New member
Joined
Mar 9, 2009
Messages
1
Location
South Africa
Programming Experience
5-10
Good Day Everyone.

Firstly, I would like to add that this forum is a great resource to solutions concerning VB.net, and has helped me allot. Thank you.

Though, now I'm facing a brick wall related to a 3rd party .NET library called mCore .NET SMS library. The library communicates with GSM modems and standalone GSM phones alike, and enables one to execute AT commands to the respective GSM modem / GSM phone. Works really great, and relieves the hassles of using System.IO.Ports and then creating your own class to execute AT commands to the hardware located at the specific port.

The mCore library works great, but I'm not able to create more than one single connection using the mCore library. This is the criteria I'm facing:


I've developed an application in VB.net 2008 and using the .NET 3.5 Framework. The application makes use of the 3rd party library called mCore .NET SMS library, in which I import the namespace using Imports mCore and reference a new instance within the class itself using:

VB.NET:
Private objSMS As New mCore.SMS

Now, obviously, at application startup, the object objSMS is set as a new instance of the referenced mCore.SMS library...this works great.

My application allows for specific settings to be able to connect to the GSM modem, such as the Port Name, Parity, Baud rate, Stop Bits etc etc, and has a button labeled "Connect", which when pressed, executes a connection to the modem on the specified COM port using the specified settings. The connection is successful each time, and I'm able to retrieve details such as the Manufacturer Name, The IMEI number, IMSI number and so forth.

I then also have a button on my windows form labeled "Add Connection", which would allow a user to add a connection to another GSM modem, but on a different COM port, seeing that only a single connection to a COM port is allowed.

The same criteria applies related to connection settings such as Port Name, Parity etc etc, and when the user clicks on connect, the connection deems successful, and a new connection is added.

BUT, now what happens, is that when the new connection is made, all other instances of previous connections are disposed, and I'm not able to access any details of previous connections and details of their respective GSM modems connected with it. It's as if every other connection disconnects, and the new connection remains connected. And the wheels of the bus go round and round, to say the least.

So, initially, i thought of a way in which I reference the instance as an array; by using:

VB.NET:
Private objSMS(i) as New mCore.SMS

Which is not allowed in VB.NET.

Again, I tried something else:

VB.NET:
Private i as Integer = ListView1.Items.Count
Public objSMS(i) As mCore.SMS

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

objSMS(i) = New mCore.SMS

objSMS(i).Connect()

End Sub


My aim being that each reference would have it's own unique name, and therefore won't replace the existing one being objSMS. Which will now be objSMS(1) or objSMS(2) or whatever the case might be.


How will I be able to get around this? This is by far the most difficult task I've ever faced in VB.NET, and it might be that the solution is right under my nose and I'm just not seeing it clearly.


Please, any help would be greatly appreciated. And my apologies if this is posted in the wrong thread.

Oh, and might I add; I have contacted the support team who created the mCore .NET SMS Library, several times, and haven't received any reply since.


Thank you in advance!
 
Back
Top