|
|
Hi all.
In an earlier question I indicated that I generate child dialog by means of "Create". However; when defining a new entry I prefer to use a modal dialog for a number of reasons. This means that - for example - in the OnOK routine, I can have a modal dialog or not; which means that I need to react differently. Anyone have any idea how to find out if the dialog is modal or not? I could of course set a flag myself (since I know how I am creating the dialog) but isn't there a neat way of doing this?
Thanks in advance
William
|
|
|
|
|
If you are using MFC, modal dialogs are implemented a little differently - they simply disable their parent window. You should be able to get a dialog's parent window handle (HWND ), and then see if it is disabled or not.
Not really neat, but it may work for you. Might just be better to set a flag!
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James,
Thanks for your answer. I have now indeed introduced a flag, which is set in an overridden DoModal routine. Works just fine.
Thanks,
William
|
|
|
|
|
|
Hi,
I am trying to fetch the information about remote computer. Initially, I need the information of number of physical disks and their sizes.
I am taking help of the following registry key to get the number of physical disks (I am opening remote registry and querying these keys):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\IDE<br />
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SCSI
These keys contains the number of disks on the system. But, I am unable to fetch their sizes. CreateFile is not opening physical disks on remote system (returning INVALID_HANDLE_VALUE).
Can anybody help resolving this issue?
Kiran.
|
|
|
|
|
I suspect the answer might lie with WMI (Windows Management Instrumentation). In theory this technology can get you the information you want but I can't say I've had much luck with it myself. I'd be interested in any solution you finally come up with though as I've stalled on a similar problem in the past. Microsoft don't seem to publish an interface for talking to the Logical Disk Manager, even locally. If this has changed perhaps somebody else will be able to post a link.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi all,
I'm trying to create a time stamp [format: yyyymmddhhmmss], but as always I'm experiencing some problems. I have tried the following:
char dateString [20];
char timeString [20];
struct tm *newtime;
time_t long_time;
time( &long_time );
newtime = localtime( &long_time );
sprintf(dateString,"%d%d%d",newtime->tm_year, newtime->tm_mon, newtime->tm_mday);
sprintf(timeString,"%d%d%d",newtime->tm_hour, newtime->tm_min, newtime->tm_sec);
But I not very familiar with the expression to use. Can anyone please help??
Many Thanks
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi,
For the year, you need to add 1900 (see MSDN for more information). So, your sprintf turn to:
<br />
sprintf(dateString,"%4d%02d%02d",newtime->tm_year + 1900 , newtime->tm_mon, newtime->tm_mday);<br />
sprintf(timeString,"%02d%02d%02d",newtime->tm_hour, newtime->tm_min, newtime->tm_sec);<br />
The bold letters are those places where I made changes.
Hope that helps.
Kiran.
|
|
|
|
|
|
Programm3r wrote: format: yyyymmddhhmmss
Use: _tcsftime (dateString, 20, _T("%Y%m%d%H%M%S"), newtime);
|
|
|
|
|
Thank you very much for the help.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: ...I'm experiencing some problems.
One of which seems to be not explaining the problem.
"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
|
|
|
|
|
DavidCrow wrote: One of which seems to be not explaining the problem.
Strange that the other two people understood the question ....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I have a VC++ project (x.dsp). When I open the .dsp (x.dsp) of this project it is opening all other project as well. I don’t know how this is loading all other projects to workspace? If it is possible, can you please help me, how to implement it?.
And at the same time, when I compile this project (x.dsp – which is set as active), it is compiling all the projects in an order even though only x.dsp is set as active. Can you please help me how to do this??
Anand
|
|
|
|
|
See Here[^] [Visual Studio IDE]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I cant get what you are telling. Can any one help me??
|
|
|
|
|
Hi,
"Programm3r" said that you better post on Visual Studio IDE forum.
Anyway, When you open the *prj, does it prompts for using *dsw?
|
|
|
|
|
Post your question on the Visual Studio IDE Forum, with the link I provided. This is a Visual C++ / MFC discussion board.
Sorry ...
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Vs will complie any dependancies of the the active project by defalut.
a programmer traped in a thugs body
|
|
|
|
|
How can i do print preview for this :
((i have a CButton OnPrint(IDC_PRINT))CDialog Base aplication)
void CMyPrintDlg::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CPrintDialog dlgPrint(FALSE,PD_ALLPAGES,this);
if (dlgPrint.DoModal()==IDOK)
{
// ** Attach the printer DC from the dialog
// ** to a CDC object
CDC dcPrint;
dcPrint.Attach(dlgPrint.GetPrinterDC());
// ** Create and fill a DOCINFO structure
DOCINFO myPrintJob;
myPrintJob.cbSize = sizeof(myPrintJob);
myPrintJob.lpszDocName = "printing...";
myPrintJob.lpszOutput = NULL;
myPrintJob.lpszDatatype = NULL;
myPrintJob.fwType = NULL;
// ** Start the printing document
if (dcPrint.StartDoc(&myPrintJob)>=0)
{
// ** Start a page
dcPrint.StartPage();
CString sText;
sText = "this :";
CString sText1;
sText1 = "How ?";
////////////////////////////////////////////////////////////////////////////////////////
dcPrint.TextOut(2000,350,sText);
dcPrint.TextOut(300,500,sText1)
// ** Throw the page
dcPrint.EndPage();
// ** Close the document
dcPrint.EndDoc();
}
dcPrint.DeleteDC();
}
}
Please help me !
Bravoone
|
|
|
|
|
|
I'm trying to get hold of ESENT.H (and optionally ESENT.LIB). Does anyone know which version (if any) of the platform SDK includes these?
I know that the XPSP2 version doesn't, and annoyingly, nor does the one that ships with VS2005 (nor is it in SP1 for same).
I really don't want to have to download a 400MB+ image just for two files, particularly if I don't know that they're actually in there...
Steve S
Developer for hire
|
|
|
|
|
Both are in Windows Server 2003 R2 Platform SDK. There's even different 32 and 64 bit flavours. Sorry about the 400MB+
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Steve S wrote: Does anyone know which version (if any) of the platform SDK includes these?
They are not with the February 2003 version.
"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
|
|
|
|