Пример #1
0
HANDLE mcmCreateObject(LPCBYTE pStorage, DWORD Size)
{
	CItem *pItem = new CItem;
	ASSERT(pItem);
	if( pItem != NULL ) pItem->Create(pStorage, Size);
	return (HANDLE)pItem;
}
Пример #2
0
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
	switch(reason){
		case DLL_PROCESS_ATTACH:
			{
				InitSys();

				char bf[512];
				::GetModuleFileName(hinst, bf, sizeof(bf));
				::SetDirName(sys.m_BgnDir, bf);

				_setmbcp(_MB_CP_ANSI);
				HWND hMM = ::FindWindow("TMmsstv", NULL);
				if( hMM != NULL ) Application->Handle = hMM;

                if( sys.m_BitPixel < 24 ){
					sys.m_pBitmapTemp = new Graphics::TBitmap;
					sys.m_pBitmapTemp->Width = 1;
            		sys.m_pBitmapTemp->Height = 1;
                }
			}
			break;
		case DLL_PROCESS_DETACH:
			sys.m_fMultProc = NULL;
			if( sys.m_pDefStg != NULL ){
				CItem *pItem = new CItem;
				pItem->Create(NULL, 0);
				pItem->SaveToInifile("Default", ININAME);
				delete pItem;
				delete sys.m_pDefStg;
				sys.m_pDefStg = NULL;
			}
			if( sys.m_pTextList != NULL ){
				SaveStringsToIniFile(sys.m_pTextList, "Strings", ININAME, TRUE);
				delete sys.m_pTextList;
				sys.m_pTextList = NULL;
			}
			if( sys.m_pStyleList != NULL ){
				SaveStringsToIniFile(sys.m_pStyleList, "Styles", ININAME, FALSE);
				delete sys.m_pStyleList;
				sys.m_pStyleList = NULL;
			}
            if( sys.m_pFontList != NULL ){
				delete sys.m_pFontList;
                sys.m_pFontList = NULL;
            }
            if( sys.m_pBitmapTemp != NULL ){
				delete sys.m_pBitmapTemp;
                sys.m_pBitmapTemp = NULL;
            }
			break;
	}
	return 1;
}
Пример #3
0
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
	switch(reason){
		case DLL_PROCESS_ATTACH:
			{
				memset(&sys, 0, sizeof(sys));

				sys.m_dwVersion = ::GetVersion();
				sys.m_WinNT = (sys.m_dwVersion < 0x80000000) ? TRUE : FALSE;
				sys.m_CodePage = ::GetACP();	// Get codepage

				char bf[512];
				::GetModuleFileName(hinst, bf, sizeof(bf));
				::SetDirName(sys.m_BgnDir, bf);

				HDC hdcScreen = ::CreateDC("DISPLAY", NULL, NULL, NULL);
				sys.m_BitPixel = ::GetDeviceCaps(hdcScreen, BITSPIXEL);
				::DeleteDC(hdcScreen);

				_setmbcp(_MB_CP_ANSI);
			}
			break;
		case DLL_PROCESS_DETACH:
			sys.m_fMultProc = NULL;
			if( sys.m_pDefStg != NULL ){
				CItem *pItem = new CItem;
				pItem->Create(NULL, 0);
				pItem->SaveToInifile("Default", ININAME);
				delete pItem;
				delete sys.m_pDefStg;
				sys.m_pDefStg = NULL;
			}
			if( sys.m_pTextList != NULL ){
				SaveStringsToIniFile(sys.m_pTextList, "Strings", ININAME);
				delete sys.m_pTextList;
				sys.m_pTextList = NULL;
			}
			if( sys.m_pStyleList != NULL ){
				SaveStringsToIniFile(sys.m_pStyleList, "Styles", ININAME);
				delete sys.m_pStyleList;
				sys.m_pStyleList = NULL;
			}
			break;
	}
	return 1;
}
Пример #4
0
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
	switch(reason){
		case DLL_PROCESS_ATTACH:
			{
				InitSys(hinst);

				_setmbcp(_MB_CP_ANSI);
				HWND hMM = ::FindWindow("TMmsstv", NULL);
				if( hMM != NULL ) Application->Handle = hMM;
			}
			break;
		case DLL_PROCESS_DETACH:
			sys.m_fMultProc = NULL;
			if( sys.m_pDefStg != NULL ){
				CItem *pItem = new CItem;
				pItem->Create(NULL, 0);
				pItem->SaveToInifile("Default", ININAME, FALSE);
				delete pItem;
				delete sys.m_pDefStg;
				sys.m_pDefStg = NULL;
			}
			if( sys.m_pTextList != NULL ){
				SaveStringsToIniFile(sys.m_pTextList, "Strings", ININAME, TRUE);
				delete sys.m_pTextList;
				sys.m_pTextList = NULL;
			}
			if( sys.m_pStyleList != NULL ){
				SaveStringsToIniFile(sys.m_pStyleList, "Styles", ININAME, FALSE);
				delete sys.m_pStyleList;
				sys.m_pStyleList = NULL;
			}
            if( sys.m_pFontList != NULL ){
				delete sys.m_pFontList;
                sys.m_pFontList = NULL;
            }
            if( sys.m_pBitmapTemp != NULL ){
				delete sys.m_pBitmapTemp;
                sys.m_pBitmapTemp = NULL;
            }
			break;
	}
	return 1;
}