|
I am trying to use a COleDateTime object and use the method ParseDateTime() to convert a string to date/time format.But it returns an invalid status for the object every time the method is called.I have tried all formats of date,date/time as mentioned in MSDN, but none works.
In Debug mode, I am also not able to step into the ParseDateTime function.
COleDateTime objDate;
strDate = _T("2004/01/01");
objDate.ParseDateTime(strDate, 0);
I have included <afxdisp.h>
The same code works fine in another new workspace/project. But in my project/workspace, it isnt producing any result.
Can anyone please let me know what might be wrong?
|
|
|
|
|
It seems strange that you can't step into ParseDateTime! It is declared in \Microsoft Visual Studio\VC98\MFC\SRC\OLEVAR.CPP
In my experience it would seem that the project could require a complete rebuild. Strange problems like that are normally cured with a complete clean and rebuild.
Ant.
|
|
|
|
|
I tried that too..it still doesnt work..
|
|
|
|
|
Hello!
- check with dependency viewer what libraries are truly loaded (maybe you have two copies of some dll?)
- MSDN says that only formats
DD-MM-YYYY
MM-DD-YYYY
YYYY-MM-DD
are properly handled - see VarDateFromStr
- maybe instead of ParseDateTime you can use COleDateTime::Format() ?
- check the difference in locale settings (control panel) for date/time format on machines where it works, and not.
|
|
|
|
|
Thanx will try
|
|
|
|
|
Hi. How do you set the path for your source files if they are in a different directory then the project directory in Visual C++.Net. I tried to go to Tools/Options/Projects and added the path to the list of VC++ source file directories but when I compile my code I still get link errors.
|
|
|
|
|
#define "myFold\myHeader.h"
TOXCCT alias Nicolas C.
|
|
|
|
|
Hello!
If you get link errors, maybe include source file in project? Simply add it as a existing file to project.
|
|
|
|
|
I am trying to output binary numbers to the standard stream. The problem is that I want to display them in the mathematically correct format.
Using 7.5 as a decimal example, to display it as:
111.1
Do I have to write my own function to convert these, or is there a simpler way?
Thanks,
Joe Hoppe
|
|
|
|
|
hi,
How can I check if a drive is Zip drive (and not a floppy drive). I know floppy is checked by DRIVE_REMOVABLE == GetDriveType(). What about Zip ?
regards
hari
Hari Krishnan
|
|
|
|
|
Try this:
(below code detects dvd)
<br />
<br />
STORAGE_MEDIA_TYPE GetDriveType(TCHAR A_chletter)<br />
{<br />
DISK_GEOMETRY Geom[20];<br />
DEVICE_MEDIA_INFO dinfo[20];<br />
DWORD cb; <br />
GET_MEDIA_TYPES gmedia[20];<br />
<br />
ZeroMemory(Geom, sizeof(Geom));<br />
ZeroMemory(dinfo, sizeof(dinfo));<br />
ZeroMemory(gmedia, sizeof(gmedia));<br />
<br />
HANDLE hVolume = NULL;<br />
CString drive_argument;<br />
drive_argument.Format(_T("\\\\.\\%c:"), A_chletter);<br />
<br />
hVolume = CreateFile( (TCHAR*)(LPCTSTR)drive_argument,<br />
GENERIC_READ,<br />
FILE_SHARE_READ | FILE_SHARE_WRITE,<br />
NULL,<br />
OPEN_EXISTING,<br />
0,<br />
NULL );<br />
<br />
if(DeviceIoControl (hVolume, IOCTL_STORAGE_GET_MEDIA_TYPES_EX, 0, 0, <br />
gmedia, sizeof(gmedia), &cb, 0))<br />
{<br />
UINT MediaCharacteristics = gmedia[0].MediaInfo[0].DeviceSpecific.DiskInfo.MediaCharacteristics;<br />
MediaCharacteristics = MediaCharacteristics;<br />
CloseHandle(hVolume);<br />
if(gmedia[0].DeviceType == FILE_DEVICE_DVD)
AfxMessageBox("found dvd!"); <br />
return (STORAGE_MEDIA_TYPE)(gmedia[0].MediaInfo[0].DeviceSpecific.DiskInfo.MediaType);<br />
}<br />
CloseHandle(hVolume);<br />
return (STORAGE_MEDIA_TYPE)Unknown;<br />
}<br />
<br />
see _STORAGE_MEDIA_TYPE enumeration type.
|
|
|
|
|
many thanks, Will check it out.
Hari Krishnan
|
|
|
|
|
Hi All!
How can I capture the words(, text) in edits, htmls ,buttons, static, Ms reader... from another application by hook or subclass!
Example :
autolook of dictionary or "click and see" when i click on a text then
my application how capture the selected text?
|
|
|
|
|
I believe the API has a function that allows you to capture a window based on co-ordinates. Then, call GetWindowText. I forget what the API function is called tho.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thinking of WindowFromPoint ?
|
|
|
|
|
yeah, that was it....
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi,
i have a problem... RTF has this special control word called \field and i'd like to use Microsoft's RichEdit control and handle this \field myself. But i can't seem to find anyway to make the RichEdit control break out to allow me to handle this control word. Currently the RichEdit control does understand this control word but it doesn't process it, it just gives out whatever fldrslt has. I'd like to use the control to have dynamic text.
currently MS Word uses this \field to do processing of time, author, date saved and so on to dyanmically change text on the word file when it is opened.
|
|
|
|
|
upz
|
|
|
|
|
Hi All!
How can I capture the masked text in Editbox, HTML, static,...!
|
|
|
|
|
GetWindowText
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Example...
I create a dialog called CMyDialog.
Sometimes when I add it to to the project through the classwizard, it says it cant open the files "MyDialog.h" and "MyDialog.cpp". And other times it will say the the above files already contain remnants of that class.
I cant figure out what the problem is!
Thanks,
Daniel
|
|
|
|
|
You're adding classes with the same name over and again. If you remove a class from a project, go in and delete the files also.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thats not the case. I know for a fact that the files dont exist.
Thanks for the reply.
Daniel
|
|
|
|
|
Then your computer is screwed. Are you running out of hard drive space or something ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Its probably something I'm overlooking.
My machine is fine.
|
|
|
|