|
Thanks for your reply.
I have already tried this function, but I do not know how to use it to get what I need. I guess that the "hToken" parameter is the answer. Problem is, I do not know the process to create such a token (access token).
Could you help me further with this issue please?
Bila
|
|
|
|
|
Bila1 wrote: I guess that the "hToken" parameter is the answer. Problem is, I do not know the process to create such a token (access token).
You can use LogonUser() to retrieve the token.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks, this sure helps.
Now, one more twist: is there any other way I can do what I need -without- requiring the user's password?
|
|
|
|
|
You may read them under HKEY_USERS, but it is not suggested. Some keys are not created until the special folder path is requested by the user, and you may not have the permission to read these entries.
Regards
Microsoft MVP in Visual C++
www.jiangsheng.net
|
|
|
|
|
Hi,
I already tried this approach but no success. Reason is that there are no keys in HKEY_USERS hive for any other users beside the current user and some system users (NETWORK SERVICE, LOCAL SERVICE if I remember correctly).
If the problem is really with access permissions, is there a way to obtain them so I can read this hive? Maybe some workaround?
Or for that reason, any other way at all to find out a special folder for any other user (I specifically need the startup folder)?
Thanks.
Bila
-- modified at 3:56 Tuesday 24th October, 2006
|
|
|
|
|
Bila1 wrote: ...is there any other way I can do what I need -without- requiring the user's password?
Yes, but it's a bit more involved. You'll need to iterate through the folders in the following registry key:
HKEY_USERS\xxxx\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
You'll need to loop through the users to find the right one (SID).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I already implemented this approach, but it does not give satisfying results (please see my reply to Jiang Sheng above).
Any other suggestion?
|
|
|
|
|
Hi all,
I see that C++ is still powerful although managed C++ is out and Microsoft is trying very hard so that every programmer will want to move to managed C++ or C#.
I have try following Microsoft .NET framework (C#) but it grows too fast so that I always lose track of it, and it has new programming paradigms, terms and concepts such as GAC, CASPOL and so on. Who can exactly tell me those concepts are not going to change in the next version of Microsoft .NET Framework? Or a new concept is out and what we programmer do is often learn and learn again.
Is there anybody knows the real future of managed C++? Can we really program API (direct access to API) in windows vista? So we can avoid those always growing concepts (and oftenly even the language can grow such as template c#, hmm i forget what it calls).
I want to avoid those growing concepts and learn what a real programmer should learn, such as algorithm, data structure, rendering, and so on. Is there any C++ library that is as powerful as .NET, such as easily making control dockable, and easily making connection and use the framework provided by it and so I can focus learning API?
I have heard Corba but dunno what it is. Is there anybody knows?
|
|
|
|
|
Sora Innosia wrote: Is there anybody knows the real future of managed C++?
It seems to be the glue to wrap old, tested code in an assembly to be used by .NET-programsn and to make the new, .NET-coded stuff accessible for old-school code (in the way of a bridge-dll).
Sora Innosia wrote: I have heard Corba but dunno what it is. Is there anybody knows?
Something like COM/DCOM. But totally different.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Sora Innosia wrote: I see that C++ is still powerful although managed C++ is out and Microsoft is trying very hard so that every programmer will want to move to managed C++ or C#.
Unmanaged C++ isn't going anywhere. There is so much C/C++ code written for applications out there already, and even more being written in it everyday (that either cannot or will not be written with managed code). Managed C++, VB.Net, C#, etc. can be used anywhere you would use Java. That is, there are some application domains where these languages will thrive (largely due to the type or programmers that are in those domains, but also to the requirements for applications there). C/C++ will always be used when there is a need for efficiency and control (e.g. low-level OS, game engines, embedded systems).
Sora Innosia wrote: I have try following Microsoft .NET framework (C#) but it grows too fast so that I always lose track of it, and it has new programming paradigms, terms and concepts such as GAC, CASPOL and so on. Who can exactly tell me those concepts are not going to change in the next version of Microsoft .NET Framework? Or a new concept is out and what we programmer do is often learn and learn again.
Learn standard C++ first, and then you won't worry about all the new "technologies" (which really are just renaming old techniques with new languages).
Sora Innosia wrote: Is there anybody knows the real future of managed C++?
Only time will tell. IMHO, it will be restricted to application GUIs for the most part.
Sora Innosia wrote: I want to avoid those growing concepts and learn what a real programmer should learn, such as algorithm, data structure, rendering, and so on.
Again, start learning standard C++. The .Net world is far less "scary" once you know the fundamentals behind it.
Sora Innosia wrote: I have heard Corba but dunno what it is.
If you have ever heard of DCOM, Corba is the open-source competitor for it. It is very ugly to write (just as DCOM is), and is not something you should jump into when you are just beginning.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi Zac
so the conclusion is c++ is some how worth to learn?
where should i start? I know a bit about writing form using pure c++ and API (which uses a lot of lines, struct, and so on), or should i learn MFC better?
i dun really have a clue to be a good programmer (i mean low level and really understand things). for some reason when i see people know how exactly a video file is contructed and they can even modify it using code, but i know only how to make database appliction from vb6 or .net, i thing i am quite curious to understand deeply low level thingies. is there any good site for my programming interest?
[Quote]
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week[/Quote]
so where should i sign up to?
thanks a lot
|
|
|
|
|
For a beginner, it is good to start with an introduction to C++ book. I can't really give you a recommendation on a good one since its been years since I read any, and I'm sure there are much better ones now than there were when I first learned C++. You might try to check out the local college and see what books their introduction courses use.
Once you get the basics down, Bjarne's book is a good reference, "Effective C++" and "Effective STL" by Scott Meyers are both excellent, as is "Exceptional C++" by Herb Sutter. To get into detailed programming areas (game engines, graphics, etc.) I would start with every book I could find on the subject (Barnes and Nobel is a good resource) that interests you after reading the forementioned books.
There are so many different facets to programming that there isn't just 1 site to find everything you might possibly be interested in. Are there certain niches that you find yourself interested in?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi Zac
I just got the Essential C++ book and it seems good for my start. And maybe the next one is Exceptional C++.
But i am curious that currently it is true that windows operating system uses procedural API I mean the API is not object oriented but how about the next realease or vista? Will the API all in object?
Is there any book that translates interface, function pointer in C++? Or maybe about how to write a good clean up object code in c++ (it seems that most of my c++ applications have memory leak)? and so on. I really interested in understanding microsoft OS (like what is explorer.exe do, the memory management, thread and so on).
You can see my very bad c++ game at www.innosia.com and it is open source.
thanks alot
|
|
|
|
|
"Essential C++" isn't a bad starter book. I'd read "Effective C++" and "Effective STL" before reading "Exceptional C++", though. There are some problems in "Exceptional C++" that you won't understand if you don't have a strong crasp of the language.
The Windows API is written in C. It is structural. It is also worth noting that C++ is NOT an object oriented language; it allows you to program using the object oriented paradigm, but does not limit you to it (which is one of its major strengths when compared to Java and C#). There are some things that just do not work well in the OO paradigm. The C++ standard library (STL), for example, uses the generic programming paradigm. I'm not familiar enough with Vista yet to answer your question about it with a definite yes or no. Just basing my answer on Microsoft's historical record, I don't imagine they would rewrite every part of the OS to give and object oriented API, but I could be wrong.
To understand more of the OS, check out "Programming Applications for Windows" by Jeffrey Ritcher as a starting point.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi,
I am currently building a C++ application and I want to add some gui stuff to it. Basically, it should only show the status of the basecode (I'm currently doing everything as console output), so there won't be any/much interaction with the gui and the base application. Now I want to abstract it, that I won't have to put any MFC/Gui code into the base code.
So, I thought about some sort of event callback functions.
Somewhere in the MFC init phase:
<br />
myapp = New MyApplication;<br />
<br />
myapp->SetEvent1Callback(&MyMfcApp::Event1Callback);<br />
myapp->SetEvent2Callback(&MyMfcApp::Event2Callback);<br />
<br />
void MyMfcApp::Event1CallBack(long para)<br />
{<br />
BlinkBlink(para)<br />
}<br />
<br />
Somewhere in my Code:
<br />
<br />
if(event1callback) (*eventcallback1)(para1, para2, ...);<br />
<br />
This way, I will still be able to develop the C++ basecode without mixing it with any MFC Code. You may ask why? The reason is that I want to have my C++ code gui free and change the *bling-bling* gui system later.
Is it a good idea? I'm open for every comment.
Greetings
|
|
|
|
|
Do you need any of the MFC classes? Why not just develop your console app without MFC?
Mark
|
|
|
|
|
No, I don't need any MFC classes internal. But I want to have visual output of the data. Is some sort of call monitor (with data transfer). The base code is already handling everything, but I want to see, when a new connections comes in (using some sort of leds), when a connection cancels and some sort of history monitor.
|
|
|
|
|
Hi,
I think it's an interesting idea. Sort of Document/View architecture on steroids.
Best of Luck
Tom
PS. what sort of IPC are you considering?
|
|
|
|
|
TClarke wrote: I think it's an interesting idea. Sort of Document/View architecture on steroids.
TClarke wrote: PS. what sort of IPC are you considering?
Well, I don't want to use some sort of IPC, only simple function calls. As I posted in the other post, it's some sort of calling montior, so I thought something like this:
When a new connection comes in:
(in my base code)
<br />
if(newconnection)<br />
(ConnectEvent)(ConnectionID, CallerNumber, ...)<br />
And the MFC should then enable an (software) led or something.
|
|
|
|
|
Hello Everyone,
I'm a newbie, Please help me!
I'm adopting the code that could redirect a console output into the MFC Edit box.
My problem is, i want to have a live redirection from the console output to the edit box because i have a console application that will run about 5-10 mins and produces lots of information (output) in between those time in the command line.
My recent code will just wait the application to finish up before it could redirect the output from the command line to the Edit box.
Please help!.... thank you very much..
-rupert-
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
well,
I was using that at the present but it will just wait for the console output to finish before it can redirect.
i need to learn more... i want to be like you guys... i'm just a begginer
|
|
|
|
|
I need a basic C++ example for the multi threading. I am building up a source code. I have been working on Unix C++ and now need to build up MS windows and as such windows dont support pthread.h, is there an equivalent for it and i can code with it??
Thanks,
Rajesh.
|
|
|
|
|
use CreateThread, search google you will be getting lot of samples using this
mpk1979
|
|
|
|
|
rajeshckk wrote: C++ example for the multi threading.
Look at the boost.org[^]-page.
Boost is a semi-official enhancement of the C++ runtime environment - full of usefull and high-quality code: They employ a strict peer-review).
Here is the link for boost threads[^].
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|