예제 #1
0
WORD PASCAL _Cover_DdeInitialize( LPDWORD pidInst, PFNCALLBACK p,
                                DWORD afCmd, DWORD ulRes)
{
    return( DdeInitialize( pidInst,
        (PFNCALLBACK) SetProc( (FARPROC)p, GETPROC_DDEMLCALLBACK ),
                afCmd, ulRes ) );
}
예제 #2
0
UINT PASCAL _Cover_EnumSymbols(LPSYG lpsyg, WORD maxstr, ENUMPROC lpfn,
                LPVOID data )
{
    return( EnumSymbols( lpsyg, maxstr,
                SetProc( (FARPROC)lpfn, GETPROC_PENWIN_ENUMPROC ), data ) );

}
예제 #3
0
LPMMIOPROC PASCAL _Cover_mmioInstallIOProc(FOURCC fccIOProc,
                LPMMIOPROC pIOProc, DWORD dwFlags)
{
    if( dwFlags & MMIO_INSTALLPROC ) {
        return( mmioInstallIOProc( fccIOProc,
                SetProc( (FARPROC)pIOProc, GETPROC_MMSYSTEM_MMIOPROC ), dwFlags ) );
    } else {
        return( mmioInstallIOProc( fccIOProc, pIOProc, dwFlags ) );
    }
}
예제 #4
0
BOOL PASCAL _CoverGetOpenFileName( LPOPENFILENAME pofn )
{
    LPVOID      old;
    BOOL        rc;

    if( pofn->Flags & OFN_ENABLEHOOK ) {
        old = pofn->lpfnHook;
        pofn->lpfnHook = SetProc( old, GETPROC_CALLBACK );
        rc = GetOpenFileName( pofn );
        pofn->lpfnHook = old;
        return( rc );
    } else {
        return( GetOpenFileName( pofn ) );
    }
}
예제 #5
0
BOOL PASCAL _Cover_mciSetYieldProc (UINT uDeviceID, YIELDPROC fpYieldProc,
                DWORD dwYieldData)
{
    return( mciSetYieldProc( uDeviceID,
        SetProc( (FARPROC)fpYieldProc, GETPROC_MMSYSTEM_YIELDPROC ), dwYieldData ) );
}
예제 #6
0
BOOL PASCAL _Cover_EnumTaskWindows( HANDLE task, FARPROC p, LONG param )
{
    return( EnumTaskWindows( task, SetProc( p, GETPROC_ENUMTASKWINDOWS ),
                param ) );
}
예제 #7
0
short PASCAL _Cover_EnumFontFamilies( HDC dc, LPSTR family, FONTENUMPROC p, LPARAM data )
{
    return( EnumFontFamilies( dc, family, SetProc( (FARPROC)p, GETPROC_ENUMFONTS ), data ) );
}
예제 #8
0
//------------------------------------------------------------------------------------------------------------------------------------
//
int main()
{
#if defined( _WIN32 )
	char	ModulePath[MAX_PATH];
#elif defined(__APPLE__)
	FSRef ModuleRef;
#endif
	LPRefObj	pRefMod = NULL, pRefSrc = NULL, RefItm = NULL, pRefDat = NULL;
	char	buf[256];
	ULONG	ulModID = 0, ulSrcID = 0;
	UWORD	wSel;
	BOOL	bRet;

	// Search for a Module-file like "Type0010.md3".
#if defined( _WIN32 )
	bRet = Search_Module( ModulePath );
#elif defined(__APPLE__)
	bRet = Search_Module( &ModuleRef );
#endif
	if ( bRet == false ) {
		puts( "\"Type0010 Module\" is not found.\n" );
		return -1;
	}

	// Load the Module-file.
#if defined( _WIN32 )
	bRet = Load_Module( ModulePath );
#elif defined(__APPLE__)
	bRet = Load_Module( &ModuleRef );
#endif
	if ( bRet == false ) {
		puts( "Failed in loading \"Type0010 Module\".\n" );
		return -1;
	}

	// Allocate memory for reference to Module object.
	pRefMod = (LPRefObj)malloc(sizeof(RefObj));
	if ( pRefMod == NULL ) {
		puts( "There is not enough memory." );
		return -1;
	}
	InitRefObj( pRefMod );

	// Allocate memory for Module object.
	pRefMod->pObject = (LPNkMAIDObject)malloc(sizeof(NkMAIDObject));
	if ( pRefMod->pObject == NULL ) {
		puts( "There is not enough memory." );
		if ( pRefMod != NULL )	free( pRefMod );
		return -1;
	}

	//	Open Module object
	pRefMod->pObject->refClient = (NKREF)pRefMod;
	bRet = Command_Open(	NULL,					// When Module_Object will be opend, "pParentObj" is "NULL".
								pRefMod->pObject,	// Pointer to Module_Object 
								ulModID );			// Module object ID set by Client
	if ( bRet == false ) {
		puts( "Module object can't be opened.\n" );
		if ( pRefMod->pObject != NULL )	free( pRefMod->pObject );
		if ( pRefMod != NULL )	free( pRefMod );
		return -1;
	}

	//	Enumerate Capabilities that the Module has.
	bRet = EnumCapabilities( pRefMod->pObject, &(pRefMod->ulCapCount), &(pRefMod->pCapArray), NULL, NULL );
	if ( bRet == false ) {
		puts( "Failed in enumeration of capabilities." );
		if ( pRefMod->pObject != NULL )	free( pRefMod->pObject );
		if ( pRefMod != NULL )	free( pRefMod );
		return -1;
	}

	//	Set the callback functions(ProgressProc, EventProc and UIRequestProc).
	bRet = SetProc( pRefMod );
	if ( bRet == false ) {
		puts( "Failed in setting a call back function." );
		if ( pRefMod->pObject != NULL )	free( pRefMod->pObject );
		if ( pRefMod != NULL )	free( pRefMod );
		return -1;
	}

	//	Set the kNkMAIDCapability_ModuleMode.
	if( CheckCapabilityOperation( pRefMod, kNkMAIDCapability_ModuleMode, kNkMAIDCapOperation_Set )  ){
		bRet = Command_CapSet( pRefMod->pObject, kNkMAIDCapability_ModuleMode, kNkMAIDDataType_Unsigned, 
										(NKPARAM)kNkMAIDModuleMode_Controller, NULL, NULL);
		if ( bRet == false ) {
			puts( "Failed in setting kNkMAIDCapability_ModuleMode." );
			return -1;
		}
	}

	// Module Command Loop
	do {
		printf( "\nSelect (1-6, 0)\n" );
		printf( " 1. Select Device            2. AsyncRate                3. IsAlive\n" );
		printf( " 4. Name                     5. ModuleType               6. Version\n" );
		printf( " 0. Exit\n>" );
		scanf( "%s", buf );
		wSel = atoi( buf );

		switch( wSel )
		{
			case 1:// Children
				// Select Device
				ulSrcID = 0;	// 0 means Device count is zero. 
				bRet = SelectSource( pRefMod, &ulSrcID );
				if ( bRet == false ) break;
				if( ulSrcID > 0 )
					bRet = SourceCommandLoop( pRefMod, ulSrcID );
				break;
			case 2:// AsyncRate
				bRet = SetUnsignedCapability( pRefMod, kNkMAIDCapability_AsyncRate );
				break;
			case 3:// IsAlive
				bRet = SetBoolCapability( pRefMod, kNkMAIDCapability_IsAlive );
				break;
			case 4:// Name
				bRet = SetStringCapability( pRefMod, kNkMAIDCapability_Name );
				break;
			case 5:// ModuleType
				bRet = SetUnsignedCapability( pRefMod, kNkMAIDCapability_ModuleType );
				break;
			case 6:// Version
				bRet = SetUnsignedCapability( pRefMod, kNkMAIDCapability_Version );
				break;
			default:
				wSel = 0;
		}
		if ( bRet == false ) {
			printf( "An Error occured. Enter '0' to exit.\n>" );
			scanf( "%s", buf );
			bRet = true;
		}
	} while( wSel > 0 && bRet == true );

	// Close Module_Object
	bRet = Close_Module( pRefMod );
	if ( bRet == false )
		puts( "Module object can not be closed.\n" );

	// Unload Module
#if defined( _WIN32 )
	FreeLibrary( g_hInstModule );
	g_hInstModule = NULL;
#elif defined(__APPLE__)
	if (gBundle != NULL)
	{
		CFBundleUnloadExecutable(gBundle);
		CFRelease(gBundle);
		gBundle = NULL;
	}
#endif

	// Free memory blocks allocated in this function.
	if ( pRefMod->pObject != NULL )	free( pRefMod->pObject );
	if ( pRefMod != NULL )	free( pRefMod );
	
	puts( "This sample program has terminated.\n" );
	return 0;
}
예제 #9
0
BOOL PASCAL _Cover_EnumWindows( WNDENUMPROC p, LPARAM param )
{
    return( EnumWindows( SetProc( (FARPROC)p, GETPROC_ENUMWINDOWS ), param ) );
}
예제 #10
0
short PASCAL _Cover_DialogBoxParam( HANDLE inst, LPCSTR temp, HWND wnd, DLGPROC p, LONG param )
{
    return( DialogBoxParam( inst, temp, wnd, SetProc( (FARPROC)p, GETPROC_CALLBACK ), param ) );
}
예제 #11
0
short PASCAL _Cover_EnumObjects( HDC dc, short obj, FARPROC p, LPSTR data )
{
    return( EnumObjects( dc, obj, SetProc( p, GETPROC_ENUMOBJECTS ),
                (LPARAM)data ) );
}
예제 #12
0
WORD PASCAL _Cover_SetTimer( HWND wnd, short event, WORD el, FARPROC p )
{
    if( p == NULL ) 
        return( SetTimer( wnd, event, el, (TIMERPROC)p ) );
    return( SetTimer( wnd, event, el, SetProc( p, GETPROC_SETTIMER ) ) );
}
예제 #13
0
void PASCAL _Cover_LineDDA( short x1, short y1, short x2, short y2, LINEDDAPROC p,
                        LPARAM data )
{
    LineDDA( x1, y1, x2, y2, SetProc( (FARPROC)p, GETPROC_LINEDDA ), (LPARAM) data );
}
예제 #14
0
BOOL PASCAL _Cover_GrayString( HDC dc, HBRUSH brush, FARPROC p, DWORD data,
                        short count, short x, short y, short width, short height )
{
    return( GrayString( dc, brush, SetProc( p, GETPROC_GRAYSTRING ),
                data, count, x, y, width, height ) );
}
예제 #15
0
void mxConfig::SetProceso (int i) {
	SetProc(procesos[i]);
	SetZoom();
}
예제 #16
0
short PASCAL _Cover_DialogBox( HANDLE inst, LPSTR temp, HWND wnd,
                                 DLGPROC p )
{
    return( DialogBox( inst, temp, wnd, SetProc( (FARPROC)p, GETPROC_CALLBACK ) ) );
}
예제 #17
0
short PASCAL _Cover_EnumProps( HWND wnd, FARPROC p )
{
    return( EnumProps( wnd, SetProc( p, GETPROC_ENUMPROPS_MOVEABLE_DS ) ) );
}
예제 #18
0
/*!
	DLLの初期化

	関数のアドレスを取得してメンバに保管する.

	@retval true 成功
	@retval false アドレス取得に失敗
*/
bool CPPA::InitDllImp()
{
	/* PPA.DLLが持っている関数を準備 */

	//	Apr. 15, 2002 genta constを付けた
	//	アドレスの入れ場所はオブジェクトに依存するので
	//	static配列にはできない。
	const ImportTable table[] = 
	{
		{ &m_fnExecute,		"Execute" },
		{ &m_fnSetDeclare,	"SetDeclare" },
		{ &m_fnSetSource,	"SetSource" },
		{ &m_fnSetDefProc,	"SetDefProc" },
		{ &m_fnSetDefine,	"SetDefine" },
		{ &m_fnSetIntFunc,	"SetIntFunc" },
		{ &m_fnSetStrFunc,	"SetStrFunc" },
		{ &m_fnSetProc,		"SetProc" },
		{ &m_fnSetErrProc,	"SetErrProc" },
		{ &m_fnAbort,		"ppaAbort" },
		{ &m_fnGetVersion,	"GetVersion" },
		{ &m_fnDeleteVar,	"DeleteVar" },
		{ &m_fnGetArgInt,	"GetArgInt" },
		{ &m_fnGetArgStr,	"GetArgStr" },
		{ &m_fnGetArgBStr,	"GetArgBStr" },
		{ &m_fnGetIntVar,	"GetIntVar" },
		{ &m_fnGetStrVar,	"GetStrVar" },
		{ &m_fnGetBStrVar,	"GetBStrVar" },
		{ &m_fnSetIntVar,	"SetIntVar" },
		{ &m_fnSetStrVar,	"SetStrVar" },
		{ &m_fnAddIntObj,	"AddIntObj" },
		{ &m_fnAddStrObj,	"AddStrObj" },
		{ &m_fnAddIntVar,	"AddIntVar" },
		{ &m_fnAddStrVar,	"AddStrVar" },
		{ &m_fnSetIntObj,	"SetIntObj" },
		{ &m_fnSetStrObj,	"SetStrObj" },

#if PPADLL_VER >= 120
		{ &m_fnAddRealVar,	"AddRealVar" },
		{ &m_fnSetRealObj,	"SetRealObj" },
		{ &m_fnAddRealObj,	"AddRealObj" },
		{ &m_fnGetRealVar,	"GetRealVar" },
		{ &m_fnSetRealVar,	"SetRealVar" },
		{ &m_fnSetRealFunc,	"SetRealFunc" },
		{ &m_fnGetArgReal,	"GetArgReal" },
#endif

#if PPADLL_VER >= 123
		{ &m_fnIsRunning, "IsRunning" },
		{ &m_fnSetFinishProc, "SetFinishProc"}, // 2003.06.23 Moca
#endif

		{ NULL, 0 }
	};

	//	Apr. 15, 2002 genta
	//	CDllImpの共通関数化した
	if( ! RegisterEntries(table) )
		return false;

	SetIntFunc((void *)CPPA::stdIntFunc);	// 2003.02.24 Moca
	SetStrFunc((void *)CPPA::stdStrFunc);
	SetProc((void *)CPPA::stdProc);

	// 2003.06.01 Moca エラーメッセージを追加
	SetErrProc((void *)CPPA::stdError);
	SetStrObj((void *)CPPA::stdStrObj);	// UserErrorMes用
#if PPADLL_VER >= 123
	SetFinishProc((void *)CPPA::stdFinishProc);
#endif

	SetDefine( "sakura-editor" );	// 2003.06.01 Moca SAKURAエディタ用独自関数を準備
	AddStrObj( "UserErrorMes", "", FALSE, 2 ); // 2003.06.01 デバッグ用文字列変数を用意

	int i;
	
	//	Jun. 16, 2003 genta 一時作業エリア
	char buf[1024];
	// コマンドに置き換えられない関数 = PPA無しでは使えない。。。
	for (i=0; CSMacroMgr::m_MacroFuncInfoArr[i].m_pszFuncName != NULL; i++) {
		//	2003.06.08 Moca メモリーリークの修正
		//	2003.06.16 genta バッファを外から与えるように
		//	関数登録用文字列を作成する
		GetDeclarations( CSMacroMgr::m_MacroFuncInfoArr[i], buf );
		SetDefProc( buf );
	}

	// コマンドに置き換えられる関数 = PPA無しでも使える。
	for (i=0; CSMacroMgr::m_MacroFuncInfoCommandArr[i].m_pszFuncName != NULL; i++) {
		//	2003.06.08 Moca メモリーリークの修正
		//	2003.06.16 genta バッファを外から与えるように
		//	関数登録用文字列を作成する
		GetDeclarations( CSMacroMgr::m_MacroFuncInfoCommandArr[i], buf );
		SetDefProc( buf );
	}
	return true; 
}
예제 #19
0
short PASCAL _Cover_DialogBoxIndirectParam( HANDLE inst, HANDLE htmp,
                              HWND wnd, DLGPROC p, LONG param )
{
    return( DialogBoxIndirectParam( inst, htmp, wnd,
                SetProc( (FARPROC)p, GETPROC_CALLBACK ),  param ) );
}