|
Hi,
I am trying to find the difference between 2 CTime objects so that I'll know the difference in number of days. But it doesn't seem to work right. Attached is my code. nDays is returning a large negative number while I thought it should return the no. of days difference between the two CTime objects. Any suggestions/ideas/comments would be greatly appreciated.
CTime fileCreatedTime;
....
....
//Find the file's creation time
inputFinder.GetCreationTime(fileCreatedTime);
CTime currentTime = CTime::GetCurrentTime();
CTimeSpan timeDifference = currentTime - fileCreatedTime;
long nDays = timeDifference.GetDays();
Thanks,
|
|
|
|
|
|
|
I'd suspect fileCreatedTime variable - here's the excerpt from CFileFind::GetCreationTime docs:
Note Not all file systems use the same semantics to implement the time stamp returned by this function
Check what's returned from CFileFind::GetCreationTime - is it TRUE?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Yes, I am checking for what it is returning. But I believe I found the problem. I was off by 2 minutes from the when it was created yesterday versus when I ran it today. So, it considered the nDays to be 0 since it did not match up to the exact minute/seconds.
Thanks a lot for your help.
|
|
|
|
|
Hi,
I am using CHTMLview as a convenient activeX document container for a Word document.
The problem is i would like
Does anyone know if this is possible? Or any good resource for creating my own activeX document container
I know GetHTMLDocument returns a IUnknown.
Cheers
Richard
|
|
|
|
|
I am trying to query a DB2 database to get MAX(CCP_START_DT) where CCP_END_DT = database null. Following is my code for the main function. I've created the recordset member variable as well as the parameter variable as COleDateTime object. But I don't seem to get anything back. Is there something I am doing wrong? Any ideas/suggestions would be greatly appreciated.
void RetrieveMaxAddressStartDate()
{
rsDlrAdStartDate.m_CNSMR_NBRParam = nDlrConsumerNbr;
rsDlrAdStartDate.m_CNTCT_CDParam = 10;
rsDlrAdStartDate.m_MAIL_RSTRN_CDParam = 9;
rsDlrAdStartDate.m_CCP_END_DTParam.SetStatus(COleDateTime::null);
rsDlrAdStartDate.SetParamNull(3, TRUE);
rsDlrAdStartDate.m_CCP_STRT_DT.SetStatus(COleDateTime::valid);
rsDlrAdStartDate.m_strFilter =
"CNSMR_NBR = ? AND CNTCT_CD = ? AND MAIL_RSTRN_CD != ? AND CCP_END_DT = ?
WITH UR";
CString strCmd =
"SELECT MAX(CCP_STRT_DT) FROM GM99GCP1.CNSMR_CNTCT_PT ";
if (rsDlrAdStartDate.Open(CRecordset::forwardOnly, strCmd) != 0)
{
//Loop through the recordset to retrieve data
short nFields = rsDlrAdStartDate.GetODBCFieldCount();
while (!rsDlrAdStartDate.IsEOF())
{
CString addressStartDateFormat = rsDlrAdStartDate.m_CCP_STRT_DT.Format("%m%d%Y");
addressStartDate = rsDlrAdStartDate.m_CCP_STRT_DT;
rsDlrAdStartDate.MoveNext();
}
rsDlrAdStartDate.Close();
}
Thanks,
|
|
|
|
|
Hi,
I Try to write A single ISAPI for some uses , At the first My .DLL must Authenticate user then load a new page and with given User/Pass do something, But I didn't used from .ASP and I want to have my all of functions and pages in my ISAPI.DLL but when I use an Global variable, it is available in all sessions.
In ASP we can define variable like Session("value"), and and can access it from an another .ASP but I don't want use any .ASP only my dll, Please tell me if you can, VERY IMPORTANT.
Regards,
|
|
|
|
|
Hi,
I have a CListCtrl with one column in a dialogbox. The DialogBox is a System Modal Dialog Box.
The user is allowed to click on the List items and modify them. However, there should not be any duplicates.
To prevent duplicate enteries, the system checks for the user enteries and throws a dialog box indicating an error. This dialog box is also System Modal.
When the user modifies the contents of one item and sets it to a duplicate value and then presses enter, the error dialog box appears and has the focus and can be clicked.
However, when the user modifies the contents of one item and sets it to a duplicate value and then clicks on the side, the error dialog box appears, but its OK button does not have a focus and thus things appear to be all locked up.
Any idea why this happens?
|
|
|
|
|
Actually I noticed that my problem is that I lose focus when I click. When I enter, the focus still remains on the modified element.
So how do I make sure that the selected item maintains its focus both with the Enter and Click?
|
|
|
|
|
I think this is the standard listctrl behavior, that is when you click outside the control it loses focus, and unfortunately I think there's no simple work-around.
You could try to set againg the focus to the listctrl when the parent dialog becomes active, that is it's receiving a WM_ACTIVATE message. Maybe you should do it once only after the warning messagebox is closed, otherwise every activation would set the focus to the listctrl and the user could get confused.
I think you can't set the focus in the notification handler for the LVN_ENDLABELEDIT, because the WM_KILLFOCUS message can't be processed while you are in a message handler, so the control still has the focus there.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
What is the command to set the focus on one of the Listview items in random?
I mean if I go SendMessage, what parameters should I send?
|
|
|
|
|
Hi
Unhandled Exception in .....!
Dump of ExceptionPointer structure:
Exception Code:c0000005. Exception Address: bfdf388d
this is the log file from my application. how can I find where is this addres.
|
|
|
|
|
Hi,
I don't think you're going to be able to find this address. If you run the Dependency Viewer (depends.exe) you'll be able to see all of the function entry points of the various modules included in your program, but I'd say that bfdf388d is way out of their address range.
Have you tried running your program in the debugger and catching ALL exceptions? Then the debugger will stop at the point at which the exception is raised which should help you track down the problem.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
this is log file is generated by the app runing on client machine. I cant put debuger there.
Thanks anyway.
|
|
|
|
|
Okay, I have been working on this forever, but I have a file properties dialog in our application. I also have Windows Explorer using my DLL. I need to research the following things, and I hope y'all can help a confused gal:
(1) How can I have the Windows Explorer provided General Tab Property page show up in my application? I have created my own, but I prefer using the system's.
(2) Where in the world is the data persisted? Stuff like Comments, Author and other data located on the Summary Tab- where is this saved? On the registry? How can I obtain and save it myself? I have been just persisting and reading from an XML file, but I have no idea what's going on with the system stuff.
Please Help
Thanks,
Lilian
|
|
|
|
|
Where in the world is the data persisted?
If you're using W2K, it's stored in a 'Document Summary Info' stream. Alternate file streams are a NTFS-only feature. Write something at a 'Summary' page, then drag the file to A: - you'll see the warning about data loss; only the main stream will be copied to floppy.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks for the info! ;0
Do you have any idea where I can access this stream? I am really at a loss when it comes to Windows APIs.
|
|
|
|
|
Hi,
could anyone help me to understand how IDE of VC++ works for linking?
I've developed some control, which resides in two files : "dummycontrol.h" and "dummycontrol.cpp".
Now I need to use it in another project. I want it to be like all other libraries, i.e. I want to just write "include "dummycontrol.h"" in cpp file of the other project, and linker will pick it up automatically.
I've created dummycontrol.lib, and put into IDE path to that directory. In that another project I've put that include line, but during linking I've got error "unresolvable sybmbol __dummycontrol::dummycontrol() etc". I was able to link only when I explicitly put full path to the module on project's link page in "Object/library modules" list.
What I'm doing wrong or where is RTFM?
Thanks a lot!
SY-
Kosta.
|
|
|
|
|
I want to just write "include "dummycontrol.h"" in cpp file of the other project, and linker will pick it up automatically.
#pragma comment(lib, "yourlib") will do the trick. You'll probably use two #pragmas in #if/#else/#endif, one for debug and one for release. Note that there's no path - you should place the .lib file in one of the dirs listed in Options/Directories/Library files.
I was able to link only when I explicitly put full path to the module
Hmmm... including just the 'yourlib.lib' in the Object/Library modules didn't work?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Tomasz, thank you for replay.
Where exacly should I place this #pragma macros (what file)? I'm very new to VC++ - just moved from Delphi, and main headache is all these macros, includes and link options (.
About including just the 'yourlib.lib' in the Object/Library modules - it works.
SY-
Kosta.
|
|
|
|
|
Tomasz, thank you for replay.
Where exacly should I place this #pragma macros (what file)? I'm very new to VC++ - just moved from Delphi, and main headache is all these macros, includes and link options (.
About including just the 'yourlib.lib' in the Object/Library modules - it works.
SY-
Kosta.
|
|
|
|
|
Where exacly should I place this #pragma
In the .h file of your control:
#ifdef _DEBUG
#pragma comment(lib, "yourlibD")
#else
#pragma comment(lib, "yourlib")
#endif
Note that names for debug and release libs should be different. Appending 'D' to the name of library for debug builds is a popular naming convention.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks!!!!
It works now! You are the man!
SY-
Kosta.
|
|
|
|
|
You can put the code that makes up you lib files into a new Win 32 Static or Dll lib project from the new project wizard. Then in the other workspace where you want to use the library, goto the Project menu -> Insert into Project Workspace, and select the .dsp file of the Static lib, remebering to make it a dependency of your new project.
All you have to do then is include the header files for you class\classes that you wish to use.
Hmmm, does this make sense? Hope it helps.
Giles
|
|
|
|