|
Hi,
use this
CString CStrFileName;
CStrFileName = "c:\\temp\test.exe";
FILETIME ftCreate, ftModify;
CFileStatus m_FileStatus;
CFile::GetStatus(CStrFileName,m_FileStatus);
AfxTimeToFileTime(m_FileStatus.m_ctime, &ftCreate);
AfxTimeToFileTime(m_FileStatus.m_mtime, &ftModify);
Have A Nice Day
Murali.M
|
|
|
|
|
Ok thanks everybody !
It is what I was searching for
|
|
|
|
|
Hi...
There are some problems which I am not able to solve. They are
consider an MDI application....with three child windows open in it....with three buttons on each child window in the toolbar....actually this is a static MDI application...with three child windows initially....
1. The three child windows in the file should be toggable. Suppose if I click on the 1 in the toolbar then the child window should be shown and if I click it once again then it should be hidden not destroyed.
2. The three child windows should be made dockable like in VC++ the windows are dockable.
3. There are three views in this file. One for Bitmap, second for Color table and the last one for Text. For bitmap and data I don't seem to face any problem but for the color table, I will have to display the colors that are present in the bitmap image in tabular form. The tabular columns consists of three columns one for Index, second for colors in the bitmap and the third for the RGB values of each individual color. But I don't know how to do that.
Please help me regarding the above.
Regards,
Ruchit Sharma. R
|
|
|
|
|
Humm..
First, in order to show or hide a window, you can use the ShowWindow method of the MFC's CWnd class. All windows (basically) support this method call, so you can show/hide a window by issuing the call with a parameter SW_SHOW/SW_HIDE.
The docking system of a window follows a very simple logic: each time the window is moved (WM_MOVE), it checks whether the window is in range X from the window/control/button/whatever it is supposed to dock with. If it is, the window's moving rectangle is repositioned to the docking position. If it is not, the rectangle follows the mouse as it normally would.
You could try to derive from CControlBar instead of CMDIChildWnd . This approach would require you to write extensive drawing code in order to make it work properly. Alternative approach would be to hack the MFC source code and copy the EnableDocking method and it's implementation away from the CControlBar class, and implement it to your CMDIChildWnd -derived class. This approach would require considerate planning and testing that the feature works correctly.
The bad thing is that in the first method, you will lose the benefits of CMDIChildWnd , and in the second method, you might end up doing lots of extra work.
I understood that your MDI application has three child windows, and each of these child windows displays one view. Is this correct ? If so, just create a CListCtrl to hold the index, color swatch and RGB values. If you implement a custom-derived CListCtrl , you can 'paint' the middle cells with a color instead of text, and let the original implementation handle the other cells. Main idea would be that when you insert data into the middle cell, then instead of writing it as text, your control paints it as a rectangle filled with the specified color.
Perhaps you should look at the DrawItem method of CListCtrl to see if it suits your needs. Also, see this article[^] for some help.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
what i should do to build simple animate button....
|
|
|
|
|
|
can anyone tell me how i can query which is the currently installed anti virus packege in my OS[Windows 9x/2000/...]
-------------------------------------------
My application needs to scan application files before it starts using them
So i planned that i needed to get the currently installed antivirus package n call createprocess
like some applications i could have the user input this manually in a cnfiguration dialog
i however have seen that microsoft office products word excel ppt etc
automatically do this when a doc is opened
so i guess the details of the current anti virus packege is stored inthe shell of the OS somewhere like the registry
any ideas????
|
|
|
|
|
are u really sure that microsoft office product use the installed virus scanner?
Don't try it, just do it!
|
|
|
|
|
fordge wrote:
i however have seen that microsoft office products word excel ppt etc
automatically do this when a doc is opened
Microsoft Office is not doing this, the installed AV software is. It can be configured to scan all sorts of files, documents included. The AV software "gets" the file before Office does to allow for a virus-free file.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
so if instead of Norton AV suppose another AV is installed say mcAfee or TrendMicro
in that case also do the docs get scanned before they r opened?
can anyone who has used any other AV package comment on such a feature
in which case then indeed it should be a feature of office that calls some generic interface so that the installed AV software is invoked
coz else shouldnt my opening a file in notepad also trigger the file to be scanned by Norton AV.
can anyone who has used any other AV package comment on such a feature??
|
|
|
|
|
fordge wrote:
so if instead of Norton AV suppose another AV is installed say mcAfee or TrendMicro
in that case also do the docs get scanned before they r opened?
Yes, if they are capable of, and are configured to, scan documents.
fordge wrote:
in which case then indeed it should be a feature of office that calls some generic interface so that the installed AV software is invoked
Office is none the wiser that the file it opened was run through a virus-scanner first. That's the beauty of AV software. It monitors each open-file request, scans the file, then hands it on to the requesting application.
fordge wrote:
coz else shouldnt my opening a file in notepad also trigger the file to be scanned by Norton AV.
Since Notepad-type (e.g., .txt, .log, .cfg) files cannot contain a virus, it's pointless to scan them.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi,
CHttpFile::SendRequest() used for post method. what wrong in the following code
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,CStrObject,CStrReferer,1,NULL,NULL,dwHttpRequestFlags);
pFile->SendRequest(szHeaders,(LPVOID)(LPCTSTR)CStrQueryString,CStrQueryString.GetLength());
I got following error
rror C2664: 'int __thiscall CHttpFile::SendRequest(const char *,unsigned long,void *,unsigned long)' : cannot convert parameter 2 from 'void *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
any one help to me. thanks in advance.
Murali.M
|
|
|
|
|
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_POST,CStrSuburl);
|
|
|
|
|
Try like this
<br />
pFile->SendRequest(szHeaders,(LPVOID)(LPCTSTR)CStrQueryString,(DWORD)CStrQueryString.GetLength()); <br />
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Hi all,
How can I change the Caption of all control on CFileDialog.
CFileDialog dlg(...);
...
...
...
ex:
"Open" -> "ads",
"Cancel" -> "ddd",
"Look in" -> "find in"...
Thanks all
|
|
|
|
|
You'll have do derive your own class from CFileDialog.
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
you could enumerate the child windows and then change them as you find them.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Is this of any help
CFileDialog vFileDlg (TRUE, "txt", "*.txt",OFN_FILEMUSTEXIST|OFN_HIDEREADONLY, vFilters);
//the next line changes the title
vFileDlg.m_ofn.lpstrTitle = "Your title here";
//the next line sets the default directory to start looking for the file
vFileDlg.m_ofn.lpstrInitialDir = "G:\\DirName\\DirName2";
if(vFileDlg.DoModal() == IDOK)
{
etc
Let me know if this helps..
Dave Collins
|
|
|
|
|
How to disable all the ASSERTS that come when u execute a program in Debug mode?I require it very urgently.
The ASSERT i m getting are in timecore.cpp and i have no idea how to remove them. But they are occurring so frequently that its difficult to operate on the debug mode application.
Any comiler setting or macro which would disable all ASSERTs from popping up?
Any ideas about ASSERTS in timecore.cpp?
|
|
|
|
|
The ASSERTs are telling you something, you should listen to them.
You could try redefining ASSERT, and see if that works out for you. Or undefine DEBUG, but then you may as well go to release mode.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
The ASSERTs are telling you something, you should listen to them
Uh huh Some of my friends complain when I sprinkle my code liberally with ASSERT and ASSERT_KINDOF but I almost never have problems with NULL pointers or pointers to objects of the wrong kind. Even the act of writing the assertion gets the background threads thinking about whether I'm calling something with the correct (and validated) pointers
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
Most ASSERT macros (I'm assuming you're using some Microsoft version of them) are enabled in debug compilations and then nullified for release versions. In other words, an ASSERT macro might be defined like this:
#ifdef _DEBUG
#define ASSERT(expr) ...some assert code...
#else
#define ASSERT(expr)
#endif
Notice how the second ASSERT defition has nothing after it. That's because in non-debug builds, you don't want assertions to do anything. So, to possibly answer your question, you should probably dig up where your ASSERT is being defined and do #undef _DEBUG (to undefine debug build). Unfortunately, that turns off most debug features since many things test against _DEBUG being defined. Either do that, or compile as release, or create your own ASSERT macro based on other example code.
HTH
|
|
|
|
|
ummmmm
how about fixing the cause of the ASSERT's?
just a wild stupid idea i know but im old fashioned like that
"there is no spoon" biz stuff about me
|
|
|
|
|
I already told him to do that in the previous post but he says he has no time to do that(that was 3-4 days back), if he had taken some time off to fix the problem then his prob would have been solved.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Thnks,
I finally fixed the ASSERT.
|
|
|
|