이 화면은 DLL 컴포넌트에 대한 샘플 화면이다.
DLL 컴포넌트는 DLL을 로드하고 DLL의 함수 호출 및 메시지 수신 기능을 제공하는 컴포넌트이다.
DLL 컴포넌트는 동기 모드와 비동기 모드를 지원한다.
DLL 컴포넌트는 비동기 모드는 invoke API의 모든 결과를 on_message 이벤트를 통해서 전달한다.
DLL 컴포넌트에 연동하는 DLL에는 아래의 함수가 선언되어 있어야 한다.
1. xplus_Init : DLL 컴포넌트의 init API 호출시 실행될 함수. DLL 로드후, 연동을 위한 기본 정보 설정
void* xplus_Init(LPCTSTR strComponentKey, HWND hParent);
2. xplus_Invoke : DLL 컴포넌트의 invoke API 호출시 실행될 함수. 실제 처리를 수행
LPCTSTR xplus_Invoke(void* pXPlusDllComm, LPCTSTR strFuncName, LPCTSTR strParam);
※ DLL 컴포넌트에 연동할 DLL의 샘플프로젝트는 테크넷( https://technet.softbase.co.kr/wiki/install/xf5browser_install ) 페이지의
DLL컴포넌트 연동샘플 프로젝트, DLL컴포넌트 연동샘플 DLL파일(64비트) 을 참조한다. (32비트, 64비트 구분 주의)
function screen_on_load()
{
	this.fldSyncFunc.settext("1234ABCD가나다라1");
	this.fldSyncMsg.settext("1234ABCD가나다라2");
	this.fldAsyncFunc.settext("1234ABCD가나다라1");
	this.fldAsyncMsg.settext("1234ABCD가나다라2");
}
///////////////////////////////////////////////////////////////////////////////////
// 동기모드(sync_mode가 true)
function btnSyncInit_on_click(objInst)
{
	// 초기화
	var ret = this.dllsync.init();
	if (ret == true) {
		this.fldSyncInitResult.settext("초기화 성공");
	} else {
		this.fldSyncInitResult.settext("초기화 실패");
	}
}
function btnSyncCallFunc_on_click(objInst)
{
	// syncmode_echo_func 함수 호출
	var ret = this.dllsync.invoke("syncmode_echo_func", this.fldSyncFunc.gettext());
	this.fldSyncFuncResult.settext(ret);
}
function btnSyncCallMsg_on_click(objInst)
{
	// fire_on_message 함수 호출
	this.dllsync.invoke("fire_on_message", this.fldSyncMsg.gettext());
}
/**
 * 메시지 수신 이벤트 처리
 * @param objInst DLL 컴포넌트 오브젝트
 * @param strMsgName 메시지 이름
 * @param strData 수신 데이터
 */
function dllsync_on_message(objInst, strMsgName, strData)
{
	factory.consoleprint("strMsgName = " + strMsgName);
	factory.consoleprint("strData = " + strData);
	this.fldSyncMsgName.settext(strMsgName);
	this.fldSyncMsgResult.settext(strData);
}
///////////////////////////////////////////////////////////////////////////////////
// 비동기모드(sync_mode가 false)
function btnAsyncInit_on_click(objInst)
{
	// 초기화
	this.dllasync.init();
}
function btnAsyncCallFunc_on_click(objInst)
{
	// asyncmode_echo_func 함수 호출
	var ret = this.dllasync.invoke("asyncmode_echo_func", this.fldAsyncFunc.gettext());
	this.fldAsyncFuncResult.settext(ret);
}
function btnAsyncCallMsg_on_click(objInst)
{
	// fire_on_message 함수 호출
	this.dllasync.invoke("fire_on_message", this.fldAsyncMsg.gettext());
}
/**
 * 모듈 로딩 완료 및 컴포넌트 초기화 결과 이벤트
 * @param objInst DLL 컴포넌트 오브젝트
 * @param bSucess 처리 성공 여부
 */
function dllasync_on_init(objInst, bSucess)
{
	if (bSucess == true) {
		this.fldAsyncInitResult.settext("초기화 성공");
	} else {
		this.fldAsyncInitResult.settext("초기화 실패");
	}
}
/**
 * 메시지 수신 이벤트 처리
 * @param objInst DLL 컴포넌트 오브젝트
 * @param strMsgName 메시지 이름
 * @param strData 수신 데이터
 */
function dllasync_on_message(objInst, strMsgName, strData)
{
	factory.consoleprint("strMsgName = " + strMsgName);
	factory.consoleprint("strData = " + strData);
	this.fldAsyncMsgName.settext(strMsgName);
	this.fldAsyncMsgResult.settext(strData);
}