Click here to Skip to main content
15,888,733 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to delete entry in start menu? Pin
fggfhfhgfg28-Sep-05 2:58
fggfhfhgfg28-Sep-05 2:58 
AnswerRe: How to delete entry in start menu? Pin
David Crow28-Sep-05 3:13
David Crow28-Sep-05 3:13 
GeneralRe: How to delete entry in start menu? Pin
Arno The Avatar28-Sep-05 4:05
sussArno The Avatar28-Sep-05 4:05 
QuestionHelp me with displaying capture image Pin
SimCom28-Sep-05 2:06
SimCom28-Sep-05 2:06 
AnswerRe: Help me with displaying capture image Pin
Cedric Moonen28-Sep-05 2:26
Cedric Moonen28-Sep-05 2:26 
GeneralRe: Help me with displaying capture image Pin
SimCom28-Sep-05 2:37
SimCom28-Sep-05 2:37 
GeneralRe: Help me with displaying capture image Pin
Cedric Moonen28-Sep-05 2:49
Cedric Moonen28-Sep-05 2:49 
GeneralRe: Help me with displaying capture image Pin
SimCom28-Sep-05 4:35
SimCom28-Sep-05 4:35 
Dear Cedric,

First, I'm sorry I'm not so clear to you, but I will try to understand you what my situation is. D'Oh! | :doh:

I want to make a simple dialogbox application just simply to show the video-image of the webcam, using CAvicap class wich encapsulates the win32API fucntions of VFW.dll or .cpp (you can see an article of that class, I'm sorry for the missing link)

So I included the CAvicap class in my DialogBox project.

To use the webcam, I have to do the following steps:
1) Call the Creat method of CAvicap
2) Callthe Connect method of CAvicap
3) Set preview rate (also a function of CAvicap)
4) Start preview (also a function of CAvicap)

And when to close it, I need to call the Disconnect method.

The part of showing the life video on my DialogBox is as follow:

<br />
void CCamSampDlg::OnStart() //when I click on Start-button,<br />
{ //the webcam will be activated (I see green<br />
CRect rect; //LED turns on) and it should start showing<br />
GetClientRect(&rect); //the videopicture on the dialogbox<br />
<br />
// Here I try to display the imagestream<br />
<br />
WebCam.Create(WS_CHILD|WS_VISIBLE,rect,&m_Disp,TRUE); //I think in this line something <br />
WebCam.ConnectWithDriver(-1); //is wrong. //-1 means any driver that's available<br />
WebCam.SetPreviewRate(100); //the rate is in mSec to refresh a new image<br />
WebCam.StartPreview(TRUE);<br />
<br />
}<br />
<br />
void CCamSampDlg::OnCancel() <br />
{<br />
WebCam.Disconnect();<br />
OnOK();<br />
<br />
CDialog::OnCancel();<br />
}<br />


Here is the Create method declaration:

<br />
BOOL CAviCap::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, BOOL fAutoSize)<br />
{<br />
ASSERT(!GetSafeHwnd());<br />
<br />
if(GetSafeHwnd()) {<br />
iLastError=CAP_CREATE_DUP;<br />
return FALSE; //already connected, can't connect twice!<br />
}<br />
<br />
_autosize = fAutoSize;<br />
<br />
HWND hWnd=capCreateCaptureWindow("AviCap_Basic", <br />
dwStyle, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, <br />
pParentWnd->GetSafeHwnd(), AVICAP_WINDOW_ID);<br />
<br />
if(!hWnd)<br />
{<br />
TRACE("CAviCap Window creation failed\n");<br />
iLastError=CAP_WINCREATION_FAILED;<br />
return FALSE;<br />
}<br />
<br />
//subclass standard window<br />
SubclassWindow(hWnd);<br />
::SetClassLong(hWnd, GCL_STYLE, ::GetClassLong(hWnd,GCL_STYLE)|CS_DBLCLKS);<br />
<br />
<br />
#ifdef ON_CONNECT_CHECK_DRIVERLIST<br />
_getDrvList();<br />
#endif<br />
<br />
return TRUE;<br />
} <br />



By the way the link where you can find the CAvicap class is here:
http://www.codeproject.com/audio/avicapwrp.asp

Well I hope I informed you well, if you want my project to look at it, I can send it to you. And thank you :->

If my application works, I forget all my problems.
Questionlaunching application from html page Pin
vyjesh28-Sep-05 2:03
vyjesh28-Sep-05 2:03 
AnswerRe: launching application from html page Pin
Mircea Puiu28-Sep-05 2:33
Mircea Puiu28-Sep-05 2:33 
GeneralRe: launching application from html page Pin
mikanu28-Sep-05 5:24
mikanu28-Sep-05 5:24 
GeneralRe: launching application from html page Pin
vyjesh30-Sep-05 3:01
vyjesh30-Sep-05 3:01 
AnswerRe: launching application from html page Pin
mikanu30-Sep-05 6:19
mikanu30-Sep-05 6:19 
QuestionClipboard issue. Pin
Abyss28-Sep-05 1:41
Abyss28-Sep-05 1:41 
AnswerRe: Clipboard issue. Pin
S Douglas28-Sep-05 23:33
professionalS Douglas28-Sep-05 23:33 
Questionwant to use a CDialogBox in MFC Pin
vikas amin28-Sep-05 1:37
vikas amin28-Sep-05 1:37 
AnswerRe: want to use a CDialogBox in MFC Pin
toxcct28-Sep-05 1:49
toxcct28-Sep-05 1:49 
GeneralRe: want to use a CDialogBox in MFC Pin
vikas amin28-Sep-05 3:49
vikas amin28-Sep-05 3:49 
AnswerRe: want to use a CDialogBox in MFC Pin
S Douglas28-Sep-05 23:45
professionalS Douglas28-Sep-05 23:45 
QuestionFinding the current active button... Pin
u6ik28-Sep-05 1:35
u6ik28-Sep-05 1:35 
AnswerRe: Finding the current active button... Pin
fat_boy28-Sep-05 2:01
fat_boy28-Sep-05 2:01 
AnswerRe: Finding the current active button... Pin
Cedric Moonen28-Sep-05 1:59
Cedric Moonen28-Sep-05 1:59 
AnswerRe: Finding the current active button... Pin
u6ik28-Sep-05 2:27
u6ik28-Sep-05 2:27 
QuestionRun batch-job from MFC-App without command-window Pin
Snore28-Sep-05 1:25
Snore28-Sep-05 1:25 
AnswerRe: Run batch-job from MFC-App without command-window Pin
Mircea Puiu28-Sep-05 2:36
Mircea Puiu28-Sep-05 2:36 

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.