|
It's a perfect article, thanks a lot!
|
|
|
|
|
You are welcome.
-Saurabh
|
|
|
|
|
|
Code must be written to be read, not by the compiler, but by another human being.
good word, thinks!
|
|
|
|
|
|
Hi everyone,
I want to learn make services but I don't know any thing about it do you know good reference or book for it?
|
|
|
|
|
|
I'm developing a game application, with multiple windows, in C++ on Win32.
My sound needs is to play a few short sounds when some events happen, plus some background music in the main menu.
The thing I need to do : stop play sounds of window1 when switching focus to window2 in my application.
I CAN DO THIS PROGRAMMATICALLY, but I wonder if it's a built-in capability of the DirectSound API.
Note: it does auto-mutes my app sounds when switching focus to another app, but doesn't when switching windows inside my app.
|
|
|
|
|
I want to rotate view and also want to add a feature of viewing multiple documents (2/4) in single view (Just like Adobe PDF reader provides). Any help ?
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup
|
|
|
|
|
To make more documents but in different windows you can use multiple instance of an SDI application, if you want them in one only instance, then MDI app
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
it would see to me that If I have console application and want to do some Windows GUI CreateWindows, Dialog Box etc
I woould have to do a CreateProcess and have a .exe With a WinMain
Entry Point ???
|
|
|
|
|
|
I would then have to change the DOS app (MAIN) to A GUI App use WInMain
CHange the Subsystem in Visual Stuido right ????
|
|
|
|
|
ForNow wrote: I would then have to change the DOS app (MAIN) to A GUI App use WInMain
CHange the Subsystem in Visual Stuido right ????
Or just start a new project and share the required source files into the new project.
Also it's not a DOS app. Win32 has a console mode but there is no DOS, it's gone.
led mike
|
|
|
|
|
|
First I have to apologize since this question doesn't really an MFC specific.
I have an old MFC application that store it's configuration info in it's own folder,
since I want configuration info of the app to be the same for all user on the computer
(the configuration file is use for storing the path to current database file that user create/choose).
but in windows VISTA this method doesn't work any more due to data virtualization.
The question is where should I put this file ,
so that it can be access by application running from different user with out
suffer from virtualization effect ?
The method I am come up now is
1.every time user ran an application I check for c:\somefolder\config.xml
if the folder or file doesn't exist(like running application for the first time
or someone accidently delate it),I create them on the fly.
2.since this folder wont be affect by data virtualization ,
the config file can be use by any other user on this computer.
but instead of making my folder in an obivious place like c:\somefolder, Are there
any default location on every windows (2000/xp/vista) that I can create my global
config file (like c:\windows_default_globalinfo\MyAppData\config.xml or some thig like that)?
|
|
|
|
|
Vista introduced the "ProgramData" folder for this. Typically, it's C:\ProgramData\[Company]\... You should be using the SHGetFolderPath()[^] function on earlier versions of Windows and SHGetKnownFolderPath()[^] on Windows Vista.
The SHGetKnownFolderPath takes a reference to a KNOWNFOLDERID[^] value, which is FOLDERID_ProgramData . For SHGetFolderPath , you need to use a CSIDL[^] value of CSIDL_COMMON_APPDATA .
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines][ Articles][ Blog]
|
|
|
|
|
So in order to do this I have to detect which version of windows user is running on right(to be able to calling appropriate function)?
Can you suggest me the effective way to do this ?
And another question ,is this ProgramData not affect by data virtualization right?
since the folder that store my app config have
to be create when user running application not when user install them.
Sorry to bother you with such question since I dont have a VISTA machine to test now
|
|
|
|
|
xanagan666 wrote: So in order to do this I have to detect which version of windows user is running on right(to be able to calling appropriate function)?
That's the proper way to do it. On Windows Vista, SHGetFolderPath is a wrapper for SHGetKnownFolderPath , so you could just call the one function and it will behave properly.
xanagan666 wrote: Can you suggest me the effective way to do this ?
See this article: Getting the System Version (Windows)[^].
xanagan666 wrote: And another question ,is this ProgramData not affect by data virtualization right?
If by virtualization, you mean the automatic virtualization between 32-bit and 64-bit or the UAC virtualization, I believe that is correct. This folder is not virtualized.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines][ Articles][ Blog]
|
|
|
|
|
I mean the UAC virtualization that cause writing file in system folder(like ProgramFile\MyProgramData\) redirect to virtual folder for seperate user(which I dont want,I want all user to use the same configuration of application).
|
|
|
|
|
xanagan666 wrote: I mean the UAC virtualization that cause writing file in system folder(like ProgramFile\MyProgramData\) redirect to virtual folder for seperate user(which I dont want,I want all user to use the same configuration of application).
I'm pretty sure this folder is not virtualized by UAC but you may need to ensure that the correct permissions are set on the subfolder you create.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines][ Articles][ Blog]
|
|
|
|
|
Thank for your help (this really feel like a live chat ).
|
|
|
|
|
xanagan666 wrote: Thank for your help
You're welcome.
xanagan666 wrote: (this really feel like a live chat ).
You happened to catch me while I was still actively online.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines][ Articles][ Blog]
|
|
|
|
|
Take a look at the environment variable APPDATA - this is a good place to store that type of information (Vista/XP/2000). For user specific data look at USERPROFILE.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
The default rights only give a "standard user" Read related rights.
Not much use in the real world (Application updates, etc...)
|
|
|
|