// Automatically generated by StubsGenerator.java

#ifdef TDA_USE_TAO_CORBA
#include "tdakernel_stub_corba.h"
#include <windows.h>

#include <string>
using namespace std;


string utf8_from_wstring(wstring W)
{
  if (W.length() == 0)
    return "";
  else {
    int size = WideCharToMultiByte(CP_UTF8, 0, W.c_str(), W.length(), NULL, 0, NULL, NULL);
    CHAR *s = new CHAR[size+1];
    s[size] = '\0';

    WideCharToMultiByte(CP_UTF8, 0, W.c_str(), W.length(), s, size+1, NULL, NULL);

    string retVal = s;
    delete[] s;
    return retVal;
  }
}

wstring wstring_from_utf8(string str_utf8)
{
  wstring W;
  int wsize = MultiByteToWideChar(CP_UTF8, 0, str_utf8.c_str(), str_utf8.length(), NULL, 0);
  WCHAR *w = new WCHAR[wsize+1];
  w[wsize] = 0;
  MultiByteToWideChar(CP_UTF8, 0, str_utf8.c_str(), str_utf8.length(), w, wsize+1);
  W.resize(wsize);
  for (int i=0; i<wsize; i++)
    W[i] = w[i];
  delete[] w;
  return W;
}

CorbaStub::CorbaStub(HANDLE _hProcess)
{
  tdaKernel = NULL;
  hProcess = _hProcess;
  ACE::init();
}
bool CorbaStub::initializeFromIOR(const char* ior)
{
  if ((ior == NULL) || (ior[0] == '\0'))
    return false;
  try
  {
      int dummy_argc = 1;
      char *dummy_args[1];
      dummy_args[0] = (char*)"this_program";
      orb_var = CORBA::ORB_init (dummy_argc,
                                    dummy_args,
                                    NULL);
      CORBA::Object_var kernel_object =
         orb_var->string_to_object (ior);
      if (CORBA::is_nil (kernel_object.in ()))
      	  return false;
	  tdaKernel = lv::lumii::tda::kernel::corba::ITDAKernel::_narrow (kernel_object.in ());
	  if ((tdaKernel == NULL) || (CORBA::is_nil (tdaKernel))) {
		return false;
	  }
	  else
		return true;
  }
  catch(...)
  {
    return false;
  }
}
void CorbaStub::close()
{
  if (tdaKernel == NULL)
    return;
  try {
    return tdaKernel->close();
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_Close.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_Close.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return;
}
bool CorbaStub::exists(const char* _param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->exists(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_Exists.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_Exists.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::open(const char* _param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->open(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_Open.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_Open.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::startSave()
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->startSave();
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_StartSave.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_StartSave.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::cancelSave()
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->cancelSave();
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CancelSave.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CancelSave.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::finishSave()
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->finishSave();
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FinishSave.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FinishSave.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::drop(const char* _param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->drop(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_Drop.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_Drop.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::findClass(const char* _param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->findClass(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FindClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FindClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
const char* CorbaStub::getClassName(__int64 param1)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->getClassName(param1);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetClassName.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetClassName.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
__int64 CorbaStub::createObject(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->createObject(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateObject.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateObject.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::createClass(const char* _param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->createClass(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::deleteClass(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteClass(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::isClass(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isClass(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::isDirectSubClass(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isDirectSubClass(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsDirectSubClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsDirectSubClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::deleteObject(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteObject(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteObject.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteObject.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::moveObject(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->moveObject(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_MoveObject.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_MoveObject.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::isTypeOf(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isTypeOf(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsTypeOf.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsTypeOf.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::isKindOf(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isKindOf(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsKindOf.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsKindOf.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::createAttribute(__int64 param1, const char* _param2, __int64 param3)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param2_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param2 = NULL;
    if (_param2!=NULL) {
       param2_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param2).c_str());
       param2 = param2_var;
    }
    return tdaKernel->createAttribute(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateAttribute.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateAttribute.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::isDerivedClass(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isDerivedClass(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsDerivedClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsDerivedClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::findAttribute(__int64 param1, const char* _param2)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param2_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param2 = NULL;
    if (_param2!=NULL) {
       param2_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param2).c_str());
       param2 = param2_var;
    }
    return tdaKernel->findAttribute(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FindAttribute.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FindAttribute.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::deleteAttribute(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteAttribute(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteAttribute.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteAttribute.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
const char* CorbaStub::getAttributeName(__int64 param1)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->getAttributeName(param1);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetAttributeName.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetAttributeName.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
const char* CorbaStub::getPrimitiveDataTypeName(__int64 param1)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->getPrimitiveDataTypeName(param1);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetPrimitiveDataTypeName.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetPrimitiveDataTypeName.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
__int64 CorbaStub::findPrimitiveDataType(const char* _param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->findPrimitiveDataType(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FindPrimitiveDataType.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FindPrimitiveDataType.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::isPrimitiveDataType(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isPrimitiveDataType(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsPrimitiveDataType.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsPrimitiveDataType.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::getIteratorForClasses()
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForClasses();
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForClasses.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForClasses.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
const char* CorbaStub::getAttributeValue(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->getAttributeValue(param1, param2);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetAttributeValue.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetAttributeValue.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
__int64 CorbaStub::createAssociation(__int64 param1, __int64 param2, const char* _param3, const char* _param4, bool param5)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param3_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param3 = NULL;
    if (_param3!=NULL) {
       param3_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param3).c_str());
       param3 = param3_var;
    }
    lv::lumii::tda::kernel::corba::wstring_nullable_var param4_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param4 = NULL;
    if (_param4!=NULL) {
       param4_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param4).c_str());
       param4 = param4_var;
    }
    return tdaKernel->createAssociation(param1, param2, param3, param4, param5);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateAssociation.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateAssociation.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForDirectSubClasses(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectSubClasses(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectSubClasses.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectSubClasses.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForAllClassObjects(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForAllClassObjects(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForAllClassObjects.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForAllClassObjects.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForDirectAttributes(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectAttributes(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectAttributes.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectAttributes.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getAttributeDomain(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getAttributeDomain(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetAttributeDomain.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetAttributeDomain.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::deleteGeneralization(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteGeneralization(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteGeneralization.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteGeneralization.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::createGeneralization(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->createGeneralization(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateGeneralization.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateGeneralization.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::excludeObjectFromClass(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->excludeObjectFromClass(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_ExcludeObjectFromClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_ExcludeObjectFromClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::getIteratorForAllAttributes(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForAllAttributes(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForAllAttributes.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForAllAttributes.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::includeObjectInClass(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->includeObjectInClass(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IncludeObjectInClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IncludeObjectInClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::getIteratorForDirectSuperClasses(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectSuperClasses(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectSuperClasses.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectSuperClasses.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForDirectClassObjects(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectClassObjects(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectClassObjects.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectClassObjects.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::setAttributeValue(__int64 param1, __int64 param2, const char* _param3)
{
  if (tdaKernel == NULL)
    return false;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param3_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param3 = NULL;
    if (_param3!=NULL) {
       param3_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param3).c_str());
       param3 = param3_var;
    }
    return tdaKernel->setAttributeValue(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_SetAttributeValue.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_SetAttributeValue.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::deleteAttributeValue(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteAttributeValue(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteAttributeValue.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteAttributeValue.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::getIteratorForDirectLinguisticInstances(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectLinguisticInstances(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectLinguisticInstances.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectLinguisticInstances.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForDirectObjectClasses(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectObjectClasses(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectObjectClasses.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectObjectClasses.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForObjectsByAttributeValue(__int64 param1, const char* _param2)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param2_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param2 = NULL;
    if (_param2!=NULL) {
       param2_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param2).c_str());
       param2 = param2_var;
    }
    return tdaKernel->getIteratorForObjectsByAttributeValue(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForObjectsByAttributeValue.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForObjectsByAttributeValue.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForAllOutgoingAssociationEnds(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForAllOutgoingAssociationEnds(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForAllOutgoingAssociationEnds.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForAllOutgoingAssociationEnds.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForDirectIngoingAssociationEnds(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectIngoingAssociationEnds(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectIngoingAssociationEnds.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectIngoingAssociationEnds.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForAllLinguisticInstances(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForAllLinguisticInstances(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForAllLinguisticInstances.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForAllLinguisticInstances.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForDirectOutgoingAssociationEnds(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForDirectOutgoingAssociationEnds(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForDirectOutgoingAssociationEnds.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForDirectOutgoingAssociationEnds.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForAllIngoingAssociationEnds(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForAllIngoingAssociationEnds(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForAllIngoingAssociationEnds.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForAllIngoingAssociationEnds.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::resolveIterator(__int64 param1, int param2)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->resolveIterator(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_ResolveIterator.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_ResolveIterator.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
const char* CorbaStub::getRoleName(__int64 param1)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->getRoleName(param1);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetRoleName.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetRoleName.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
bool CorbaStub::deleteLink(__int64 param1, __int64 param2, __int64 param3)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteLink(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteLink.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteLink.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::createLink(__int64 param1, __int64 param2, __int64 param3)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->createLink(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateLink.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateLink.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::isLinguistic(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isLinguistic(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsLinguistic.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsLinguistic.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::getAttributeType(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getAttributeType(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetAttributeType.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetAttributeType.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getTargetClass(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getTargetClass(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetTargetClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetTargetClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::isAssociationEnd(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isAssociationEnd(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsAssociationEnd.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsAssociationEnd.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
void CorbaStub::freeReference(__int64 param1)
{
  if (tdaKernel == NULL)
    return;
  try {
    return tdaKernel->freeReference(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FreeReference.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FreeReference.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return;
}
bool CorbaStub::isAttribute(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isAttribute(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsAttribute.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsAttribute.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::getSourceClass(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getSourceClass(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetSourceClass.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetSourceClass.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::linkExists(__int64 param1, __int64 param2, __int64 param3)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->linkExists(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_LinkExists.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_LinkExists.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::isComposition(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isComposition(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsComposition.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsComposition.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
void CorbaStub::freeIterator(__int64 param1)
{
  if (tdaKernel == NULL)
    return;
  try {
    return tdaKernel->freeIterator(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FreeIterator.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FreeIterator.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return;
}
__int64 CorbaStub::getLinguisticClassFor(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getLinguisticClassFor(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetLinguisticClassFor.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetLinguisticClassFor.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::deleteAssociation(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->deleteAssociation(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeleteAssociation.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeleteAssociation.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
bool CorbaStub::createOrderedLink(__int64 param1, __int64 param2, __int64 param3, int param4)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->createOrderedLink(param1, param2, param3, param4);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateOrderedLink.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateOrderedLink.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::deserializeReference(const char* _param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->deserializeReference(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_DeserializeReference.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_DeserializeReference.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::createDirectedAssociation(__int64 param1, __int64 param2, const char* _param3, bool param4)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param3_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param3 = NULL;
    if (_param3!=NULL) {
       param3_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param3).c_str());
       param3 = param3_var;
    }
    return tdaKernel->createDirectedAssociation(param1, param2, param3, param4);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateDirectedAssociation.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateDirectedAssociation.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
bool CorbaStub::isAdvancedAssociation(__int64 param1)
{
  if (tdaKernel == NULL)
    return false;
  try {
    return tdaKernel->isAdvancedAssociation(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_IsAdvancedAssociation.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_IsAdvancedAssociation.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return false;
}
__int64 CorbaStub::resolveIteratorFirst(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->resolveIteratorFirst(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_ResolveIteratorFirst.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_ResolveIteratorFirst.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
const char* CorbaStub::callSpecificOperation(const char* _param1, const char* _param2)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    lv::lumii::tda::kernel::corba::wstring_nullable_var param2_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param2 = NULL;
    if (_param2!=NULL) {
       param2_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param2).c_str());
       param2 = param2_var;
    }
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->callSpecificOperation(param1, param2);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CallSpecificOperation.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CallSpecificOperation.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
__int64 CorbaStub::getInverseAssociationEnd(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getInverseAssociationEnd(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetInverseAssociationEnd.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetInverseAssociationEnd.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
int CorbaStub::getLinkedObjectPosition(__int64 param1, __int64 param2, __int64 param3)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getLinkedObjectPosition(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetLinkedObjectPosition.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetLinkedObjectPosition.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
int CorbaStub::getIteratorLength(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorLength(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorLength.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorLength.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForLinkedObjects(__int64 param1, __int64 param2)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForLinkedObjects(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForLinkedObjects.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForLinkedObjects.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::createAdvancedAssociation(const char* _param1, bool param2, bool param3)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param1_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param1 = NULL;
    if (_param1!=NULL) {
       param1_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param1).c_str());
       param1 = param1_var;
    }
    return tdaKernel->createAdvancedAssociation(param1, param2, param3);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_CreateAdvancedAssociation.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_CreateAdvancedAssociation.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::getIteratorForLinguisticClasses()
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->getIteratorForLinguisticClasses();
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_GetIteratorForLinguisticClasses.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_GetIteratorForLinguisticClasses.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
__int64 CorbaStub::findAssociationEnd(__int64 param1, const char* _param2)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var param2_var;
    lv::lumii::tda::kernel::corba::wstring_nullable *param2 = NULL;
    if (_param2!=NULL) {
       param2_var = new lv::lumii::tda::kernel::corba::wstring_nullable(wstring_from_utf8(_param2).c_str());
       param2 = param2_var;
    }
    return tdaKernel->findAssociationEnd(param1, param2);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_FindAssociationEnd.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_FindAssociationEnd.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
const char* CorbaStub::serializeReference(__int64 param1)
{
  if (tdaKernel == NULL)
    return NULL;
  try {
    lv::lumii::tda::kernel::corba::wstring_nullable_var s = tdaKernel->serializeReference(param1);
    if (CORBA::is_nil(s))
      return NULL;
    else
      return TDA_CreateReturnString( utf8_from_wstring(s->_value()).c_str() );
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_SerializeReference.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_SerializeReference.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return NULL;
}
__int64 CorbaStub::resolveIteratorNext(__int64 param1)
{
  if (tdaKernel == NULL)
    return 0;
  try {
    return tdaKernel->resolveIteratorNext(param1);
  }
  catch(CORBA::Exception &e) {
    string s = "A CORBA Exception ";
    s += e._name();
    s += " occured in function TDA_ResolveIteratorNext.";
    MessageBox(NULL, s.c_str(), "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  catch(...) {
    MessageBox(NULL, "A TDA Kernel Stub exception occured in function TDA_ResolveIteratorNext.", "TDA Kernel Stub", MB_OK | MB_ICONEXCLAMATION);
  }
  return 0;
}
CorbaStub::~CorbaStub()
{
  if (hProcess != NULL)
    close();
  if (tdaKernel != NULL) {
  	// Delegating the responsibility to delete for the _var class...
  	lv::lumii::tda::kernel::corba::ITDAKernel_var tdaKernel_var = tdaKernel;
  	tdaKernel = NULL;
  	// the _var class will perform the required actions to delete the CORBA stub
  }
  ACE::fini();
  if (hProcess != NULL) {
    TerminateProcess(hProcess, 0);
    CloseHandle(hProcess);
  }
}

#endif // TDA_USE_TAO_CORBA
