|
Have a look here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
I am using new MFC Feature pack and trying to create 4 DockablePanes in the child frame. A view is created in each of these dockable panes.When I run the application, only two of the panes (the first and the last one) are only shown and the remaining are hidden. Once I drag the splitters, they are seen and they function normally from then.I am unable to trace the problem. Is there any limit on the number of dockable panes that an application can have? Could anyone let me know as how to solve this problem so that I can view all the panes?
Thanks in advance
Taruni
|
|
|
|
|
I think there is no number limitation. I once created an application with 5 docking panes in the main frame, and with additional 6 panes for each new popup child frame. (exactly like MSOutlook when you open many windows for composing new messages).
Actually you have to check your code in CMainFrame::OnCreate member when you must have set the docking mode, autohide, docking side globally and must have called the ::EnableDocking and ::DockPane for each pane object.
Also check to clean up the registry entry corresponding to your application. Those panes persist their behavior in the registry, and restore the past settings even if you change your source code and run the new version of the program.
|
|
|
|
|
Thank you. I am able to create multiple dockablepanes in the childframe, but I have one more problem. There are four dockable panes in my childframe and the splitter for only the last dockable pane is only seen. When I double click or adjust the last pane's splitter or click on the "Auto Hide" button of any of the dockable panes or close any of the dockable panes, then only all the other panes splitters are seen. Please let me know as how to make the splitters of all the panes visible as soon as run my application.
Taruni
|
|
|
|
|
My code has russian comments in it but they appear unintelligible, like this:
#define DEMO //УРґЛєк¶ЁТе±нКѕУРЧўІб№¦ДЬµД°ж±ѕЈ¬·сФтОЮ
I tried fiddling with the fonts but it didn't work. btw it's possible they're written with the MS-DOS cyrillic charset.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Have you tried this after setting Russian in the "Regional Options" and "Advanced" tabs of "Regional and Language Options" in the Control Panel!
|
|
|
|
|
i tried it but still no luck. actually i changed the option under the 'Advanced' tab (lang for non-unicode programs), the regional options tab was for dates, times, currencies etc.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Have you restarted your computer after making changes in "Regional Settings" section in Control Panel.
|
|
|
|
|
I have application in which I need to show a progress window frm a worker thread.
create another thread for the progress window and launch the dialog. Now I need to change the status text on the progress dilog. I try sendmessage, but that doesn't work.
|
|
|
|
|
Hi Ron,
Can you show us how you are posting the message to the dialog created from the worker thread?
Best Wishes,
-David Delaune
|
|
|
|
|
ThisIsMeRon wrote: I have application in which I need to show a progress window frm a worker thread
Worker thread probably will be busy with some other processing so it's always better to run the progress GUI in different UI thread(Which is able to process the UI messages).
Sharing the MFC Window handle (CWnd or it's derivatives) objects across thread is not safe. So pass the HWND of progress bar UI (Dialog, control or whatsoever) and you can simply Post/Send message using this handle. If you've properly mapped the message in the destination window, it will surely receive it. Please try to post snippets from your code.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
You should create the progress window in the main UI thread and send/post messages to it from the worker thread, really. Just don't send too many messages. Probably posting is better, otherwise the worker thread is going to wait for the progress message to be processed, which rather defeats the object of having a separate worker thread!
|
|
|
|
|
I got it working..
I created a new thread. In the thread I call Domodal() on progress dialog's global object. Then everytime I need to change some status I just call the Set... member functions using the global object.
|
|
|
|
|
ThisIsMeRon wrote: I have application in which I need to show a progress window frm a worker thread.
Not a good idea. The UI component should be owned by the primary thread. The secondary (i.e., worker) thread should post messages to the primary thread indicating the progress. It's all explained in more detail here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I want to make rich edit control detect e-mail automatically.
Same as it detect URLs when we set 'EM_AUTOURLDETECT' style through message .
Is there any style we need to set for this purpose?
Thanks..
|
|
|
|
|
The EM_AUTOURLDETECT Message[^] already detects the mailto URL[^]. If you want to add additional functionality then you will have to implement it yourself. You could probably use a combination of EM_FINDTEXT and EM_EXSETSEL to copy all words with the @ symbol and use a pattern matching algorithm to determine if it appears to be an e-mail address. Upon finding said e-mail address replace the text with a valid mailto URL.
Best Wishes,
-David Delaune
|
|
|
|
|
Is it[^] helpful?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
These two APIs are very similar but it is unclear what the differences are and when each should be used (Except that LoadUserProfile is specified for use with CreateProcessAsUser which I am not using. I am simply impersonating for hive accesss).
LoadUserProfile
http://msdn.microsoft.com/en-us/library/bb762281(VS.85).aspx
RegOpenCurrentUser
http://msdn.microsoft.com/en-us/library/ms724894(VS.85).aspx
According to the Services & the Registry article:
http://msdn.microsoft.com/en-us/library/ms685145(VS.85).aspx
we should use RegOpenCurrentUser when impersonating.
But what does/should RegOpenCurrentUser do if the user profile is roaming - should it load it?
As far as I can tell from these docs, both APIs provide a handle to the HKEY_CURRENT_USER for the user the thread is impersonating. Therefore, they both "load" the hive i.e. lock it as a database file and give a handle to it for registry APIs.
It might seem that LoadUserProfile loads the user profile in the same way as the User does when he/she logs on, whereas RegOpenCurrentUser does not - is this correct? What is the fundamental difference (if any) in how these two APIs mount the hive?
What are the implications and differences (if any) between what happens IF
1. A user logs-on or logs-off while each of these impersonated handles is already in use?
2. A user is already logged-on when each matching close function (RegCloseKey and UnloadUserProfile) is called?
|
|
|
|
|
I am designing a Service to run under LocalSystem account on Win2000, XP and Vista. It will need access to users registry hives, sometimes for extended periods of time, both when the users are logged-in, and also, when they are not logged-in (IF the profile is local. If the profile is Roaming and not loaded, I will not attempt to load it.)
If the user is logged-on, I can get the Users access token by various means (E.g. from its Explorer process, or by receiving Logon events from the Service Control Manager) then use ImpersonateLoggedOnUser and RegOpenCurrentUser to access the User's hive. However, what are the implications if the User selects LogOff from the start menu while I am impersonating and have his hive open? Will the logoff be prevented? Will my impersonation be terminated?
If the user is not logged on, I can use RegLoadKey to directly open the hive NTUSER.DAT. (Impossible for a logged-on user). But what are the implications of this if the user decides to log-on (I suppose the hive will be locked and the logon either prevented, or may experience difficulty?)
I will be setting up some test projects to explore these ideas however, regardless of their apparent results, these questions are theoretical in terms of what type of problems might, or would, be caused by the user loggin in/out during these actions by the service.
Caveat: ImpersonateLoggedOnUser can ONLY be used either for a logged-on user (token obtained from process or SCM event) OR for a user for which I have the plaintext password to call WinLogon and obtain a token - TRUE / FALSE ? In other words although I have maximum permissions as LocalSystem and am able to change the user's password or even delete the user's account, if the user is not logged-on, it is totally impossible to create a new token to impersonate the user without having the the password?
|
|
|
|
|
Is there any way to create Media player 10-like toolbar using plain Win32 API?
|
|
|
|
|
If you mean, can an MP10 like toolbar be WRITTEN in C++ using plain Win32 api, i'd say yes. If you mean, can the same control as MP10 uses be "instantiated" in another aplication, no idea, that control IF it is a control at all, is probably implemented in MP itself so that could prove...problematic. But it's just a guess.
p.s: Try using spy++ to check what class that toolbar has and googling for it, maybe it pops up something.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
modified on Tuesday, January 20, 2009 6:24 AM
|
|
|
|
|
I have for example a drive letter, say 'E:\', and I want to programatically check if it's the CDROM. Any way to do that?
Thanks.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
modified on Monday, January 19, 2009 12:16 PM
|
|
|
|
|
|
Thanks, and one more question, does GetDriveType return DRIVE_CDROM for dvd's as well? Because there wasn't any mention of DVDs in the MSDN article.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: does GetDriveType return DRIVE_CDROM for dvd's as well?
Yes, it will return DRIVE_CDROM for all drives which support reading a CD-ROM. One way to determine if the device is actually a DVD-drive is to use DeviceIOControl such as follows:
#include <winioctl.h>
BOOL DeviceSupportsDVDMedia(TCHAR *szDrive)
{
BOOL bRet = FALSE;
if(NULL != szDrive && DRIVE_CDROM == GetDriveType(szDrive))
{
GET_MEDIA_TYPES media[CHAR_MAX];
TCHAR szVol[MAX_PATH] = {0};
DWORD dwBytesRet =0;
int iSize = CHAR_MAX * sizeof(GET_MEDIA_TYPES);
_stprintf(szVol,_T("\\\\.\\%c:"),szDrive[0]);
HANDLE hDevice = CreateFile(szVol,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,0);
if(INVALID_HANDLE_VALUE != hDevice)
{
if(DeviceIoControl(hDevice,IOCTL_STORAGE_GET_MEDIA_TYPES_EX,NULL,0,media,iSize,&dwBytesRet,FALSE))
{
bRet = FILE_DEVICE_DVD == media->DeviceType;
}
}
}
return bRet;
}
Best Wishes,
-David Delaune
[Updated January, 15, 2010]
I was contacted by a member regarding this code sample. I noticed the code sample was very poorly written (sorry bout that). I have updated it.
modified on Saturday, January 15, 2011 4:33 AM
|
|
|
|