|
Hey everyone. I am trying to find a method that will tell me (in an MFC Application) what the last modified time of a folder is. I can get this information fine for a file using CFile's status method, but unfortunately it does not work for folders. Any help would be really appreciated.
|
|
|
|
|
How about ReadDirectoryChanges ?! I don't know what type of application is it that you're dealing with but you can check ReadDirectoryChages out... it's defined in kernel32.dll
|
|
|
|
|
shultas wrote:
I can get this information fine for a file using CFile's status method, but unfortunately it does not work for folders.
Why not?
CFileStatus stat;
CFile::GetStatus("C:\\Program Files", stat);
TRACE("%s\n", stat.m_atime.Format("%x"));
TRACE("%s\n", stat.m_ctime.Format("%x"));
TRACE("%s\n", stat.m_mtime.Format("%x"));
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello Friends
I am having a dialog based MFC application in which I show internet browser using Microsoft WebBrowser ActiveX control.
Here I want to hid my mouse when I press some button like F3. For this I have used PreTranslateMessage() function and I am able to capture the F3 key press event. And on that event I have written code as SetCursor(NULL) and one boolean variable I m makingit false.
And then in MyDlg::OnSetCursor() function I m returing TRUE if that boolean variable is false. else returning normal
return CDialog::OnSetCursor(pWnd, nHitTest, message);
I am able to hide cursor if I remove Microsoft ActiveX control for Web Browser...What might be the reason and what should I need to do to hide mouse cursor..
Regards,
Raj Mehta
India
|
|
|
|
|
|
Thankx a lot...
It helped me a lot...
Regards
Raj Mehta
India
|
|
|
|
|
Hi,
I am developing a MFC (VC++ 6.0) application which allows users to enter characters in certain editboxes in multiple languages (not multiple scripts in the same text) using IME (Input Method Editor). As a certain requirement I am required to determine a particular with a particular script e.g. Japanese with half katakana script so that the application can take a certain action based on it.
For achieving the above I am handling WM_INPUTLANGCHANGE and WM_INPUTLANGCHANGEREQUEST messages in a standard CWnd derived class's message map which contains visualActiveX (third party) components, I have generated the message handlers using class wizard and have made no modifications to it.
Now the problem I am facing is that the application sometimes successfully determines the changes in input language while fails at other time (no definate pattern here) which is obviously causing some functionality to fail at sometimes.
So what I am looking for is a fool proof way of determining the change in input language and then proceed further depending on the input language. If anyone knows a way to do it kindly let me know ASAP.
And just a point to ponder; could this be the case that sometimes the ActiveX component is eating up the windows messages i.e. passing them to it's default messaging processing since there are no handlers for the WM_INPUTLANGCHANGE and WM_INPUTLANGCHANGEREQUEST messages in the control and can this behavior be due to weired thread synchronisation problem
Thanks in Advance.
|
|
|
|
|
This linker error occurred to me before and I don't know how to deal with it: __beginthreadex and __endthreadex but i'm not using any threads at all. Can somebody please tell me why am i having this kind of error. Thanx
|
|
|
|
|
u need to convert your prog, to multithread cuz a library being used is multithreaded,
do like this,
in the Project Settings , select the 'C/C++' tab.
set ‘Use run-time library’ to either ‘Debug Multithreaded’ (for debug builds) or ‘Multithreaded’ (for release builds).
...and now somebody look into the previous thread...[yelling]
V
|
|
|
|
|
I'm using VC6 but I can't see the 'Use run-time library' in C/C++ tab under Project Settings.
|
|
|
|
|
It's in the Code Generation category.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Ok, I got it, thanx., But why does the error have to occur when my application is not multithreaded after all?
|
|
|
|
|
disinterface is not getting created for my component. i dont find anything starting with a "_"(underscore)ISample" i mean _ISample. how to generate it? can we mannually add a disinterface? please help. time critical!
|
|
|
|
|
[i meant this. before i type this it got posted accidentally], now i'm not able to edit the above message. anyway where's my disinterface ??
V
|
|
|
|
|
Vivekuniq wrote:
where's my disinterface
you have to Select :- SUPPORT CONNECTION POINT check box for adding connection points i.e.Disinterface in your project/ATl lib
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Im creating a multi-tabbed application, in which i constantly update status fields on all the pages, the problem being when i start up, some of the pages arent initialized or something, cause i get an assertion failure on my getDlgItem, How do i go about initializing all those tabbed pages, other than code clicking each tab?? I'm new to VC++ and .net, and I've been digging for awhile and cant come to a logical conclusion on how to do this.
|
|
|
|
|
Im using the following code to create and setup my pages
CMyPage MyPage
...
MyPage.Construct(IDD_MYPAGE_PROPERTY_PAGE);
...
AddPage(&MyPage);
Stated in the MSN docs, is that for another to work, the tab needs to be selected first, is there a way to bypass this option? Or a different way to construct the page so that it doesnt need to be clicked on?
|
|
|
|
|
|
Wow, that was quite the post. It has more information in it than many articles. It just may be worth it to take that post, add a working example, and post it as an article.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks! Glad you liked. You know, making an article out of that post does sound like a good idea. I'll try to do it as soon as I finish a couple of things that are keeping me very busy these days.
Cheers,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Its definitly on the right track, but my situation is a little more unique. Im constantly getting real time data from a socket, and is needed to post the data all over my GUI, I guess I could create all the objects from all the pages and store them, like in your example, but seems like a lot of work, cause then when a tab is clicked, i need to override the clicktab button or something so that it adds it to the queue to be constantly updated.
|
|
|
|
|
Or did i completly misunderstand what that article was telling me?
|
|
|
|
|
Hi,
If the Application thread (receiving thread) is one of the thread involved in a message deadlock, how do we solve this issue. MSDN says we should call ReplyMessage, (if InSendMessage() returns TRUE), in the WndProc of receiving thread, before calling any of the yeilding function calls like DialogBox, GetMessage, etc. But since one of the thread involved in the deadlock is the application thread itself, GetMessage would have been called before it reaches WndProc. Can anyone please help me?
Thanks in advance,
Ajay
|
|
|
|
|
Hi, i'm trying to make an aplication to blend subtitles onto a video stream. The renderer i need to use is the Video Mixing Renderer 9. The application is based on one of the examples of the DirectX SDK, called Text9. I'm using parto of the code. I've build the filter graph, with the VMR-9 as renderer. When i try to add the bitmap to the VMR's input, the program says: "Unhandled exception in executable.exe:0xc0000005:Access Violation".
This is the code:
HRESULT CText::BlendText(TCHAR *szNewText)
{
LONG cx, cy;
HRESULT hr;
CSubtitlesDlg dialog;
// Read the default video size
// hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
// Create a device context compatible with the current window
HDC hdc= GetDC(dialog.GetSafeHwnd());
HDC hdcBmp = CreateCompatibleDC(hdc);
// Write with a known font by selecting it into our HDC
HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
// Determine the length of the string, then determine the
// dimensions (in pixels) of the character string using the
// currently selected font. These dimensions are used to create
// a bitmap below.
int nLength, nTextBmpWidth, nTextBmpHeight;
SIZE sz={0};
nLength = (int) _tcslen(szNewText);
GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
nTextBmpHeight = sz.cy;
nTextBmpWidth = sz.cx;
// Create a new bitmap that is compatible with the current window
HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth, nTextBmpHeight);
ReleaseDC(dialog.GetSafeHwnd(), hdc);
// Select our bitmap into the device context and save the old one
BITMAP bm;
HBITMAP hbmOld;
GetObject(hbm, sizeof(bm), &bm);
hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
// Set initial bitmap settings
RECT rcText;
SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
SetBkColor(hdcBmp, RGB(255, 255, 255)); // Pure white background
SetTextColor(hdcBmp, g_rgbColors); // Write text with requested color
// Draw the requested text string onto the bitmap
TextOut(hdcBmp, 0, 0, szNewText, nLength);
// Configure the VMR's bitmap structure
VMR9AlphaBitmap bmpInfo;
ZeroMemory(&bmpInfo, sizeof(bmpInfo));
bmpInfo.dwFlags = VMRBITMAP_HDC;
bmpInfo.hdc = hdcBmp; // DC which has selected our bitmap
// Remember the width of this new bitmap
g_nImageWidth = bm.bmWidth;
// Save the ratio of the bitmap's width to the width of the video file.
// This value is used to reposition the bitmap in composition space.
g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
// Display the bitmap in the bottom right corner.
// rSrc specifies the source rectangle in the GDI device context
// rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
bmpInfo.rDest.left = 0.0f + X_EDGE_BUFFER;
bmpInfo.rDest.right = 1.0f - X_EDGE_BUFFER;
bmpInfo.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
bmpInfo.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
bmpInfo.rSrc = rcText;
// Transparency value 1.0 is opaque, 0.0 is transparent.
bmpInfo.fAlpha = TRANSPARENCY_VALUE;
// Set the COLORREF so that the bitmap outline will be transparent
// SetColorRef(bmpInfo);
// Give the bitmap to the VMR for display
CFilterGraph Graph;
hr = Graph.m_pBMP->SetAlphaBitmap(&bmpInfo); <----This is the point where i get the problem.
// Select the initial objects back into our device context
DeleteObject(SelectObject(hdcBmp, hbmOld));
SelectObject(hdc, hOldFont);
// Clean up resources
DeleteObject(hbm);
DeleteDC(hdcBmp);
return hr;
}
|
|
|
|
|
Hi
We have a large app that we are converting to WinXP from Win2000. We would like our toolbars and dialogs (check boxex, radio buttons, push buttons etc) to have the WinXP look and feel (called a theme maybe?).
How can this be achived ? I have added a call to InitCommonControlsEx() at the start of our GUI thread, but the buttons still look the old way.
Any ideas on an easy way to get the WinXP look and feel ?
Thanks
Tim Cox
|
|
|
|