You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
781 B
40 lines
781 B
#include <stdexcept>
|
|
#include <windows.h>
|
|
#include "main.hpp"
|
|
#include "utils.hpp"
|
|
|
|
using namespace std ;
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
extern "C" __declspec(dllexport) BSTR
|
|
open_api()
|
|
{
|
|
// open the API
|
|
try
|
|
{
|
|
openApi() ;
|
|
return NULL ;
|
|
}
|
|
catch ( exception& xcptn )
|
|
{
|
|
return SysAllocString( fromUtf8( MAKE_STRING( xcptn.what() ) ).c_str() ) ;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
extern "C" __declspec(dllexport) BSTR
|
|
close_api()
|
|
{
|
|
// close the API
|
|
try
|
|
{
|
|
closeApi() ;
|
|
return NULL ;
|
|
}
|
|
catch ( exception& xcptn )
|
|
{
|
|
return SysAllocString( fromUtf8( MAKE_STRING( xcptn.what() ) ).c_str() ) ;
|
|
}
|
|
}
|
|
|