Click here to Skip to main content
16,020,519 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: Font size in ListBox?????? Pin
Nelek15-Nov-07 3:07
protectorNelek15-Nov-07 3:07 
QuestionRe: Font size in ListBox?????? Pin
CPallini15-Nov-07 0:31
mveCPallini15-Nov-07 0:31 
AnswerRe: Font size in ListBox?????? Pin
Hamid Taebi15-Nov-07 2:59
professionalHamid Taebi15-Nov-07 2:59 
JokeRe: Font size in ListBox?????? Pin
CPallini15-Nov-07 4:04
mveCPallini15-Nov-07 4:04 
GeneralRe: Font size in ListBox?????? Pin
Naveen15-Nov-07 0:36
Naveen15-Nov-07 0:36 
GeneralRe: Font size in ListBox?????? Pin
Hamid Taebi15-Nov-07 2:59
professionalHamid Taebi15-Nov-07 2:59 
GeneralRe: Font size in ListBox?????? Pin
David Crow15-Nov-07 8:49
David Crow15-Nov-07 8:49 
QuestionWhy I meet a mistake when I play a WMV file using mciSendCommand? Pin
whiteclouds14-Nov-07 23:56
whiteclouds14-Nov-07 23:56 
Hi! Everyone!
Now I'm developing an application which will play a .wmv file. I do it using mciSendCommand. But a mistake will happen sometimes. The description of it is: "the alias had been used by other program, plz use the unique alias."
This mistake can't happen everytime. The application was executed only once. So it isn't make by two program executing at same time. I hope someone can tell me the reason and how to resolve it. Thx!
The code is as below:
<br />
	MCI_DGV_OPEN_PARMS mciOpen;<br />
	MCI_DGV_STATUS_PARMS mciStatus;<br />
	UINT uDeviceID;<br />
	HWND hwndVideo;<br />
	RECT video_rect;<br />
	//<br />
	ZeroMemory(&mciOpen,sizeof(MCI_DGV_OPEN_PARMS));<br />
	mciStatus.dwItem=MCI_DGV_STATUS_HWND;<br />
	mciOpen.lpstrAlias=_T("thevideo");<br />
	mciOpen.lpstrElementName=(LPWSTR)m_szVideoName.GetString();<br />
	mciOpen.hWndParent=this->m_hWnd;<br />
	mciOpen.dwCallback=(DWORD)this->m_hWnd;<br />
	mciOpen.dwStyle=WS_CHILD;<br />
	//<br />
	DWORD ret = mciSendCommand(0,MCI_OPEN,MCI_OPEN_ALIAS|MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN_WS,(DWORD)&mciOpen);<br />
	if(ret != 0)<br />
	{<br />
		CString dbg_str;<br />
		wchar_t str[100];<br />
		CMajoyComLog::WriteDefaultLog(L"Can't open this file:"+m_szVideoName);<br />
		mciGetErrorString(ret,str,100);<br />
		dbg_str.Format(_T("Error occured:%s"),str);<br />
		CMajoyComLog::WriteDefaultLog(dbg_str);<br />
		MessageBox(m_szVideoName + _T("Can not open Media File"));<br />
		return 0;<br />
	}<br />
	else<br />
	{<br />
		uDeviceID=mciOpen.wDeviceID;<br />
		mciSendCommand(uDeviceID,MCI_STATUS,MCI_STATUS_ITEM,(DWORD)&mciStatus);<br />
		hwndVideo=(HWND)mciStatus.dwReturn;<br />
		// Window position.<br />
		::GetClientRect(hwndVideo,&video_rect);<br />
		//::SetWindowPos(hwndVideo,HWND_TOP,<br />
		//	video_rect.left,video_rect.top,video_rect.right-video_rect.left,video_rect.bottom-video_rect.top,<br />
		//	SWP_SHOWWINDOW|SWP_DEFERERASE);<br />
		//RECT rc;<br />
		//GetWindowRect(&rc);<br />
		//SetWindowPos(&wndTop,<br />
		//	rc.left,rc.top,video_rect.right-video_rect.left,video_rect.bottom-video_rect.top,<br />
		//	SWP_SHOWWINDOW|SWP_NOREDRAW);<br />
		ShowWindow(SW_SHOW);<br />
		UpdateWindow();<br />
	}<br />
	mciSendString(_T("play thevideo"), 0, 0, 0);<br />
	GetParent()->PostMessageW(WM_VIDEO_START);<br />
	SetTimer(1,1000,NULL);<br />
<br />
	m_szVideoName.ReleaseBuffer();<br />

QuestionMemory Problem? Pin
bankey101014-Nov-07 23:50
bankey101014-Nov-07 23:50 
GeneralRe: Memory Problem? Pin
Matthew Faithfull15-Nov-07 0:33
Matthew Faithfull15-Nov-07 0:33 
AnswerRe: Memory Problem? Pin
Nibu babu thomas15-Nov-07 0:48
Nibu babu thomas15-Nov-07 0:48 
AnswerRe: Memory Problem? Pin
Mark Salsbery15-Nov-07 7:30
Mark Salsbery15-Nov-07 7:30 
QuestionPerformance Profiler For Visual C ++ 6.0 Pin
quantimizer14-Nov-07 23:43
quantimizer14-Nov-07 23:43 
GeneralRe: Performance Profiler For Visual C ++ 6.0 Pin
Matthew Faithfull15-Nov-07 0:28
Matthew Faithfull15-Nov-07 0:28 
AnswerRe: Performance Profiler For Visual C ++ 6.0 Pin
Blake Miller16-Nov-07 4:36
Blake Miller16-Nov-07 4:36 
Questionhow to send message to a window to inform that it has focus Pin
calvfoo14-Nov-07 23:37
calvfoo14-Nov-07 23:37 
AnswerRe: how to send message to a window to inform that it has focus Pin
Malli_S15-Nov-07 0:23
Malli_S15-Nov-07 0:23 
QuestionURGENT need help with c programming struct pointer Pin
neodeaths14-Nov-07 23:34
neodeaths14-Nov-07 23:34 
AnswerRe: URGENT need help with c programming struct pointer Pin
CPallini14-Nov-07 23:43
mveCPallini14-Nov-07 23:43 
GeneralRe: URGENT need help with c programming struct pointer Pin
neodeaths14-Nov-07 23:47
neodeaths14-Nov-07 23:47 
GeneralRe: URGENT need help with c programming struct pointer Pin
CPallini15-Nov-07 0:11
mveCPallini15-Nov-07 0:11 
AnswerRe: URGENT need help with c programming struct pointer Pin
David Crow15-Nov-07 8:53
David Crow15-Nov-07 8:53 
Questionsetting the text color for checkbox caption Pin
subramanyeswari14-Nov-07 23:29
subramanyeswari14-Nov-07 23:29 
JokeRe: setting the text color for checkbox caption Pin
Nelek15-Nov-07 0:23
protectorNelek15-Nov-07 0:23 
GeneralRe: setting the text color for checkbox caption [modified] Pin
subramanyeswari15-Nov-07 19:44
subramanyeswari15-Nov-07 19:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.