Exemplo n.º 1
0
void CVideoWnd::OnContextvideoEdittransparency()
{
	CRecorderApp *pApp = reinterpret_cast<CRecorderApp *>(AfxGetApp());
	if (!pApp) {
		// TODO: report FATAL error.
		return;
	}
	if (pApp->VersionOp() < 5) {
		//int ret = MessageBox("This feature is only available in Win 2000/ XP." ,"Note",MB_OK | MB_ICONEXCLAMATION);
		/*int ret = */
		MessageOut(m_hWnd, IDS_STRING_AVAILXP, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION);
		return;
	}

	if (m_iRefreshRate>10)
	{
		//int ret = MessageBox("Enabling Transparency at a high refresh rate will cause dialog boxes to freeze. If this happens, you will have to close the Video Annotation window to make the dialog boxes appear. Reduce the refresh rate ?" ,"Note",MB_YESNOCANCEL | MB_ICONQUESTION);
		int ret = MessageOut(this->m_hWnd,IDS_STRING_TRANSBLAHBLAH ,IDS_STRING_NOTE,MB_YESNOCANCEL | MB_ICONQUESTION);
		if (ret == IDYES)
		{
			AdjustRefreshRate(10);

		}
		else if (ret == IDCANCEL)
			return;

	}

	CTransparentWnd::EditTransparency();
}
Exemplo n.º 2
0
void CVideoOptionsDlg::DDV_CaptureInterval(CDataExchange* pDX, int value, int minVal, int maxVal)
{
	if (value < minVal) {
		if (pDX->m_bSaveAndValidate) {
			if (!m_ctrlButtonAutoAdjust.GetCheck()) {
				//"Timelapse for each frame cannot be less than 0 milliseconds."
				MessageOut(*(pDX->m_pDlgWnd), IDS_STRING_TIMELAPSELESS, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION);
				pDX->PrepareEditCtrl(IDC_KEYFRAMES2);
				pDX->Fail();
			}
		}
		m_iCaptureInterval = minVal;
		return;
	}

	if (maxVal < value) {
		if (pDX->m_bSaveAndValidate) {
			if (!m_ctrlButtonAutoAdjust.GetCheck()) {
				//MessageBox("Timelapse for each frame cannot be more than 7200000 milliseconds (2 hours).","Note",MB_OK);
				MessageOut(*(pDX->m_pDlgWnd), IDS_STRING_TIMELAPSEMORE, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION);
				pDX->PrepareEditCtrl(IDC_KEYFRAMES2);
				pDX->Fail();
			}
		}
		m_iCaptureInterval = maxVal;
		return;
	}
}
Exemplo n.º 3
0
void GameHandler::handleTradeRequest(GameClient &client, MessageIn &message)
{
    const int id = message.readInt16();

    auto *characterComponent =
            client.character->getComponent<CharacterComponent>();

    if (Trade *t = characterComponent->getTrading())
        if (t->request(client.character, id))
            return;

    Entity *q = findCharacterNear(client.character, id);
    if (!q || characterComponent->isBusy())
    {
        client.send(MessageOut(GPMSG_TRADE_CANCEL));
        return;
    }

    new Trade(client.character, q);

    // log transaction
    std::string str;
    str = "User requested trade with " + q->getComponent<BeingComponent>()
            ->getName();
    accountHandler->sendTransaction(characterComponent->getDatabaseID(),
                                    TRANS_TRADE_REQUEST, str);
}
Exemplo n.º 4
0
void CMainFrame::OnClose()
{
	// TODO: Add your message handler code here and/or call default
	if (bRecordState)
	{
		//MessageBox("Please stop video recording before exiting program.","Note",MB_OK | MB_ICONEXCLAMATION);
		MessageOut(this->m_hWnd,IDS_STRING_STOPBEFOREEXIT ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		return;
	}

	CFrameWnd::OnClose();
}
Exemplo n.º 5
0
void CVideoOptionsDlg::DDV_KeyFrameInterval(CDataExchange* pDX, int value, int minVal, int maxVal)
{
	if ((value < minVal) || (maxVal < value)) {
		if (pDX->m_bSaveAndValidate) {
			// "Key frames cannot be set for every %d frames. Please enter a value in the range 1 to 200."
			MessageOut(*(pDX->m_pDlgWnd), IDS_STRING_KEYFRAMES1, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION, value);
			pDX->PrepareEditCtrl(IDC_KEYFRAMES);
			pDX->Fail();
		} else {
			m_iKeyFrameInterval = (value < minVal) ? minVal : maxVal;
		}
	}
}
Exemplo n.º 6
0
void CVideoOptionsDlg::DDV_PlaybackRate(CDataExchange* pDX, int value, int minVal, int maxVal)
{
	if ((value < minVal) || (maxVal < value)) {
		if (pDX->m_bSaveAndValidate) {
			if (!m_ctrlButtonAutoAdjust.GetCheck()) {
				// "Playback Rate cannot be set to %d frames per second. Please enter a value in the range 1 to 200."
				MessageOut(*(pDX->m_pDlgWnd), IDS_STRING_PLAYBACKRATE, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION, value);
				pDX->PrepareEditCtrl(IDC_FPS);
				pDX->Fail();
			}
		}
		m_iPlaybackRate = (value < minVal) ? minVal : maxVal;
	}
}
int CListManager::SaveLayout(CString saveDir)
{

	int ret = TRUE;
	FILE* fptr = fopen(LPCTSTR(saveDir),"wb");
	if (fptr != NULL) {


			
			long fileversion = 100;
			fwrite( (void *) &fileversion, sizeof(long), 1, fptr );		

			int max = layoutArray.GetSize();
			fwrite( (void *) &max, sizeof(int), 1, fptr ); //Number of Shapes


			int reserve[100];
			reserve[0]='c';
			reserve[1]='l';
			reserve[2]='a';
			reserve[3]='y';
			reserve[4]='o';
			reserve[5]='u';
			reserve[6]='t';

			for (int j=0;j<100;j++)
				fwrite( (void *) &reserve[j], sizeof(int), 1, fptr ); //Reserve Bytes
			
			
			CLayoutList * itemLayout = NULL;
			for (int i=0;i<max; i++)
			{
				itemLayout = layoutArray[i];
				if (itemLayout)
				{
					if (!itemLayout->SaveLayoutToFile(fptr))
						ret = FALSE;

				}
			}	

		fclose(fptr);

	}
	else 
		//MessageBox(NULL,"Error opening layout file for saving","Note",MB_OK | MB_ICONEXCLAMATION);
		MessageOut(NULL,IDS_STRING_EOLFS,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);

	return ret;
}
int CListManager::SaveShapeArray(CString saveDir)
{

	int ret = TRUE;
	FILE* fptr = fopen(LPCTSTR(saveDir),"wb");
	if (fptr != NULL) {

			
			long fileversion = 100;
			fwrite( (void *) &fileversion, sizeof(long), 1, fptr );		

			int max = shapeArray.GetSize();
			fwrite( (void *) &max, sizeof(int), 1, fptr ); //Number of Shapes

			int reserve[100];
			reserve[0]='c';
			reserve[1]='s';
			reserve[2]='h';
			reserve[3]='a';
			reserve[4]='p';
			reserve[5]='e';

			for (int j=0;j<100;j++)
				fwrite( (void *) &reserve[j], sizeof(int), 1, fptr ); //Reserve Bytes
			
			
			CTransparentWnd * itemWnd = NULL;
			for (int i=0;i<max; i++)
			{
				itemWnd = shapeArray[i];
				if (itemWnd)
				{
					if (!itemWnd->SaveShape(fptr))
						ret = FALSE;

				}
			}	

		fclose(fptr);

	}
	else 
		//MessageBox(NULL,"Error opening shape file for saving","Note",MB_OK | MB_ICONEXCLAMATION);
		MessageOut(NULL,IDS_STRING_EOSFS,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);

	return ret;
}
void TextDialog::OnFont2() 
{
	// TODO: Add your control notification handler code here
	
	if (versionOp<5) {
		
		//int ret = MessageBox("This feature works only in Win 2000/ XP." ,"Note",MB_OK | MB_ICONEXCLAMATION);		
		int ret = MessageOut(this->m_hWnd,IDS_STRING_WORKSWINXP,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		
		msgShown = 1;				
		((CButton *) GetDlgItem(IDFONT2))->EnableWindow(FALSE);	
		
		//if (ret==IDNO)		
		return;
	}


	POINT point;
	GetCursorPos(&point);
	CPoint local = point;
	ScreenToClient(&local);

	CMenu menu;

	int menuToLoad = IDR_CONTEXTLANGUAGE;
	if (menu.LoadMenu(menuToLoad))
	{
		CMenu* pPopup = menu.GetSubMenu(0);
		ASSERT(pPopup != NULL);

		pPopup->TrackPopupMenu(TPM_RIGHTBUTTON | TPM_LEFTALIGN,
							   point.x, point.y,
							   this); // route commands through main window
	}
	
}
void CVideoOptions::OnOK() 
{
	// TODO: Add extra validation here
	CString fps;
	CString keyframes;
	CString timelp;
	CString qualitystr;


	int own_timelapse;
	int own_frames_per_second;
	int own_keyFramesEvery;
	int quality;

	((CEdit *) GetDlgItem(IDC_FPS))->GetWindowText(fps);
	((CEdit *) GetDlgItem(IDC_KEYFRAMES))->GetWindowText(keyframes);
	((CEdit *) GetDlgItem(IDC_KEYFRAMES2))->GetWindowText(timelp);
	((CStatic *) GetDlgItem(IDC_QUALITY))->GetWindowText(qualitystr);

	//Can into local variables first
	sscanf(LPCTSTR(fps),"%d",&own_frames_per_second);
	sscanf(LPCTSTR(keyframes),"%d",&own_keyFramesEvery);
	sscanf(LPCTSTR(timelp),"%d",&own_timelapse);
	sscanf(LPCTSTR(qualitystr),"%d",&quality);

	if (own_timelapse<0) {

		//MessageBox("Timelapse for each frame cannot be less than 0 milliseconds.","Note",MB_OK);
		MessageOut(this->m_hWnd,IDS_STRING_TIMELAPSELESS ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);

		return;
	}
	
	if (own_timelapse>7200000) {

		//MessageBox("Timelapse for each frame cannot be more than 7200000 milliseconds (2 hours).","Note",MB_OK);
		MessageOut(this->m_hWnd,IDS_STRING_TIMELAPSEMORE ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		return;
	}

	if ((own_keyFramesEvery<1) || (own_keyFramesEvery>200)) {

		//char tempstr[300];
		//sprintf(tempstr,"Key frames cannot be set for every %d frames. Please enter a value in the range 1 to 200.",own_keyFramesEvery);
		//MessageBox(tempstr,"Note",MB_OK);

		MessageOutINT(this->m_hWnd,IDS_STRING_KEYFRAMES1, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION,own_keyFramesEvery);

		return;
	}

	if ((own_frames_per_second<1) || (own_frames_per_second>200)) {

		//char tempstr[300];
		//sprintf(tempstr,"Playback Rate cannot be set to %d frames per second. Please enter a value in the range 1 to 200.",own_frames_per_second);
		//MessageBox(tempstr,"Note",MB_OK);

		MessageOutINT(this->m_hWnd,IDS_STRING_PLAYBACKRATE, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION,own_frames_per_second);
		return;
	}


	 //Verification Passed..Setting Global Values
	 timelapse = own_timelapse;
	 frames_per_second =own_frames_per_second;
	 keyFramesEvery =own_keyFramesEvery;


	 compquality = quality * 100;

	
	int sel = ((CComboBox *) GetDlgItem(IDC_COMPRESSORS))->GetCurSel();
	if (sel != CB_ERR)  {
		compfccHandler = compressor_info[sel].fccHandler;
		strCodec = CString(compressor_info[sel].szDescription); 		
		selected_compressor = sel;

	}
	//else
	//	selected_compressor = -1;

	//Ver 1.2
	g_autoadjust = ((CButton *) GetDlgItem(IDC_AUTO))->GetCheck();
	g_valueadjust = ((CSliderCtrl *) GetDlgItem(IDC_ADJUST))->GetPos();
	
	CDialog::OnOK();
}
Exemplo n.º 11
0
void CFixedRegionDlg::OnOK()
{
	if (!UpdateData()) {
		return;
	}

	// Not Correct, one to high because MinXY is zero an MaxXY is width/height no of pixels.
	int maxWidth = abs(maxxScreen - minxScreen);   // Assuming number first pixel is one not zero.
	int maxHeight = abs(maxyScreen - minyScreen);
	// TRACE(_T("## CFixedRegionDlg::OnOK / maxWidth=[%d], maxHeight=[%d]\n"), maxWidth, maxHeight );
	
	if (m_iWidth < 0)
	{
		MessageOut(m_hWnd, IDS_STRING_WIDTHGREATER, IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		return;
	}

	if (maxWidth < m_iWidth)
	{
		MessageOut(m_hWnd, IDS_STRING_WIDTHSMALLER, IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION, maxxScreen);
		return;
	}

	if (m_iHeight < 0)
	{
		MessageOut(m_hWnd,IDS_STRING_HEIGHTGREATER ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		return;
	}

	if (maxHeight < m_iHeight)
	{
		MessageOut(m_hWnd,IDS_STRING_HEIGHTSMALLER ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION,maxyScreen);
		return;
	}

	//version 1.5
	int fval = m_ctrlButtonFixTopLeft.GetCheck();
	if (fval)
	{
		if (m_iLeft < minxScreen)
		{
			MessageOut(m_hWnd,IDS_STRING_LEFTGREATER ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
			return;
		}

		if (maxxScreen < m_iLeft)
		{
			MessageOut(this->m_hWnd,IDS_STRING_LEFTSMALLER ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION,maxxScreen);
			return;
		}

		if (m_iTop < minyScreen)
		{
			MessageOut(m_hWnd,IDS_STRING_TOPGREATER ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
			return;
		}

		if (maxyScreen < m_iTop)
		{
			MessageOut(m_hWnd,IDS_STRING_TOPSMALLER ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION,maxyScreen);
			return;
		}

		if (maxWidth < (m_iLeft + m_iWidth))
		{
			m_iWidth = maxxScreen - m_iLeft;
			if (m_iWidth <= 0)
			{
				//TODO -- where did these constants came from? Get rid of 'em, put 'em in an ini or #define them somewhere
				//Answer: See struct sRegionOpts in Profile.h. An area of 240x320 is defined there.
				m_iLeft = minxScreen + 100;
				m_iWidth = 320;
			}
			MessageOut(m_hWnd, IDS_STRING_VALUEEXCEEDWIDTH, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION, m_iWidth);
		}

		if (maxHeight < (m_iTop + m_iHeight))
		{
			m_iHeight = maxyScreen - m_iTop;
			if (m_iHeight <= 0)
			{
				//TODO -- where did these constants come from? Get rid of 'em, put 'em in an ini or #define them somewhere
				//Answer: See struct sRegionOpts in Profile.h. An area of 240x320 is defined there.
				m_iTop = minyScreen + 100;
				m_iHeight = 240;
			}
			MessageOut(m_hWnd,IDS_STRING_VALUEEXCEEDHEIGHT, IDS_STRING_NOTE, MB_OK | MB_ICONEXCLAMATION, m_iHeight);
		}
	}

	// Technical pixel coordinates are applicable.  Top-Left = 0:0 not 1:1 What user often think it is.
	// TRACE(_T("## CFixedRegionDlg::OnOK / L=%d, T=%d, W=%d, H=%d\n"), m_iLeft, m_iTop, m_iWidth, m_iHeight );

	cRegionOpts.m_iCaptureLeft = m_iLeft;
	cRegionOpts.m_iCaptureTop = m_iTop;
	cRegionOpts.m_bFixedCapture = fval ? true : false;
	cRegionOpts.m_iCaptureWidth = m_iWidth ;
	cRegionOpts.m_iCaptureHeight = m_iHeight ;
	cRegionOpts.m_bSupportMouseDrag = m_ctrlButtonMouseDrag.GetCheck() ? true : false;
	CDialog::OnOK();
}
Exemplo n.º 12
0
void GameHandler::processMessage(NetComputer *computer, MessageIn &message)
{
    GameClient &client = *static_cast<GameClient *>(computer);

    if (client.status == CLIENT_LOGIN)
    {
        if (message.getId() != PGMSG_CONNECT)
            return;

        std::string magic_token = message.readString(MAGIC_TOKEN_LENGTH);
        client.status = CLIENT_QUEUED; // Before the addPendingClient
        mTokenCollector.addPendingClient(magic_token, &client);
        return;
    }
    else if (client.status != CLIENT_CONNECTED)
    {
        return;
    }

    switch (message.getId())
    {
        case PGMSG_SAY:
            handleSay(client, message);
            break;

        case PGMSG_NPC_TALK:
        case PGMSG_NPC_TALK_NEXT:
        case PGMSG_NPC_SELECT:
        case PGMSG_NPC_NUMBER:
        case PGMSG_NPC_STRING:
            handleNpc(client, message);
            break;

        case PGMSG_PICKUP:
            handlePickup(client, message);
            break;

        case PGMSG_USE_ITEM:
            handleUseItem(client, message);
            break;

        case PGMSG_DROP:
            handleDrop(client, message);
            break;

        case PGMSG_WALK:
            handleWalk(client, message);
            break;

        case PGMSG_EQUIP:
            handleEquip(client, message);
            break;

        case PGMSG_UNEQUIP:
            handleUnequip(client, message);
            break;

        case PGMSG_MOVE_ITEM:
            handleMoveItem(client, message);
            break;

        case PGMSG_ATTACK:
            handleAttack(client, message);
            break;

        case PGMSG_USE_SPECIAL_ON_BEING:
            handleUseSpecialOnBeing(client, message);
            break;

        case PGMSG_USE_SPECIAL_ON_POINT:
            handleUseSpecialOnPoint(client, message);
            break;

        case PGMSG_ACTION_CHANGE:
            handleActionChange(client, message);
            break;

        case PGMSG_DIRECTION_CHANGE:
            handleDirectionChange(client, message);
            break;

        case PGMSG_DISCONNECT:
            handleDisconnect(client, message);
            break;

        case PGMSG_TRADE_REQUEST:
            handleTradeRequest(client, message);
            break;

        case PGMSG_TRADE_CANCEL:
        case PGMSG_TRADE_AGREED:
        case PGMSG_TRADE_CONFIRM:
        case PGMSG_TRADE_ADD_ITEM:
        case PGMSG_TRADE_SET_MONEY:
            handleTrade(client, message);
            break;

        case PGMSG_NPC_BUYSELL:
            handleNpcBuySell(client, message);
            break;

        case PGMSG_RAISE_ATTRIBUTE:
            handleRaiseAttribute(client, message);
            break;

        case PGMSG_LOWER_ATTRIBUTE:
            handleLowerAttribute(client, message);
            break;

        case PGMSG_RESPAWN:
            // plausibility check is done by character class
            client.character->respawn();
            break;

        case PGMSG_NPC_POST_SEND:
            handleNpcPostSend(client, message);
            break;

        case PGMSG_PARTY_INVITE:
            handlePartyInvite(client, message);
            break;

        case PGMSG_BEING_EMOTE:
            handleTriggerEmoticon(client, message);
            break;

        default:
            LOG_WARN("Invalid message type");
            client.send(MessageOut(XXMSG_INVALID));
            break;
    }
}
int CListManager::LoadShapeArray(CString loadDir, int freeExisting)
{

	int ret = TRUE;
	FILE* fptr = fopen(LPCTSTR(loadDir),"rb");
	if (fptr != NULL) {

				

				long fileversion = 0;
				fread( (void *) &fileversion, sizeof(long), 1, fptr );		

				int max = 0;
				fread( (void *) &max, sizeof(int), 1, fptr ); //Number of Shapes

				int reserve[100];
				for (int j=0;j<100;j++)
					fread( (void *) &reserve[j], sizeof(int), 1, fptr ); //Reserve Bytes

				//Testing
				int failtest = 0;
				if (reserve[0]!='c')  failtest=1;
				if (reserve[1]!='s')  failtest=1;
				if (reserve[2]!='h')  failtest=1;
				if (reserve[3]!='a')  failtest=1;
				if (reserve[4]!='p')  failtest=1;
				if (reserve[5]!='e')  failtest=1;

				if (failtest)
				{
					//MessageBox(NULL,"Invalid shape file CamShapes.ini","Note",MB_OK | MB_ICONEXCLAMATION);
					MessageOut(NULL,IDS_STRINGINSHAPEFILE,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
					fclose(fptr);
					return  FALSE;

				}
				
				if ((max>0) && (max<100000))
				{
					if (freeExisting)
						FreeShapeArray();
					for (int i=0; i<max ; i++)
					{

						CTransparentWnd * itemWnd = new CTransparentWnd;
						if (itemWnd)
						{
							if (!itemWnd->LoadShape(fptr))
							{
								ret = FALSE;
								break;
							}
							else
							{

								CString pTitle(itemWnd->m_shapeStr);
								itemWnd->CreateEx(	WS_EX_TOPMOST ,	
													AfxRegisterWndClass(0),
													LPCTSTR(pTitle),
													WS_POPUP | WS_SYSMENU,
													itemWnd->m_rectWnd,
													NULL,
													NULL,
													NULL );	

								AddShapeArray(itemWnd);
							}

						}

					}


				}
	

		fclose(fptr);

	}
	else 
	{

		//Silent Mode
		//MessageBox(NULL,"Error opening shape file for loading","Note",MB_OK | MB_ICONEXCLAMATION);

	}


	return ret;
}
Exemplo n.º 14
0
// Play audio, starting at a given frame/sample
BOOL CALLBACK aviaudioPlay(HWND hwnd, PAVISTREAM pavi, LONG lStart, LONG lEnd, BOOL fWait)
{
	if (audioPlayable <= 0)
		return FALSE;

	//CString tx;
	//tx.Format("audioPlayable %d",audioPlayable);
	//MessageBox(NULL,tx,"Note",MB_OK);

	recalc = 1;

//	CString msx;
	if (lStart < 0)
		lStart = AVIStreamStart(pavi);

    if (lEnd < 0)
		lEnd = AVIStreamEnd(pavi);

    if (lEnd <= lStart) {
		return FALSE;
	}

    if (!aviaudioOpenDevice(hwnd, pavi)) {
		if ((runmode == 0) || (runmode == 1)) {
			//MessageBox(NULL,"AudioOpen failed","Note",MB_OK | MB_ICONEXCLAMATION);
			 MessageOut(NULL,IDS_AOF, IDS_NOTE, MB_OK | MB_ICONEXCLAMATION);
		}

		return FALSE;
	}

    if (!sfPlaying) {
		// We're beginning play, so pause until we've filled the buffers
		// for a seamless start
		waveOutPause(shWaveOut);

		slBegin = lStart;
		slCurrent = lStart;
		slEnd = lEnd;
		sfPlaying = TRUE;
    } else {
		slEnd = lEnd;
    }

	//ErrMsg("playbegin");

	//Error here -- program crash when play at non start time after steam is pasted
    aviaudioiFillBuffers();

	//ErrMsg("play");

    // Now unpause the audio and away it goes!
    waveOutRestart(shWaveOut);

    // Caller wants us not to return until play is finished
    if (fWait) {
		while (swBuffersOut > 0)
			Yield();
    }

    return TRUE;
}
Exemplo n.º 15
0
Arquivo: Linker.cpp Projeto: Madzi/POW
void WriteMessageToPow(WORD msgNr, char *str1, char *str2)
{
	char msgBuf[256];
	BOOL	shwMsg= TRUE;

	memset(msgBuf, 0x00, 256);

	switch(msgNr)		// Ausschalten von Linkermeldungen
	{
		/*********************************************/
		/*** Meldungen während des Programmablaufs ***/
		/*********************************************/

		//case INF_MSG_INI:											// Intilisierungsmeldung
		//case INF_MSG_RES_SYM:							// Symbole auflösen
		//case INF_MSG_FRE_LIB:							// Freigeben der Libraries
		//case INF_MSG_CON_SEC_FRG:			// Zusammensetzen der Sektionsfragmente
		//case INF_MSG_RES_REL:							// Auflösen der Relokationen
		//case INF_MSG_BLD_DBG:							// Erstellen der Debugsektion
		//case INF_MSG_WRT_PE:								// Schreiben der PE-Datei
		//case INF_MSG_FRE_MEM:							// Freigeben des Speichers

		/********************************************************************/
		/*** Meldungen, die keiner bestimmten Linkphase zugeordnet werden ***/
		/********************************************************************/

		case INF_MSG_FIL_OPE_SUC:			// Erfolgreiches Öffnen einer Datei

		/*************************************************/
		/*** Meldungen beim Initialisieren des Linkers ***/
		/*************************************************/

		/*******************************************/
		/*** Meldungen beim Auflösen der Symbole ***/	
		/*******************************************/
		
		//	case	WRN_MSGS_NO_SYM:						// Symbol wurde durch andere Anzahl von _ aufgelöst
		//	case	WRN_MSGS_UNK_DEB_SEC:	// Unbekannte Debugsektion (nicht $S, $T oder $F)
		//	case	INF_MSGS_UNI_VAR:					// Uninitialisierte Variable vorhanden, mögliche Fehlerquelle

		/********************************************************/
		/*** Meldungen beim Analysieren der Objektdateien				 ***/
		/********************************************************/

		//case WRN_MSGIS_DRC:									shwMsg= shwDRCMsg;

		/***********************************************************/
		/*** Meldungen beim Zusammensetzen der Sektionsfragmente ***/
		/***********************************************************/

		/************************************************/
		/*** Meldungen beim Auflösen der Relokationen ***/
		/************************************************/

		//case WRN_MSGR_NO_DLL_DBG_INF:			// Bei einem DLL-Entry konnte die Debuginformation nicht gefunden werden
		//case WRN_MSGR_SMA_FRG:										// Falsches Alignment in einem Sektionsfragment

		/************************************************************/
		/*** Meldungen beim beim Erstellen der Debuginformationen ***/
		/************************************************************/

		//case WRN_MSGD_CHG_VC5_TO_CV4:	// Änderung CV5 zu CV4
		//case WRN_MSGD_CHG_VC4_TO_CV5:	// Änderung CV4 zu CV5

		//case WRN_MSGD_WRO_ALN:									// Fehler im Alignment eines CV-Moduls-> fehlerhafte Debuginformation
		case WRN_MSGD_NO_SYM_IND:						// Ein Symbolindex konnte nicht zugeordnet werden	
		case WRN_MSGD_NO_TYP_IND:						// Ein Symobltyp konnte nicht zugeordnet werden
		//case WRN_MSGD_WRO_CVS_FOR:					// Unbekannte CV-Format (nicht CV4 oder CV5)
		case WRN_MSGD_CV129_NO_SYM:				// Die Debuginformationen eines Symobls in 0x129 konnten nicht gefunden werden
		
		/*********************************************/
		/*** Meldungen beim Schreiben der PE-Datei ***/
		/*********************************************/

		/**************************/
		/*** Sonstige Meldungen ***/
		/**************************/

		//case MSG_NUL:	      // Ausgabe einer beliebigen Meldung


		/******************************/
		/*** Heap Kontrollmeldungen ***/
		/******************************/
		
		case MSG_HEAP_BADBEGIN:		// Ungültiger Heapanfang
		case MSG_HEAP_BADNODE:			// Ungültiger Knoten
		case	MSG_HEAP_BADPTR:				//	Ungültiger Heappointer
		case	MSG_HEAP_EMPTY:					// Leerer Heap
		case	MSG_HEAP_OK:								// Korrekter Heap
		case	MSG_HEAP_END:							// Ungültiges Heapende
		case	MSG_HEAP_UNKNOWN:			// Unbekannte Heapmeldung

				shwMsg= FALSE;
			break;

		default: ;
	}



	switch(msgNr)
	{
		/****************************************/
		/*** Es wird keine Meldung ausgegeben ***/
		/****************************************/

		case NO_MSG: break;
		
		/*********************************************/
		/*** Meldungen während des Programmablaufs ***/
		/*********************************************/

		case INF_MSG_INI:									strcpy(msgBuf, "Linker Message: Init Linker!"); break;
		case INF_MSG_RES_SYM:					strcpy(msgBuf, "Linker Message: Resolve Symbols!"); break;
		case INF_MSG_FRE_LIB:					strcpy(msgBuf, "Linker Message: Free Libraries!"); break;
		case INF_MSG_CON_SEC_FRG:	strcpy(msgBuf, "Linker Message: Connect Section Fragments!"); break;
		case INF_MSG_RES_REL:					strcpy(msgBuf, "Linker Message: Resolve Relocations!"); break;
		case INF_MSG_BLD_DBG:					strcpy(msgBuf, "Linker Message: Build Debuginformation!"); break;
		case INF_MSG_WRT_PE:						strcpy(msgBuf, "Linker Message: Write PE-File!"); break;
		case INF_MSG_FRE_MEM:					strcpy(msgBuf, "Linker Message: Free Memory!"); break;

		/********************************************************************/
		/*** Meldungen, die keiner bestimmten Linkphase zugeordnet werden ***/
		/********************************************************************/

		case INF_MSG_FIL_OPE_SUC:	wsprintf(msgBuf, "Linker Message: File %s was opened successfully!", str1);	break;

		/*************************************************/
		/*** Meldungen beim Initialisieren des Linkers ***/
		/*************************************************/

		case ERR_MSGI_NO_LIB:					strcpy(msgBuf,   "*** Linker Error ***: No Library in Project!"); break;
		case	ERR_MSGI_NO_OBJ:					strcpy(msgBuf,   "*** Linker Error ***: No Object File in Project!"); break;
		case ERR_MSGI_NO_STA_SYM:	wsprintf(msgBuf, "*** Linker Error ***: Startup Symbol %s not Found!", str1);	break;
		case	ERR_MSGI_NO_EXP_SYM:	wsprintf(msgBuf, "*** Linker Error ***: Exported Symbol %s not Found!", str1);	break;
		
		case ERR_MSGI_OPN_LIB:				wsprintf(msgBuf, "*** Linker Error ***: Library %s not found!", str1);	break;
		case ERR_MSGI_OPN_OBJ:				wsprintf(msgBuf, "*** Linker Error ***: Object File %s not found!", str1);	break;


		/*******************************************/
		/*** Meldungen beim Auflösen der Symbole ***/	
		/*******************************************/
		
		case	ERR_MSGS_NO_SYM:						wsprintf(msgBuf, "*** Linker Error ***: Symbol %s in %s not resolved!", str1, str2);	break;
		case	ERR_MSGS_NO_DLL_SYM:		wsprintf(msgBuf, "*** Linker Error ***: DLL Symbol %s not resolved!", str1);	break;

		case	WRN_MSGS_NO_SYM:						wsprintf(msgBuf, "*** Linker Warning ***: Symbol %s  was resolved by %s!", str1, str2);	break;
		case	WRN_MSGS_UNK_DEB_SEC:	wsprintf(msgBuf, "*** Linker Warning ***: Unknown Debugsection %s occured!", str1);	break;
						
		case	INF_MSGS_UNI_VAR:					wsprintf(msgBuf, "Linker Message: Unitialized Variable %s found!", str1);	break;

		/********************************************************/
		/*** Meldungen beim Analysieren der Objektdateien				 ***/
		/********************************************************/

		case ERR_MSGIS_NEW_SEC_TYP: wsprintf(msgBuf, "*** Linker Error: New section type [%s] found in %s!", str1, str2); break;
		case ERR_MSGIS_WRG_MAC:					wsprintf(msgBuf, "*** Linker Error: Wrong machine type in COFF-file %s!", str1); break;
		case ERR_MSGIS_NO_IMP_SYM:		wsprintf(msgBuf, "*** Linker Error: DLL Importsymbol in %s not found!", str1); break;
		
		
		case WRN_MSGIS_DRC:									shwMsg= shwDRCMsg;
																														wsprintf(msgBuf, "Linker Message: .DRECTVE Sektion in %s ignored!", str1); break;


		/***********************************************************/
		/*** Meldungen beim Zusammensetzen der Sektionsfragmente ***/
		/***********************************************************/

		case ERR_MSGC_OPN_RES:						wsprintf(msgBuf, "*** Linker Error ***: Resource File %s not found!", str1);	break;
		case ERR_MSGC_NO_WIN32_RES:	wsprintf(msgBuf, "*** Linker Error ***: %s isn't a Win32 Resource File!", str1);	break;
		
		case BLD_MSGC_BLD_IMP_LIB	:	wsprintf(msgBuf, "--- Build Message --: DLL Import Library %s was created!", str1);	break;		
		case BLD_MSGC_BLD_EXP_FIL	:	wsprintf(msgBuf, "--- Build Message --: DLL Export File %s was created!", str1);	break;		
				 
		case WRN_MSGC_BLD_IMP_LIB:		wsprintf(msgBuf, "*** Linker Warning ***: Unable to create DLL Import Library %s!", str1);	break;		
		case WRN_MSGC_BLD_EXP_FIL:		wsprintf(msgBuf, "*** Linker Warning ***: Unable to create DLL Export File %s!", str1);	break;		

		case	WRN_MSGC_NO_IMP_DES:			wsprintf(msgBuf, "Unable to write Import Descriptor %s in .edata Section!", str1);	break;	


		/************************************************/
		/*** Meldungen beim Auflösen der Relokationen ***/
		/************************************************/

		case ERR_MSGR_NO_SEC_FRG:					wsprintf(msgBuf, "Beim Symbol %s fehlt der Zeiger auf actFrgEnt", str1);	break;
		case ERR_MSGR_DIR32:										wsprintf(msgBuf, "DIR32 address - %s - couldn't be resolved", str1);	break;
		case ERR_MSGR_DIR32NB:								wsprintf(msgBuf, "DIR32NB address - %s - couldn't be resolved", str1);	break;
		case ERR_MSGR_SECTION:								wsprintf(msgBuf, "SECTION address - %s - konnte nicht aufgelöst werden", str1);	break;
		case ERR_MSGR_SECREL:									wsprintf(msgBuf, "SECREL address - %s - couldn't be resolved", str1);	break;
		case ERR_MSGR_REL32:										wsprintf(msgBuf, "REL32 address - %s - couldn't be resolved", str1);	break;
		case ERR_MSGR_NEW_REL:								wsprintf(msgBuf, "*** Linker Error: Unknown relocation type (0x%s) was found!", str1);	break;
		
		case WRN_MSGR_NO_DLL_DBG_INF:	wsprintf(msgBuf, "*** Linker Warning: No Debuginformation for Dll-Entry %s from DLL %s", str1, str2);	break;
		
		case WRN_MSGR_SMA_FRG:				strcpy(msgBuf, "*** Linker Warning ***: Section Fragment to small!"); break;
		case WRN_MSGR_SHIT:		    		strcpy(msgBuf, "*** Linker Warning ***: could not calc offset of symbol"); break;

		/************************************************************/
		/*** Meldungen beim beim Erstellen der Debuginformationen ***/
		/************************************************************/

		case WRN_MSGD_CHG_VC5_TO_CV4:	strcpy(msgBuf, "*** Linker Warning ***: CV5 Debuginformation ignored, target is CV4!"); break;
		case WRN_MSGD_CHG_VC4_TO_CV5:	strcpy(msgBuf, "*** Linker Warning ***: CV4 Debuginformation changed to target CV5!"); break;

		case WRN_MSGD_WRO_ALN							:	wsprintf(msgBuf, "*** Linker Warning ***: Wrong Alignment in CV-Module %s, incorrect Debuginformtion possible", str1); break;
		case WRN_MSGD_NO_SYM_IND				:	wsprintf(msgBuf, "Symbol Index %s in Objectfile %s couldn't be resolved", str1, str2);	break;
		case WRN_MSGD_NO_TYP_IND				:	wsprintf(msgBuf, "Type Index %s in Objectfile %s couldn't be resolved", str1, str2);	break;
		case WRN_MSGD_WRO_CVS_FOR			:	wsprintf(msgBuf, "Objectfile Section .debug$S in %s includes unknown Debugformat", str1);	break;	
		case WRN_MSGD_CV129_NO_SYM		:	wsprintf(msgBuf, "Debugsymbol %s in CV-Modul 0x129 couldn't be resolved", str1);	break;	
		
		/*********************************************/
		/*** Meldungen beim Schreiben der PE-Datei ***/
		/*********************************************/

		case ERR_MSGB_OPN_EXE:		wsprintf(msgBuf, "The file %s couldn't be written", str1);	break;
			
		/**************************/
		/*** Sonstige Meldungen ***/
		/**************************/

		case MSG_NUL:	strcpy(msgBuf, str1); break;


		/******************************/
		/*** Heap Kontrollmeldungen ***/
		/******************************/
		
		case MSG_HEAP_BADBEGIN:	strcpy(msgBuf, "Heap Message: Bad Begin!"); break;
		case MSG_HEAP_BADNODE:		strcpy(msgBuf, "Heap Message: Bad Node!"); break;
		case	MSG_HEAP_BADPTR:			strcpy(msgBuf, "Heap Message: Bad Pointer!"); break;
		case	MSG_HEAP_EMPTY:				strcpy(msgBuf, "Heap Message: Heap Emtpy!"); break;
		case	MSG_HEAP_OK:							strcpy(msgBuf, "Heap Message: Heap Ok!"); break;
		case	MSG_HEAP_END:						strcpy(msgBuf, "Heap Message: Heap End!"); break;
		case	MSG_HEAP_UNKNOWN:		strcpy(msgBuf, "Heap Message: Unknown Message!"); break;

		
		/*********************************/
		/*** Unbekannte Meldungsnummer ***/
		/*********************************/

		default:	strcpy(msgBuf, "Linker Message: Unknown Message Id!");
	}

	if (shwMsg)
	{
		if (ErrMsgPrc)
			MessageOut(ErrMsgPrc, msgBuf);
		else
			printf("\n%s", msgBuf);
	}
}
int CListManager::LoadLayout(CString loadDir)
{


	int ret = TRUE;
	FILE* fptr = fopen(LPCTSTR(loadDir),"rb");
	if (fptr != NULL) {
			

				long fileversion = 0;
				fread( (void *) &fileversion, sizeof(long), 1, fptr );		

				int max = 0;
				fread( (void *) &max, sizeof(int), 1, fptr ); //Number of Layouts

				int reserve[100];
				for (int j=0;j<100;j++)
					fread( (void *) &reserve[j], sizeof(int), 1, fptr ); //Reserve Bytes


				//Testing
				int failtest = 0;
				if (reserve[0]!='c')  failtest=1;
				if (reserve[1]!='l')  failtest=1;
				if (reserve[2]!='a')  failtest=1;
				if (reserve[3]!='y')  failtest=1;
				if (reserve[4]!='o')  failtest=1;
				if (reserve[5]!='u')  failtest=1;
				if (reserve[6]!='t')  failtest=1;

				if (failtest)
				{
					//MessageBox(NULL,"Invalid layout file CamLayout.ini","Note",MB_OK | MB_ICONEXCLAMATION);
					MessageOut(NULL,IDS_STRINGINVLAYOUTFILE,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);

					fclose(fptr);
					return  FALSE;
				}

				
								
				if ((max>0) && (max<100000))
				{

					FreeLayoutArray();
					for (int i=0; i<max ; i++)
					{

						CLayoutList * itemLayout = new CLayoutList;
						if (itemLayout)
						{
							if (!itemLayout->LoadLayoutFromFile(fptr))
							{
								ret = FALSE;
								break;
							}
							
							AddLayoutArray(itemLayout);

						}

					}


				}
	

		fclose(fptr);

	}
	else 
	{
		//Silent Mode
		//MessageBox(NULL,"Error opening layout file for loading","Note",MB_OK | MB_ICONEXCLAMATION);

	}


	return ret;
}
Exemplo n.º 17
0
void CFlashInterface::OnOK()
{

	CString foxStr,foyStr;
	((CEdit *) GetDlgItem(IDC_FRAMEOFFSETX))->GetWindowText(foxStr);
	((CEdit *) GetDlgItem(IDC_FRAMEOFFSETY))->GetWindowText(foyStr);

	int lfox,lfoy;
	sscanf(LPCTSTR(foxStr),"%d",&lfox);
	sscanf(LPCTSTR(foyStr),"%d",&lfoy);

	int foxValid = 1;
	int foyValid = 1;
	if (lfox < 0)
	{
		MessageOut(this->m_hWnd,IDS_FOXERRSTR, IDS_NOTE, MB_OK | MB_ICONEXCLAMATION);
		foxValid = 0;

		//Question : how to return from a property sheet?
		//return only return this page .. and not the others

	}

	if (lfoy < 0)
	{
		MessageOut(this->m_hWnd,IDS_FOYERRSTR, IDS_NOTE, MB_OK | MB_ICONEXCLAMATION);
		foyValid = 0;
	}

	if (lfox > 200)
	{
		MessageOut(this->m_hWnd,IDS_FOXERRLESS, IDS_NOTE, MB_OK | MB_ICONEXCLAMATION);
		foxValid = 0;
	}

	if (lfoy > 200)
	{
		MessageOut(this->m_hWnd,IDS_FOYERRLESS, IDS_NOTE, MB_OK | MB_ICONEXCLAMATION);
		foyValid = 0;
	}

	if (foxValid)
		FrameOffsetX = lfox ;

	if (foyValid)
		FrameOffsetY = lfoy ;

	swfbk_red = local_swfbk_red;
	swfbk_green = local_swfbk_green;
	swfbk_blue = local_swfbk_blue;

	//MsgC("swfbk_red %d",swfbk_red);
	//MsgC("swfbk_green %d",swfbk_green);
	//MsgC("swfbk_blue %d",swfbk_blue);

	((CEdit *)GetDlgItem(IDC_PRELOADBITMAP))->GetWindowText(loadingPath);

	int spinpos = ((CSpinButtonCtrl *) GetDlgItem(IDC_SPIN1))->GetPos();
	percentLoadedThreshold = ((double) spinpos) / 100.0;

	CPropertyPage::OnOK();
}
Exemplo n.º 18
0
void CAudioFormatDlg::OnVolume()
{
	// Ver 1.1
	if (waveInGetNumDevs() == 0) {
		//CString msgstr;
		//msgstr.Format("Unable to detect audio input device. You need a sound card with microphone input.");
		//MessageBox(msgstr,"Note", MB_OK | MB_ICONEXCLAMATION);
		MessageOut(this->m_hWnd,IDS_STRING_NOINPUT1 ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		return;
	}

	TCHAR dirx[300];
	GetWindowsDirectory(dirx,300);
	CString Windir(dirx);

	//Test Windows\sndvol32.exe
	CString exeFileName("\\sndvol32.exe");
	CString AppDir = Windir;
	CString SubDir = "";
	CString testLaunchPath = AppDir + SubDir + exeFileName;

	CString launchPath("");
	if (launchPath == "") {
		//Verify sndvol32.exe exists
		OFSTRUCT ofs;
		HFILE hdir = OpenFile(testLaunchPath, &ofs, OF_EXIST);
		if (hdir != HFILE_ERROR) {
			launchPath=testLaunchPath;
		}
		CloseHandle((HANDLE)hdir);
	}

	if (launchPath == "") {
		//Test Windows\system32\sndvol32.exe
		//Verify sndvol32.exe exists
		SubDir = "\\system32";
		testLaunchPath = AppDir + SubDir + exeFileName;
		OFSTRUCT ofs;
		HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST);
		if (hdir != HFILE_ERROR) {
			launchPath = testLaunchPath;
		}
		CloseHandle((HANDLE)hdir);
	}

	if (launchPath == "") {
		//Test Windows\system\sndvol32.exe
		//Verify sndvol32.exe exists
		SubDir = "\\system32";
		testLaunchPath = AppDir + SubDir + exeFileName;
		OFSTRUCT ofs;
		HFILE hdir = OpenFile(testLaunchPath, &ofs,OF_EXIST);
		if (hdir != HFILE_ERROR) {
			launchPath = testLaunchPath;
		}
		CloseHandle((HANDLE)hdir);
	}

	if (launchPath != "") { //launch Volume Control
		//not sure
		launchPath = launchPath + " /r /rec /record";

		if (WinExec(launchPath,SW_SHOW) != 0) {
		} else {
			//MessageBox("Error launching Volume Control!","Note",MB_OK | MB_ICONEXCLAMATION);
			MessageOut(this->m_hWnd,IDS_STRING_ERRVOLCTRL1 ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		}
	}
	// Sound mixer moved in Windows Vista! check new exe name only if windows version matches
	OSVERSIONINFO osinfo;
	osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
	if (GetVersionEx((LPOSVERSIONINFO) &osinfo))
	{
		if (osinfo.dwMajorVersion >= 6) //Vista
		{
			testLaunchPath = AppDir + SubDir + "\\SndVol.exe";
			OFSTRUCT ofs;
			HFILE hdir = OpenFile(testLaunchPath, &ofs, OF_EXIST);
			if (hdir != HFILE_ERROR) {
				launchPath=testLaunchPath;
			}
		}
	}

		if (launchPath != "") { //launch Volume Control
		//not sure
		launchPath = launchPath + " /r /rec /record";

		if (WinExec(launchPath,SW_SHOW) != 0) {
		} else {
			//MessageBox("Error launching Volume Control!","Note",MB_OK | MB_ICONEXCLAMATION);
			MessageOut(this->m_hWnd,IDS_STRING_ERRVOLCTRL1 ,IDS_STRING_NOTE,MB_OK | MB_ICONEXCLAMATION);
		}
	}
}
Exemplo n.º 19
0
void AccountClient::requestRegistrationInfo()
{
    send(MessageOut(PAMSG_REQUEST_REGISTER_INFO));
}