|
In my MFC application, I create a series of 4 dialog windows all idential (an array of dialogs).
Now I play a different video on each dialog on an Animate control.
For Dialog 1 (index 0) - see code below:-
CAnimateCtrl m_screen;<br />
HWND hMCI[4] = {NULL, NULL, NULL, NULL};<br />
<br />
hMCI[0] = MCIWndCreate(m_screen, AfxGetApp()->m_hInstance, MCIWNDF_SHOWALL | MCIWNDF_NOMENU | MCIWNDF_NOOPEN | MCIWNDF_NOPLAYBAR, "animation.mpg");
PlayVideo(0);<br />
<br />
<br />
<br />
if(hMCI[index])<br />
{<br />
MCIWndClose (hMCI[index]);<br />
m_MainText.ShowWindow (SW_SHOW); <br />
playVideo = true;<br />
displayed = false;<br />
m_screen.ShowWindow (SW_HIDE); <br />
}<br />
<br />
void CEmuDlg::PlayVideo(short index)<br />
{<br />
if(playVideo)<br />
{<br />
m_MainText.ShowWindow (SW_HIDE);<br />
m_screen.ShowWindow (SW_SHOW); <br />
::ShowWindow(hMCI[index],SW_MAXIMIZE);<br />
MCIWndPlay(hMCI[index]);<br />
<br />
MCIWndSetRepeat(hMCI[index],TRUE);
playVideo = false;<br />
}<br />
else<br />
{<br />
MCIWndPause(hMCI[index]);<br />
m_screen.ShowWindow (SW_HIDE); <br />
playVideo = true;<br />
if(!m_pClear.GetCheck ())<br />
m_MainText.ShowWindow (SW_SHOW);<br />
}<br />
}
Now the video only plays on a single dialog window. Do I need to do anything else to allow a different video play on dialog 3 say at the same time.
Can I only play on video per application?
|
|
|
|
|
Good day,
I have two dialogs. The MainDialog and WelcomeDialog.
WelcomeDialoghas a progress bar and MainDialog has
the initialization in which this initialization status is
shown in WelcomeDialog progressbar. I have a function in
WelcomeDialog IncreaseProgressBarStep(int step) which is
public so MainDialog can access it.
Here is what i wanted to do.
MainDialog::OnInitDialog()
{
WelcomeDialog childDlg;
childDlg.DoModal();
->InitializationStatement....
childDlg.IncreaseProgressBarStep(10);
InitializationStatement....
childDlg.IncreaseProgressBarStep(10);
............(until all initialization is done)
done initialization here....
}
The problem with this code is that the code with ->InitializationStatement will not be called
unless the childDlg is exited, thus childDlg.IncreaseProgressBarStep will be useless.
How can we communicate the two dialogs so that WelcomeDialog will stay on the screen while
whole initilization is not yet done.
Thanks and More Power!
|
|
|
|
|
Anonymous wrote:
The problem with this code is that the code with ->InitializationStatement will not be called
unless the childDlg is exited
Of course, this is logical. DoModal is a blocking call that will return the return code of closing the dialog. If you want to have childDlg 'not blocking' you will have to make it modeless. That is, maitaint a member variable in MainDialog and show the window. Take a look at this article[^]. It will help you to understand how it works.
|
|
|
|
|
Thanks. It does what I need.
More Power!
|
|
|
|
|
Hi all,
can someone tell me which open source reporting tools can i used for MFC program?
the reporting tools i knw was crystal report but this is not open source! then the jasperReport is java based right!
Please help me! thanks!
Rgds,
bryan
|
|
|
|
|
How to create Log File in c++ . How to pick up server date and time in c++/VC++ ....
|
|
|
|
|
|
|
I am programming Socket with SSL on server side. The following code depicts how
I m reteriving certificate from a store and obtaining credentials for
schannel.I am getting problem in obtaning credential handle ie AcquireCredentialshandle returns SEC_E_INTERNAL_ERROR
#define ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
TimeStamp tsExpiry;
SECURITY_STATUS Status;
CERT_RDN cert_rdn;// structure to obtain certificate using RDN
attributes
//containing structure CERT_RDN_ATTR
CERT_RDN_ATTR cert_rdn_attr;// structure for one attribute of RDN ie
//Common Name
//only one attribute of RDN is used to find certificate
cert_rdn.cRDNAttr = 1;//only one CERT_RDN_ATTR
cert_rdn.rgRDNAttr =&cert_rdn_attr;//pointer to CERT_RDN_ATTR the
//structure contains 1 attribute
const TCHAR * pszUserName=_T("SNS");//Common Name is SNS
cert_rdn_attr.pszObjId = szOID_COMMON_NAME;//go for Common Name
//attribte in RDN
cert_rdn_attr.dwValueType = CERT_RDN_ANY_TYPE;
cert_rdn_attr.Value.cbData = _tcslen(pszUserName);//length of //Common
Name
#ifdef _UNICODE
char *pszUn = new char[wcslen(pszUserName)+1];
WideCharToMultiByte(CP_ACP,0,pszUserName,-1,pszUn,wcslen(pszUserName)+1,NULL,NULL);
cert_rdn_attr.Value.pbData = (BYTE *)pszUn;
#else
cert_rdn_attr.Value.pbData = (BYTE *)pszUserName;
#endif
//search for the certificate in the certificate store
PCCERT_CONTEXT m_pCertContext;
m_pCertContext =
CertFindCertificateInStore(m_hMyCertStore,
ENCODING_TYPE,
0,//use default values
CERT_FIND_SUBJECT_ATTR,
&cert_rdn,
NULL);
#ifdef _UNICODE
delete [] pszUn;
#endif
//If the function fails and a certificate that matches the search
criteria is not //found,the return value is NULL
if(m_pCertContext == NULL &&::GetLastError()==CRYPT_E_NOT_FOUND)
{
::OutputDebugString(_T("error:"));
}
::OutputDebugString(_T("pointer to the certificate context is
available"));
SCHANNEL_CRED m_SchannelCred;
SecurityFunctionTable m_SecurityFunc;
CredHandle m_hCreds;
PCredHandle phCreds=&m_hCreds//pointer to the credential handle
ZeroMemory(&m_SchannelCred, sizeof(m_SchannelCred));
//Credentials are required by the Schannel authentication
m_SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;
m_SchannelCred.cCreds = 1;//only one certificate store
m_SchannelCred.paCred = &m_pCertContext;//pointer to the pointer of
//CERT_CONTEXT structure this how the certificate enters the credential
//which is used for security context in schannel authentication
m_SchannelCred.hRootStore = m_hMyCertStore;//handle to certificate
store
m_SchannelCred.dwMinimumCipherStrength = 80;//strength of cipher
DWORD m_dwProtocol=0;//use any protocol
m_SchannelCred.grbitEnabledProtocols = m_dwProtocol;//use any protocol
m_SchannelCred.dwFlags |= SCH_CRED_NO_SYSTEM_MAPPER ;
//function, which returns a handle to the requested credentials
Status = m_SecurityFunc.AcquireCredentialsHandle(
NULL, // Nameof principal
UNISP_NAME,//schannel package
SECPKG_CRED_INBOUND,
NULL,
&m_SchannelCred,
NULL,
NULL,
phCreds
&tsExpiry);
//here i refered MSDN for returned Status and put different values of
Status //check the exact cause for error and i found the returned value
of Status is
//SEC_E_INTERNAL_ERROR
if(Status != SEC_E_OK &&Status==SEC_E_INTERNAL_ERROR)
{
::OutputDebugString(_T("error channel credentials"));
}
::OutputDebugString(_T("handle to channel credential is available"));
//Pls help me.Thanx in advance for any suggestion.
-- modified at 3:32 Friday 30th September, 2005
|
|
|
|
|
I am writing a CAD program that requires floating points to draw lines and cirlces in which using DirectX or OpenGL is muct easier. After that, I need to get the pixel data from the drawing for analysis. Does anyone know how to get these data? Or other method other than the DirectX or OpenGl?
Max
-- modified at 3:23 Friday 30th September, 2005
|
|
|
|
|
Render to texture, then get the juicy bits.
http://developer.nvidia.com/object/ogl_rtt.html
http://www.riaz.de/tutorials/d3d16/d3d16.html
Regards,
BB
http://spin.neostrada.pl
|
|
|
|
|
Is there a way to manage the printer spool for adding documents in stand-by mode, remove them when necessary, ... ?? I'm wondering if there's a way to do that not depending onto the printer selected.
Thanks in advance,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Hi,
I am asking something different. I need Win98 DDK (Driver development kit). can you send it to me if it is unlicenced. I didn't find it any where and need it urgently. yaa Win2000 DDK may also do.
|
|
|
|
|
I dont' think anybody can help you..All DDk's are now part of MSDN subscription..Moreover, MS discourages sticking to Win98 DDK..
|
|
|
|
|
Hi,
I am getting the following error, while i filter the process using Createprocess API.
---------------------------
E:\__MyFolder\__Testing\HookApp\1.htm
---------------------------
Windows cannot find 'E:\__MyFolder\__Testing\HookApp\1.htm'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.
---------------------------
OK
---------------------------
I need it to be hide this error message or don't show it to user. How could I do this. Anyone help me.
Be simple and Be sample.
|
|
|
|
|
I am not sure I understand exactly what you want, but you may consider one of the following:
- if the path is to be passed as a string to some function, then use two backslashes instead of one
- if you do not want to show the error message, you may try to use a try-catch block and treat the error yourself.
SkyWalker
|
|
|
|
|
Hello...I am trying to develop FTP application with SSL security layer.
Base on your article on CAsyncSocketEx, I do not understand how to change the CAsyncSocket to CAsyncSocketEx? Do I have to change other files besides to change CAsyncSocket occurences to CAsyncSocketEx?
Please Help me.
This is my alternate email : hanan6014@yahoo.com
But still...i am in the process of studying those code for FTP application Server and Client.
Thanks.
|
|
|
|
|
Friends,
I'm developing an application in which i've used bitmaps to fill the dialog boxes.I've added the bitmaps using the OnEraseBkgnd function and set the background of the controls in the dialog box in the OnCtlColor function.the problem what i'm facing now is,i've few radio buttons and group boxes in the dialog boxes ,the background of the text what they(radio buitton & group box) display is always GRAY and i'm not able to change it.
Is there any method using which i can change the background colour of the radiobuttons text?it would be great if someone can help me out in this.thank you.
NOTE:I've tried using SetTextColor & SetBkColor functions.
|
|
|
|
|
rajeev82 wrote:
Is there any method using which i can change the background colour of the radiobuttons text?it would be great if someone can help me out in this.thank you.
Actually Radio, Check Boxes and Button all share comon class with diffrent style, now for changing color of Button control you have to make them owner drawn and then darw accroding on you dialog Box... or look for alternative bitmap supporting button class.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
U have got he righ question for me?
I have just done some R&D on this topic .
Do one this add this message handler to your
code WM_CTLCOLOR
IN the Code
By the Controls Resource ID get the
pointer to that control's window
and then send
pDC->SetBkMode(TRANSPARENT);
message to the control
remember to set the HBRUSH as NULL by
adding this line
hbr = (HBRUSH)GetStockObject( NULL_BRUSH );
// if u dont set this then the label will not be trasparent
if u are not able to get me then i send u the code
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
vikas amin wrote:
if u are not able to get me then i send u the code
I am Afraid, you have posted you reply to wrong user....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I think ur problem is to Set Transperent the Backgroudn colour of the CStatic ??
Ok
Add this message handler to your code WM_CTLCOLOR
By the Controls Resource ID get the
pointer to that control's window "IDC_STATIC" is the static text on my dialog box
and then send
pDC->SetBkMode(TRANSPARENT);
message to the control
I am sending u the code from my dialobbox(LoginBox) for the OnCtlColor event :-
HBRUSH LoginBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
CBrush m_brush;
m_brush.CreateSolidBrush (RGB(45, 55, 0));
// TODO: Change any attributes of the DC here
if (pWnd->GetDlgCtrlID() == IDC_STATIC)
{
// Set the text color to red
pDC->SetTextColor(RGB(200, 200, 200));
pDC->SetBkColor(RGB(45, 55, 0)); //THIS DONT WORK
// Set the background mode for text to transparent
// so background will show thru.
pDC->SetBkMode(TRANSPARENT);
hbr = (HBRUSH)GetStockObject( NULL_BRUSH );// if u dont set this then the label will not be trasparent
// Return handle to our CBrush object
//hbr = m_brush; //here the m_brush is the initialized and created CBrush member named m_brush of the dialog box it is need for the backgroud painting so i have disabled it
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
hope so this clears ur query
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
U have got he righ question for me?
I have just done some R&D on this topic .
Do one this add this message handler to your
code WM_CTLCOLOR
IN the Code
By the Controls Resource ID get the
pointer to that control's window
and then send
pDC->SetBkMode(TRANSPARENT);
message to the control
remember to set the HBRUSH as NULL by
adding this line
hbr = (HBRUSH)GetStockObject( NULL_BRUSH );
// if u dont set this then the label will not be trasparent
if u are not able to get me then i send u the code
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi all!
I have a requirement to display text in Taskbar system tray( Like clock text). Can any one help how to do that. There is a way to display two characters( By printing characters in bitmap and then convert into icon and pass it to Shell_Notify). But I need to display atleast 8 characters .
Thank you for helping!
Ram
|
|
|
|
|
Can you resize the ToolbarWindow32 window? Can you create a floating toolbar and place it near the clock?
|
|
|
|