OpenModelW

This function opens the model on location file name.
References inside to other ontologies will be included.
A handle to the model will be returned, or 0 in case something went wrong.

Syntax

//
//   Strong typing definition
//
OwlModel        OpenModelW(
                        const wchar_t           * fileName
                    );

static  inline  OwlModel    OpenModelW(
                                    wchar_t                 * fileName
                                )
{
    return  OpenModelW(
                    (const wchar_t*) fileName
                );
}


//
//   Weak typing definition
//
int64_t __declspec(dllexport) __stdcall OpenModelW(
                                                const wchar_t           * fileName
                                            );

static  inline  int64_t OpenModelW(
                                wchar_t                 * fileName
                            )
{
    return  OpenModelW(
                    (const wchar_t*) fileName
                );
}
    

Property fileName

Size: 32 bit / 4 byte (reference)
The file name of the file as available in the file system in Unicode (wchar_t *). The given wchar_t array will not be adjusted. The size of each wchar_t element is depending on the OS, both 16 bit / 2 bytes wchar_t elements as well as 32 bit / 4 byte wchar_t elements are recognized and supported.

Example (based on pure API calls)

Here you can find code snippits that show how the API call OpenModelW can be used.

#include    "./include/engine.h"

int64_t GetFileInstanceCount(wchar_t * fileName)
{
    int64_t instanceCount = 0,
            model = OpenModelW(fileName);
    
    if (model) {
        int64_t myInstance = GetInstancesByIterator(model, 0);

        while (myInstance) {
            instanceCount++;
            myInstance = GetInstancesByIterator(model, myInstance);
        }

        CloseModel(model);
    }

    return  instanceCount;
}

int main()
{
    int64_t noInstances = GetFileInstanceCount(L"c:\\created\\myFile.bin");
}