#include <stdio.h>
#include "string.h"
#include <string>
#include "assert.h"
#import "../../bin/graphan.tlb"
int main (int argc, char* argv[])
{
try
{
CoInitialize(NULL);
GRAPHANLib::IGraphmatFilePtr piGraphan;
HRESULT hr = piGraphan.CreateInstance(__uuidof(GRAPHANLib::GraphmatFile));
if (FAILED (hr))
{
printf ("Graphan is not registered");
CoUninitialize();
return 1;
};
piGraphan->LoadDicts();
piGraphan->LoadStringToGraphan("mother goes to the windows");
_bstr_t t = piGraphan->GetWord(3);
assert (t == _bstr_t("to"));
}
catch(...)
{
return -1;
}
CoUninitialize();
return 1;
}