|
Hmm u raise a good point, PostMessage() or PostThreadMessage() probably more applicable in this case.
thinking back to when i have used pipes i have been shooting off messages then a chunk of data.
i will admit i like pulling out the nail gun even if i only have to put in one nail
|
|
|
|
|
As a remark, it's also usefull to know that you can access the variables directly (providing you have a way to access them) from within the different threads.
|
|
|
|
|
Hello everyone,
I have correctly set the source path in Windbg. After setting a breakpoint, how to display the related source files so that I can use them as the similar approach in Visual Studio 2008, e.g. using F10 to step next, using F11 to step in something like this.
I have tried ls command in WinDbg, but failed, error message is "No current source file".
thanks in advance,
George
|
|
|
|
|
Has the program you're debugging has symbol files (.PDB files)?
Steve
|
|
|
|
|
Sure, Stephen! I have setup the symbol path. My purpose is to find some "cool and lazy" way which could type a command in command window, and related source file is displayed, currently I have to use File --> Open Source File to open the related source file.
I set the source path by File --> Source Code Path, then input the path of the directory which contains the source codes. Is this correct way to setup source path? Do I need to do anything else in order to setup source path, e.g. reload something?
regards,
George
|
|
|
|
|
Hi,
My application writes into a particular location in Registry
Eg. RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run",
0, KEY_ALL_ACCESS, &h_Key); //Open a particular registry key
//Write to that registry key.
I need to restrict this activity to only Administrator..
Can I have a code snippet which allows this only for Administrator.
Thanks.
Venkat
|
|
|
|
|
|
Thanks.. But I am getting a compilation error even after including "shlobj.h"
|
|
|
|
|
venkat.kupunaram wrote: I am getting a compilation error
My telescope is missing. Can you tell me what exactly the error is?
|
|
|
|
|
I am using VC++6.0
error C2065: 'IsUserAnAdmin' : undeclared identifier
|
|
|
|
|
The function information of IsUserAnAdmin() says - "Shell32.DLL version 5.0 or higher will be required" to make use of this call, which means earlier versions won't have this function exported at all.
See here[^]. You'll need the latest SDK (or the SDK which is latest enough and has version 5.0 or higher of Shell32.DLL) to use this call.
|
|
|
|
|
I am using File version 6.0.3790.4184.. But still I am getting a compilation error.
|
|
|
|
|
Do you have the Feb 2003 version of the Platform SDK?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Rajesh R Subramanian wrote: My telescope is missing. Can you tell me the what exactly the error is?
Nope. Go back home and get the telescope.
BTW: Eventually MFC appeared in your profile
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Nope. Go back home and get the telescope. [Poke tongue]
Sorry, but I see the question was not "very urgent", so I could ask the OP to take some time to let me know more of the error.
CPallini wrote: BTW: Eventually MFC appeared in your profile [Big Grin]
|
|
|
|
|
Rajesh R Subramanian wrote: Sorry, but I see the question was not "very urgent", so I could ask the OP to take some time to let me know more of the error.
You're wrong: "very urgent" it's the default.
"Plz plz very urgent" is the courtesy form.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
"Attack of the Urgent Monkeys"
BTW, we're dangerously close to hijack this thread.
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Use BOOL IsUserAnAdmin(VOID);
Perform writing to the registry only if this function returns true.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
This api is giving a compilation error in VC++6.0
|
|
|
|
|
Here is the code for IsUserAdmin
<code>
BOOL IsUserAdmin(VOID)
{
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
</code>
<div class="ForumSig">Somethings seem HARD to do, until we know how to do them.
;-)_AnShUmAn_
</div>
|
|
|
|
|
Thanks.. But I written a user define function and written the above code.. I am getting a compilation error at CheckTokenMembership...
|
|
|
|
|
You should do the following:
Header: Declared in Winbase.h; include Windows.h.
Library: Use Advapi32.lib
And look for Advapi32.dll. Check out MSDN for more details
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
If you can speak Chinese,you can go to"www.csdn.net" .He will help you !
|
|
|
|
|
Hai all,
I need your help to retrieve the information shown in Local area connection status dilog in vc++ or c++.
The informations are uploaded and downloaded packets,Duration.
Thanks
|
|
|
|