|
I need functions to get following directories - except SHGetSpecialFolderPath() or SHGetFolderPath(), because they don't work well on win98 and win2k.
typical directories are:
1. C:\Documents and Settings\All Users\Start Menu\Programs
2. C:\Documents and Settings\All Users\Desktop
3. C:\Program Files
|
|
|
|
|
Quit spamming the board. You have precisely the same post three threads before this. Do you really think someone is going to respond to this, who didn't respond to the first one?
All you manage to accomplish with this is to irritate anyone who might have been willing to help you.
|
|
|
|
|
Please Calm Down,
LunaticFringe wrote: You have precisely the same post three threads before this (underline by bvk)
It is technically a subtly different question.
I agree, it would have been better dealt with in the previous thread, but, then again...
To Err is Human, to forgive is devine.
Regards,
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: but, then again...
To Err is Human, to forgive is devine.
Given that the OP does this sort of thing regularly, LunaticFringe's response was not inappropriate.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I refer you to my previous answer to this question - which is still on the first page of the forum.
OK, I've now looked, and your previous question did not mention SHGetFolderPath.
But you never replied to my answer, which is a) rude, b) making me unbothered to help you, and c) not helpful to anybody else who might still care about you.
Did you try my advice? Did it fail?
Iain.
edited again:
I've relooked at you as a member, and remember previous threads like this. You're able to write good articles, so you're far from an idiot. I didn't enjoy "spot the difference" competitions when I was young, so all that posting 99% identical questions, instead of following up on previous helpers does is antagonise the very people you want help from. Please apply the same brain you use to write nice articles to writing better forum posts.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
I am creating a popup window which slides from the taskbar region. I created a dialog class and attached it into my dialog window. Please tell me which function should i override to put the AnimateWindow, so that when I call DoModal() Dialog will have the slide effect.
Thanks in advance.
Regards,
J.
|
|
|
|
|
|
I have created a simple dialog box using visual studio's form editor, and am creating the dailog like so:
DialogBox(NULL, MAKEINTRESOURCE(IDD_IMGPROPS), hWnd, reinterpret_cast<DLGPROC>(dlgImgPropsProc));
The dialog procedure looks like this:
LRESULT CALLBACK dlgImgPropsProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
SendMessage(GetDlgItem(hWnd, IDC_IMGPROPS_SPINW), UDM_SETBUDDY, (WPARAM)GetDlgItem(hWnd, IDC_IMGPROPS_WIDTH), 0);
SendMessage(GetDlgItem(hWnd, IDC_IMGPROPS_SPINH), UDM_SETBUDDY, (WPARAM)GetDlgItem(hWnd, IDC_IMGPROPS_HEIGHT), 0);
return TRUE;
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDC_IMGPROPS_OK:
EndDialog(hWnd, 0);
return TRUE;
}
break;
default:
return FALSE;
}
return FALSE;
}
Now, the problem is that every time my application hits the call to createDialog(), it hangs... and it seems to be pretty permanent. I've stepped through the dialog procedure and my dialog is recieving the following messages:
48 WM_SETFONT
85 WM_NOTIFYFORMAT
297 WM_QUERYUISTATE
85 WM_NOTIFYFORMAT
297 WM_QUERYUISTATE
272 WM_INITDIALOG
1024 WM_USER
24 WM_SHOWWINDOW
70 WM_WINDOWPOSCHANGING
71 WM_WINDOWPOSCHANGED
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
131 WM_NCCALCSIZE
15 WM_PAINT
133 WM_NCPAINT
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
20 WM_ERASEBKGND
310 WM_CTLCOLORDLG
307 WM_CTLCOLOREDIT
307 WM_CTLCOLOREDIT
312 WM_CTLCOLORSTATIC
307 WM_CTLCOLOREDIT
307 WM_CTLCOLOREDIT
309 WM_CTLCOLORBTN
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
...
Now, I'm guessing that it just continues on forever there with WM_GETICON. I didn't bother stepping through it any further than that. My question is, what would cause my dialog to continuously recieve the WM_GETICON message, and how can I fix it?
|
|
|
|
|
I've tracked down the problem and found a solution.
In my .rc file I had the following:
IDD_ABOUT DIALOGEX 0, 0, 219, 110
STYLE DS_SYSMODAL | DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
CTEXT "Lorem Ipsum",IDC_STATIC,7,7,205,96
PUSHBUTTON "OK",IDC_ABOUT_OK,84,89,50,14
END
IDD_IMGPROPS DIALOGEX 0, 0, 101, 73
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Image Properties"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
EDITTEXT IDC_IMGPROPS_WIDTH,35,7,49,14,ES_AUTOHSCROLL | ES_WANTRETURN | ES_NUMBER
CTEXT "Width:\n\n\nHeight:",IDC_STATIC,8,9,27,34
EDITTEXT IDC_IMGPROPS_HEIGHT,35,32,49,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_IMGPROPS_SPINW,"msctls_updown32",UDS_ARROWKEYS,84,7,10,14
CONTROL "",IDC_IMGPROPS_SPINH,"msctls_updown32",UDS_ARROWKEYS,84,32,10,14
PUSHBUTTON "OK",IDC_IMGPROPS_OK,25,52,50,14
END
The problem seemed to be the window style of the second dialog box. Replacing it with the same style as the first one solved it.
What then is it, about the combination of the flags DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU that caused my dialog to recieve a constant stream of WM_GETICON messages?
|
|
|
|
|
I need functions to get following directories - except SHGetSpecialFolderPath(), because it doesn't work well on win98 and win2k.
typical directories are:
1. C:\Documents and Settings\All Users\Start Menu\Programs
2. C:\Documents and Settings\All Users\Desktop
3. C:\Program Files
|
|
|
|
|
may be solve your problem
CString sortfile="Add Path";
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_SYSTEM|CSIDL_FLAG_CREATE,
NULL,
0,
szPath)))
{
PathAppend(szPath, sortfile);
}
TCHAR szPathDesk[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_DESKTOP|CSIDL_FLAG_CREATE,
NULL,
0,
szPathDesk)))
{
PathAppend(szPathDesk, sortfile);
}
|
|
|
|
|
You should make sure if they work on win98 before you post your lovely code.
|
|
|
|
|
It's not up to him to test his suggestion on every version of the OS you might be interested in using. That's your job.
You might have told him thanks instead of being a wiseass. I doubt many more will be lining up to help.
|
|
|
|
|
first you test then give response.
|
|
|
|
|
I've looked at the docs for SHGetSpecialFolderPath (just google "msdn SHGetSpecialFolderPath").
I found this near the bottom:
With Microsoft Windows 2000, this function is superseded by ShGetFolderPath. You can use this function on earlier systems by including the redistributable DLL, ShFolder.dll.
So, if you're right, then maybe you could use that redistributable file.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
I'm wading trough code dealing with UNC Names and Mapped Drives. It suddenly occurred to me that a DriveSpec of say 'C:\' limits the number of drives to 26. It also occurred to me that Microsoft may not have set anarbitrary maximum of 26 Drives (included Mapped Drives).
What is the limit (if any), and what would be the syntax for drives beyond 26.
I just want to proof things against some future Idiot who's going to phone me in time to come about software failing in obscure ways and who, as it might transpire has say 32 Disks on his system.
Regards
Bram van Kampen
|
|
|
|
|
You can only have 26 drive letters because it is limited by the english language.
But you can have more than 26 volumes using something called as Reparse points .
Reparse point s allows you to create NTFS junction folders where a folder points to a different volume.
So when you're accessing the folder, you're actually accessing the root of another volume.
Sysinternals has a tool to manipulate junctions - Junction v1.05[^]
Read more about NTFS junction points - How to create and manipulate NTFS junction points[^]
|
|
|
|
|
In addition to <superman>'s response, you can attach a drive to an empty NTFS directory on another drive with standard tools.
In Vista... control panel, admin tools, computer management, disk management, right click on a partition and choose drive letters and paths.
I assume something similar in 7, and XP.
Besides, "26 is enough letters for anyone!"
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thanks to Both,
Iain Clarke, Warrior Programmer wrote: Besides, "26 is enough letters for anyone!"
I wholehartedly Agree. It is not that I am looking for more Drive Letters, I just am trying to anticipate what customers in the field 'might' do. In a nutshell, my Software fishes a 'Path' out of the Registry, and must decide whether this path refers to a file on a Local Drive, or to a file somewhere on the Network.
This is all in aid of a larger design which retrieves timestamps from a designated machine on the network.
My initial approach was that if it is a UNC Name, e.g. '//Server1/Data/MyData.Dat', it refers to a File on the Network, UNLESS the Name of this computer is 'Server1'. and, Alternatively, that if it is of the form 'P:\Application Data\...\MyData.Dat' that it refers to a Local File, UNLESS 'P:\' is a Mapped Drive, which we can determine with GetDriveType.
Now, this 'Junction' stuff seems to throw sand in the above machinery. I had never heard of it, cannot imagine I will ever need it, but, Some future customer somewhere someday just might!
And THEN we have suddenly an obscure bug which causes the time stamp to be incorrect on certain machines (Actually it would retrieve the timestamp successfully from but from the wrong machine, and would give 'Time Server Errors' if this machine were switched of, but that might not be clear at the time! So, I want to trap these situations, both during Setup and at Startup.
Now I'm Stuck!
Maybe I should re-phrase the question as Follows:-
'How do I determine whether a path points to a Local File, or a File on the Network'
Thanks,
Bram van Kampen
modified on Saturday, December 5, 2009 8:13 PM
|
|
|
|
|
Bram van Kampen wrote: 'How do I determine whether a path points to a Local File, or a File on the Network'
How about GetDriveType() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I'm going to make your life harder still:
Taxes: Hierarchical Storage Management[^]
This is not something I've ever come across myself - but you're actively looking for edge cases, which I approve of 100%.
But a little easier also. I didn't trust explorer to show every possibility with the Tools | Map Network Drive command, so I looked at "net use /help" at a command prompt, and saw this following bit:
The syntax of this command is:
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
....
devicename Assigns a name to connect to the resource or specifies
the device to be disconnected. There are two kinds of
devicenames: disk drives (D: through Z:) and printers
(LPT1: through LPT3:). Type an asterisk instead of a
specific devicename to assign the next available
devicename.
....
So, that implies strongly that volume reparse stuff is only for actual partitions, not network drives.
So GetDriveType will work for you if the path starts with a drive letter.
Hope that helps!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Bram van Kampen wrote: I just want to proof things against some future Idiot who's going to phone me in time to come about software failing in obscure ways and who, as it might transpire has say 32 Disks on his system.
If they managed to successfully label 32 disks on their system (with only 26 letters), why would your code care? Now if it was your code's job to do that labeling, that's a whole other issue.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: If they managed to successfully label 32 disks on their system (with only 26 letters), why would your code care? Now if it was your code's job to do that labeling, that's a whole other issue.
Because I need to determine if something like 'C:\Drive32' refers to a Dir on the Current Computer, or to a File located on a Share on another computer. GetDiskId() tells me it is on thisone, the Name suggests otherwise!
Thanks,
Bram van Kampen
|
|
|
|
|
I tryed to use
AddAceToObjectsSecurityDescriptor()
http://msdn.microsoft.com/en-us/library/aa379283%28VS.85%29.aspx[^]
to give certain rights to some generic users on files, directories, etc.
All worked OK until I tryed to use the acronyms
Everyone
Guest
etc.
on system that are localized (German, Finnish, etc.). Is there any alternate solution to
AddAceToObjectsSecurityDescriptor()
on giving rights?
I think that this "names" are aliases for system values (numbers).
Any solution?
...In VC++6 please. I'm an old fashion boy.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Greetings!
I am developing in C++ using MS Visual Studio 2008.
Code for our main application is contained in about 25 separate projects in our main workspace. In addition, we have a few other projects in that workspace because they use some of the same DLLs. I am working on a couple of DLLs that will provide data access services for a major upgrade to the application expected in a few months. I have a small test application for my new DLLs.
The test application and the new DLLs are not in the dependency list for our major application.
I just downloaded code for the major application from source control, set the major application to be the startup project, and rebuilt it. The test application and the new DLLs got built along with everything else!
If VS 2008 does not listen to a project's dependency list, how does it decide which files to compile? Or does the startup project not control what gets built when a user presses F6?
Thank you very much.
RobR
|
|
|
|
|