|
Hi,
You create the dialox box from main thread and set this dialog as hidden. Now create a worker thread and wait for the situation. When the situation occures you just set the dialog visible.
Manoj
Never Gives up
|
|
|
|
|
iayd wrote: I think there should be a way to do this in this wa
Well, you cannot create windows in threads that don't process messages.
This means that if you create a worker thread, you cannot create a modeless dialog in that thread. You could however create a modal dialog because it will pump messages inside an internal message pump until the dialog is closed. But the call to DoModal() won't return until the dialog is dismissed. This means that your worker thread cannot do anything else but showing that dialog.
If you want to create a modeless dialog, or any window, from another thread than your main thread, it will have to be a UI-thread.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
how to add gif image in a button control in mfc. pls help me
|
|
|
|
|
|
You can read your file(gif) with CImage class and use of SetBitmap of CButton for set this file
|
|
|
|
|
see this code (set bitmap to true on the property of button)
#include AtlImage.h
CImage m_Image;
m_Image.Load("c:\\ad2.gif");
m_Button1.SetBitmap(m_Image.Detach());
|
|
|
|
|
i used cimage class. but it shows "Cannot open include file: 'atlimage.h':" is there any files to be included other than atlimage.h
|
|
|
|
|
Whats your compiler? you can also use of GDI+.
|
|
|
|
|
no sir i cant use gdi+ also because of same error. which compiler i have to use
|
|
|
|
|
|
See if this helps.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi to all.
I'm having problems when I put '#include "imapi.h"' line in my app (using IMAPIv1 for writing data on CD)
But the moment I do so and compile several errors appear, all warning some tag structure redefinition. E.g.
c:\program files\microsoft sdk\include\propidl.h(198) : error C2011: 'tagCABSTR' : 'struct' type redefinition
I've download Feb2003-SDK ant put it on top of the Tools->Option->Directories, but didn't help!
Anyone know what to do?
|
|
|
|
|
josip cagalj wrote: I'm having problems when I put '#include "imapi.h"' line in my app...
I added the file to one of my projects and it compiled fine. What does the file look like where you added it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You mean you added line not File?
I created dialog where user can add several files/folders in an listctrl and then record them on CD.
Now, I'm trying to write on CD using IMAPI v1.0 but the moment I include imapi.h
and try to compile errors begin line up. Example:
c:\program files\microsoft sdk\include\propidl.h(144) : error C2011: 'tagCAUB' : 'struct' type redefinition
Should I try to disable this .h file?
I followed 'CD burner' article (for vc7, i'm using vc6 all the same) where states:
<br />
1. Include imapi headers "imapi.h" and "Imapierror.h"<br />
<br />
#include "imapi.h"<br />
#include "Imapierror.h"<br />
<br />
2. Declare your IMAPI variables.<br />
<br />
IDiscMaster *pDiscMaster=NULL;<br />
IJolietDiscMaster *pJolietDiscMaster=NULL;<br />
IEnumDiscRecorders *pEnumDiscRecorders=NULL;<br />
IDiscRecorder *pDiscRecorder=NULL;<br />
IStorage* pStorage = NULL;
but not for me!
THX
the sdk is from Feb2003, should i dawload new (please send me a link if so)
|
|
|
|
|
josip cagalj wrote: You mean you added line not File?
These are one in the same. The #include preprocessor directive does add/insert the contents of the file at the point where the directive appears.
What does the file look like where you added it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
My English is not so good so i'm afraid i dont quit understand when you say
What does the file look like where you added it?
But here is the whole .h my file:
#include "KCSideBannerWnd.h"<br />
#include "MyBrowser.h"<br />
<br />
<br />
<br />
class CBurn : public CDialog<br />
{<br />
public:<br />
CBurn(CWnd* pParent = NULL);
CString IzaberiFolder(BOOL bNetwork);<br />
CString m_sIniFolder;<br />
enum { IDD = IDD_BURN };<br />
CButton m_btnAddFolder;<br />
CButton m_btnDel;<br />
CButton m_btnAdd;<br />
CMyBrowser m_lsFiles;<br />
CComboBox m_cmbRecorder;<br />
<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
protected:<br />
CKCSideBannerWnd m_banner;<br />
void FillRecorders(); <br />
<br />
virtual BOOL OnInitDialog();<br />
virtual void OnOK();<br />
afx_msg void OnBtnAdd();<br />
afx_msg void OnBtnAddFolder();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
#endif // !defined(AFX_BURN_H__E8A4E285_5D2F_439A_B77E_3393660D2EAC__INCLUDED_)<br />
this is fresh, I still need to add a whole lot of functions and ....
Once again thanks for trying to help me
|
|
|
|
|
You need to get in the habit of including all header files that you did not create (e.g., imapi.h) in the stdafx.h file. No, it's not required, but you'll save yourself a lot of aggravation.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks, I'll try that.
I thought that putting stuff in the stdafx.h causing program build last longer, I have that habit with something which I need in a few places. But I'm recording on CD in one place so i thought I can include imapi.h there.
I did what you recommended, included files in the stdafx.h and same errors occur:
Compiling...<br />
StdAfx.cpp<br />
c:\msdev\sdk include\propidl.h(143) : error C2011: 'tagCAUB' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(149) : error C2011: 'tagCAI' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(155) : error C2011: 'tagCAUI' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(161) : error C2011: 'tagCAL' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(167) : error C2011: 'tagCAUL' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(173) : error C2011: 'tagCAFLT' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(179) : error C2011: 'tagCADBL' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(185) : error C2011: 'tagCACY' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(191) : error C2011: 'tagCADATE' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(197) : error C2011: 'tagCABSTR' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(203) : error C2011: 'tagCABSTRBLOB' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(209) : error C2011: 'tagCABOOL' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(215) : error C2011: 'tagCASCODE' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(221) : error C2011: 'tagCAPROPVARIANT' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(227) : error C2011: 'tagCAH' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(233) : error C2011: 'tagCAUH' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(239) : error C2011: 'tagCALPSTR' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(245) : error C2011: 'tagCALPWSTR' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(251) : error C2011: 'tagCAFILETIME' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(257) : error C2011: 'tagCACLIPDATA' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(263) : error C2011: 'tagCACLSID' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(284) : error C2011: 'tagPROPVARIANT' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(486) : error C2011: 'tagPROPSPEC' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(497) : error C2011: 'tagSTATPROPSTG' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(509) : error C2011: 'tagSTATPROPSETSTG' : 'struct' type redefinition<br />
c:\msdev\sdk include\propidl.h(1402) : error C2084: function 'void __cdecl PropVariantInit(struct tagPROPVARIANT *)' already has a body<br />
Error executing cl.exe. <br />
Don't know what to do anymore
|
|
|
|
|
I did it!!!
No compile errors no more!
I've put include files i stdfax.h then I played some with Tools->Option->Directories property (put WindowsPlatformSDK ver Feb2003 to top) and suddenly no more errors on compile!
One BIG thanks to everybody who helped me (especially David Crow ). But no time to rest guy's soon I'll be back with new stuff and bug you some more, but I think you wont mine me
THANKS
P.S.
I hope I'm not going to ask you any more about this topic
|
|
|
|
|
Hi,
I need to compare times which are strings. There is a structure for time. I don't have idea about that.
Can u help out to compare times which are strings.
Thanks
|
|
|
|
|
You can:
(1) Parse the strings and compare the respective integer values obtained.
(2) Transform your string data (maybe via parsing again) to an opportune object (such a CTime instance if you're using MFC) and then using related members to perform comparison.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I found one function strptime which converts string to time.I have included time.h and string.h header files . Even then i am getting the error 'strptime identifier not found;
|
|
|
|
|
sireesha_sree wrote: I found one function strptime...
Where? It does not appear to be part of MSVCRT.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sireesha_sree wrote: i am getting the error 'strptime identifier not found
Because it isn't. Have a look at here [^]].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
If you are in VC++, you can get the strings for the time like that:
CTime time = CTime::GetCurrentTime();
CString szTime = time.Format ( "%A, %d.%B.%Y, %H:%M:%S" );
The CTime is a class and have methodes like:
GetTime Returns a time_t that corresponds to this CTime object.
GetYear Returns the year that this CTime object represents.
GetMonth Returns the month that this CTime object represents (1 through 12).
GetDay Returns the day that this CTime object represents (1 through 31).
GetHour Returns the hour that this CTime object represents (0 through 23).
GetMinute Returns the minute that this CTime object represents (0 through 59).
GetSecond Returns the second that this CTime object represents (0 through 61).
GetDayOfWeek Returns the day of the week (1 for Sunday, 2 for Monday, and so forth).
If you are in c++ then use the struct time_t (in < time.h >) and isollate every member of the struct to compare them.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|