farming

I use DirectShow to capture and paly video. As I used windowless mode, I developed a MFC-dialog application using VS2005, and put a Picture Control on the dialog panel. I set it a membership variable, CStatic m_hVideoWindow. After I intialized all interface instances of DirctShow, I added SetVideoPosition() method to control the video position, but there were error on function SetRect(). My method is:
after SetVideoClippingWindow, I wrote:
hr = pWC->GetNativeVideoSize(&lWidth,&lHeight,NULL,NULL);
then I set the source and destined rectangle :
RECT rcSrc,rcDest;
SetRect(&rcSrc, 0, 0, lWidth/2, lHeight/2);
GetClientRect(m_hVideoWindow.m_hWnd, &rcDest);
SetRect(&rcDest, 0, 0, rcDest.right/2, rcDest.bottom/2);
hr = pWC->SetVideoPosition(&rcSrc, &rcDest);

But, there it said error in those lines as following:
webcamex5dlg.cpp(322) : error C3872: '0x3000': this character is not allowed in an identifier
webcamex5dlg.cpp(323) : error C3872: '0x3000': this character is not allowed in an identifier
webcamex5dlg.cpp(323) : error C2065: 'กก' : undeclared identifier
webcamex5dlg.cpp(323) : error C2146: syntax error : missing ';' before identifier 'กก'
webcamex5dlg.cpp(323) : error C2146: syntax error : missing ';' before identifier 'GetClientRect'
webcamex5dlg.cpp(323) : error C2660: 'CWnd::GetClientRect' : function does not take 2 arguments
webcamex5dlg.cpp(324) : error C3872: '0x3000': this character is not allowed in an identifier
webcamex5dlg.cpp(325) : error C3872: '0x3000': this character is not allowed in an identifier
webcamex5dlg.cpp(325) : error C2146: syntax error : missing ';' before identifier 'กก'
webcamex5dlg.cpp(325) : error C2146: syntax error : missing ';' before identifier 'SetRect'
webcamex5dlg.cpp(327) : error C3872: '0x3000': this character is not allowed in an identifier
webcamex5dlg.cpp(328) : error C3872: '0x3000': this character is not allowed in an identifier
webcamex5dlg.cpp(328) : error C2146: syntax error : missing ';' before identifier 'กก'

It show there were some wrong in using SetRect and GetClientRect methods. How to revise
these code


Re: Visual C++ General How to use Rect variables

Bite Qiu - MSFT

hello

re: how to use Rect variables

Note that such questions aren't at home in this forum. While many are being helped, it's generally considered off topic. I'd like to give some opinion as below, but if you have further question, post them in right place.

It seems you want to use ::GetClientRect rather than CWnd::GetClientRect, note that these two method has different parameter list

::GetClientRect:

BOOL GetClientRect(

HWND hWnd,
LPRECT lpRect
);

CWnd::GetClientRect:

void GetClientRect(

LPRECT lpRect

) const;

OTP

thanks

bite

 





Re: Visual C++ General How to use Rect variables

farming

Thanks. It works.