Problem running c# samples

Hi, Have installed GX developer 8.4. Have tried numerous samples and simple commands but continually receive the following error: “Class handle has been previously deleted”.
The same error was received when using GX developer 8.5.

Have tried referencing dll’s in bin folder as well as in Redist folder.
Visual Studio 2013
Windows 10, 32bit, runtime 4.5.2

I just need to write some code to open .grd files but can't get samples to work. In the following bit of test code it errors on the hDB.FindSymb() line.

// --- Initialize ---
pGeo = new CGX_NET("CHANADD", "V1", 2047, 0, 0);
if (pGeo == null)
{
Console.WriteLine("Unable to start Geosoft session");
return;
}

// ---
// Open a database.
// Note that all databases created by normal Geosoft users will have
// user name "SUPER" with password "". Third-party or custom applications
// may create databases that require a user-name and password, in which
// case you require these values to open the database.
// ---
hDB = CDB.Open(@D:\dev\Projects\BRC\DMQ\data\DMQ\Chinova_data\Geophysics\Airborne\Radiometrics\CCPRO_2010_ARAD_Db.GDB, "SUPER", "");

var B = hDB.bIsValid();

// --- Get the channel handle ---
iChan = hDB.FindSymb("Zone", CoreConstant.DB_SYMB_CHAN);
if (iChan == CoreConstant.NULLSYMB)
{
Console.WriteLine(args[1] + " channel not found in database " + args[0]);
return;
}

Any help greatly appreciated.
Thanks Mark

Comments

  • Hi Mark,

    I am able to successfully run your code in 8.4. I'd like to speak to you more regarding your environment/work.

    Joseph
This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!