set the "TurboActivate.dat" filename/path at runtime in C#.

Is there a way to set the "TurboActivate.dat" filename/path at runtime in C#.Idially I would like to load different limelm projects according to a setting known at runtime.

I have read there is a function PDetsFromPath is C++, but is this possible for C#

Regards

This will be included in TurboActivate 3.0 (coming very soon). In the meantime you can use the function but you first have to modify TurboActivate.cs a bit.

static class Native{//...


    [DllImport("TurboActivate.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]    public static extern int PDetsFromPath(string filename);


//...etc}


/// <summary>/// Loads the "TurboActivate.dat" file from a path rather than loading it from the same dir as TurboActivate.dll on Windows or the app that uses libTurboActivate.dylib / libTurboActivate.so on Mac / Linux./// </summary>/// <param name="filename">The full path to the TurboActivate.dat file.</param>/// <exception cref="ProductDetailsException">/// The product details file "TurboActivate.dat" failed to load. It's either missing or corrupt./// </exception>/// <exception cref="GeneralTurboActivateException">/// The TurboActivate.dat file has already been loaded. You must call this function only once and before any other TurboActivate function./// </exception>public static void PDetsFromPath(string filename){    switch (Native.PDetsFromPath(filename))    {        case 0: // successful            return;        case 8: // TA_E_PDETS            throw new ProductDetailsException();        default:            throw new GeneralTurboActivateException("The TurboActivate.dat file has already been loaded. You must call this function only once and before any other TurboActivate function.");    }}


ThanksIs there any way to use another filename instead of TurbtoActivate.dat ?e.g. load TurboActivate1.dat or TurboActivate2.dat ?

regards

Yes, after adding those lines of code to TurboActivate.cs (or using the TurboActivate.cs included with TA 3.0) then simply call the PDetsFromPath() function before you call any other TurboActivate functions:

TurboActivate.PDetsFromPath(@"C:\Location\To\TurboActivate.dat");

It goes without saying that you can't load one *.dat file then load another -- is that what you're trying to do? If so, why?

Ok, it works.Regards.