/***************************************************************************
**
**    $Header$
**
**    $Log$
** 
****************************************************************************/

// ABIdll.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "gosvr.h"


#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Initialization of MFC Extension DLL

#include <afxdllx.h>    // standard MFC Extension DLL routines

static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };

extern "C" int CALLBACK LibMain(HINSTANCE hInstance, WORD, WORD, LPSTR)
{
	// Extension DLL one-time initialization - do not allocate memory here,
	// use the TRACE or ASSERT macros or call MessageBox
	AfxInitExtensionModule(::extensionDLL, hInstance);

	return 1;   // OK
}


// Exported DLL initialization is run in context of running application
extern "C" BOOL WINAPI InitGoSvrDLL()
{   
	// create a new CDynLinkLibrary for this app
	new CDynLinkLibrary(::extensionDLL);

	// add other initialization here
	return TRUE;
}

extern "C" BOOL WINAPI ExitGoDLL(){
	return TRUE;
}   

/*
extern "C" CBaseAbi* WINAPI GetGoSvr() {
} */

void ErrShow(U32 errId, BOOL isUI) {
	char tmp[100];
	
	ErrGetErrorText(errId,tmp);
	
	if(isUI) {
		AfxMessageBox(tmp);
	} else {
		SymShowLine(tmp);
	}		
}

#ifdef __cplusplus
extern "C" {
#endif	// __cplusplus

#ifdef __cplusplus
}
#endif	// __cplusplus
