|
BOOL GetFileTime(
HANDLE hFile, // handle to file
LPFILETIME lpCreationTime, // creation time
LPFILETIME lpLastAccessTime, // last access time
LPFILETIME lpLastWriteTime // last write time
);
|
|
|
|
|
Please put your code within <pre></pre> tags as noted in the guidelines.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
GetFileTime function.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Tis a real pity how people don't have MSDN or know how to google. But thanks to you they can breathe a sigh of relief...once again the day is saved....thanks to...CPallini
|
|
|
|
|
Yes, CPallini is a bot forwarding to Google...
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
I got the value in WIN32_FILE_ATTRIBUTE_DATA structure then how to format time like ""13/10/2010 2:51 PM"
code is
GET_FILEEX_INFO_LEVELS fiid;
WIN32_FILE_ATTRIBUTE_DATA fileinfo;
::GetFileAttributesEx(m_szFilePath,fiid,&fileinfo);
|
|
|
|
|
You can do it (at least) in two ways:
- Use the FileTimeToSystemTime Function (Windows)[^]: the
SYSTEMTIME structure that you get has separate fields for day, month,year, etc. and you have only to use printf or sprintf with an appropriate format string - Use the CTime Class (ATL/MFC)[^]: one of its constructors accept a reference to a
FILETIME structure. Then use the CTime::Format (ATL/MFC)[^] method, that returns a CString formatted accordingly to the specified format string
|
|
|
|
|
Hello, guys
CMFCRibbonBaseElement::SetVisible do not work....
But, I need this function.
How to hide the CMFCRibbonBaseElement????
Any help, or suggestion on where to look for help would be appreciated.
modified on Wednesday, October 13, 2010 3:45 AM
|
|
|
|
|
I never worked with the MFC version of the ribbon bar, only with the BCG version...but with that after making changes like that you would have to call RecalcLayout on the ribbon bar instance to make your changes take effect, maybe the MFC version has that too, give it a shot.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hi,
Normally I can figure this stuff out, but not this one. I have just upgraded my program from VC6 to VS 2010. Quite a jump. It allows me to do things like actually debug now which is fantastic. Anyway, I have found a problem that I do not understand.
Basically there is a function (which I did not code originally) that is used to convert a hex string into a binary buffer.
ULONG util_ConvertHexStringToBin(char *pszHexString, void *pBinaryBuffer, unsigned int uiBufferSize)
{
unsigned int uiHexPairs;
unsigned int uiByteIndex;
char *pszParse = NULL;
BYTE ucTempByte;
uiHexPairs = strlen(pszHexString)/2;
pszParse = pszHexString;
uiByteIndex = 0;
while (uiByteIndex < uiBufferSize && uiByteIndex < uiHexPairs)
{
sscanf_s(pszParse, "%2x", &ucTempByte);
((BYTE *)pBinaryBuffer)[uiByteIndex] = ucTempByte;
pszParse += 2;
uiByteIndex++;
}
return uiByteIndex;
}
The problem is, as soon as sscanf_s is called, pszParse becomes invalid. I've seen other strange things too, like the uiByteIndex being reset to 0 when calling sscanf_s. I have tried sscanf as well with the same results.
The problem this is at the edge of my c++ knowledge. Its acting like the memory where these varables are stored is free and being overwritten, but this shouldn't be the case. I'm getting different results all the time with this function and this worries me a lot!
Any help, or suggestion on where to look for help would be appreciated.
|
|
|
|
|
What do you mean exactly by "pszParse becomes invalid" ? What is your program doing ?
|
|
|
|
|
It gets changed from its current location, pointing to a location in the input hex string, to another seemingly random one. In most cases this throws a access violation when it is next used, but not always.
|
|
|
|
|
If you look at the type fields documentation[^] you can see that providing 'x' means that you want to read an hexadecimal integer. The result should be stored in an integer, not in a byte. The sscanf_s is probably corrupting memory when trying to write the integer to the byte you provided. Try with to supply an integer instead (you'll need to retrieve the first byte of the integer after it but a simple cast will do it).
|
|
|
|
|
Thanks Cedric, that worked a treat. Somthing else for me to look out for in future. Thank you!
|
|
|
|
|
int CreateArray(void** data, unsigned int* size)
{
}
int main()
{
unsigned char* data = 0;
unsigned int size;
int res = CreateArray(&data, &size);
}
Is it possible to avoid void* pData in main function and pass directly data pointer?
Чесноков
|
|
|
|
|
You may perform a cast.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CreateArray(&(void *)data) does not work.
What is the correct one?
Чесноков
|
|
|
|
|
The other one:
int res = CreateArray((void **) &data, &size);
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
that one is great, thanks.
Чесноков
|
|
|
|
|
Hello Guys
i am reading a tiff file and i m having all its image data with other tags too,now I want to show this image in frame window.How can I do this in MFC?
Is something thru OpenDocumentFile()?
Any Ideas??
Regards
Yogesh
|
|
|
|
|
I'm trying to auto-scroll while dragging; this is the gist of my code:
In OnLButtonDown I capture the mouse.
In OnMouseMove I set a timer to an initial value.
In OnTimer I send a WM_VSCROLL message and reset the timer to a shorter interval.
So when I stop moving the mouse, the scrolling happens, but only at the rate of the longer (initial) interval. Lots of investigation reveals that OnMouseMove is being called again, AFTER I send the WM_VSCROLL, even though the mouse has not been moved, and so the timer is being reset to the longer value. Is Windows somehow generating extra WM_MOUSEMOVE messages in response to the WM_VSCROLL? I'm completely mystified.
In case it's relevant, the WM_VSCROLL is sent to a different window to the one that did the mouse capture.
|
|
|
|
|
You might find here [^] what you looking for ...
|
|
|
|
|
Thanks, but I was looking for information about extra mouse messages.
Further debugging suggests that Windows generates a mouse-move message at various odd times, even though the mouse has not moved. For example, if I set a breakpoint in OnMouseMove, it is triggered immediately. I hit F5 to continue running the app (being careful not to touch the mouse), and the breakpoint is triggered again. It seems that Windows sends a mouse-move message when it activates a window, perhaps just to remind it where the mouse is. Does anyone know for sure whether or not that is the case, and what other circumstances may lead to spurious mouse-move messages?
|
|
|
|
|
hello guys....i have written some code in C# (did some database work in C# using ADO.NET). Now I dont want to do that from scratch in vc, i just want to add that class to my vc prject and do my job. Is it possible, if yes how??....thnx
|
|
|
|