List of channels in a database
BrianMinty
Posts: 3
in GX Developer
Hello
I'm looking for advice on how to get a list of the channel names in a database - using C++ in a standalone application.
Thanks in anticipation!
I'm looking for advice on how to get a list of the channel names in a database - using C++ in a standalone application.
Thanks in anticipation!
0
Comments
-
Hi Brian,
Did you found the solution?
On my side, I'm using .NET library directly in Montaj. It's not the same as C++ but it must very look like:
//Create a Database and List object
CDB db = CDB.Open("[database name.gdb]", "SUPER", "");
CLST list_of_channels = CLST.Create(db.iChansMax());
//Load channels in list
db.GetChanOrderLST(list_of_channels);
//Iterate through list object to extract channels name
for(int i = 0; i < list_of_channels.iSize(); i++)
{
//Load the item name in tmp, LST_ITEMConstant.VALUE is an integer representing the channel type
string tmp = "";
list_of_channels.GtItem(LST_ITEMConstant.NAME, i, ref tmp);
...
}
// Don't forget to dispose your objects
CDB.Dispose();
CLST.Dispose();0 -
That's great - thanks Guillaume. I've managed to get something similar working. Brian0
Categories
- 773 All Categories
- 171 Products & Software
- 12 Seequent
- 225 Leapfrog
- 353 Geosoft
- 19 GeoStudio
- 11 Developers
- 1 Seequent Evo APIs
- 163 GX Developer
- 1 Early Access Programmes
- 2 Oasis montaj Field EAP