|
ftsOne wrote: Is there a way to get the full path
Yes, we can..
REGOPENKEY - To open the Registry
REGQUERYVALE - belongs to ur queried value
REGCLOSEKEY - closing the registry...
this kind of API's are there.
Born to win...!
|
|
|
|
|
Hi and thanks for the quick reply.
I know of those API's and googled, yahooed, and whatever else I could think of, just in case I've missed anything.
What I've found is that hKey will give me something like Microsoft\MediaPlayer but not HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer.
What I need is to determine if hKey is actually pointing to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft and not to HKEY_CURRENT_USER\SOFTWARE\Microsoft.
Any insight would be greatly appreciated.
|
|
|
|
|
ftsOne wrote: What I've found is that hKey will give me something like Microsoft\MediaPlayer but not HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer.
No, it is giving full path only...
Hope u gone through this page..If not...
http://msdn2.microsoft.com/en-us/library/ms724909(VS.85).aspx[^]
have a look...
we will get full path ya
Born to win...!
|
|
|
|
|
Hi again,
Yeah, I went through that page. I also scrutinized everything that started with Reg...
That API only gives you the value associated with the open key. It does not give you the full path to the key.
I can enumerate the values and subkeys. What I need is the path to the open key.
Thanks again.
|
|
|
|
|
Can u send me ur code..i will check it ..and i will tell U
Born to win...!
|
|
|
|
|
void SearchHive(HKEY hive)
{
HKEY hKey;
DWORD dwIndex = 0;
LONG lRet;
DWORD cbName = IS_KEY_LEN;
TCHAR szSubKeyName[IS_KEY_LEN];
if (::RegOpenKeyEx(hive, NULL, 0, KEY_READ, &hKey) != ERROR_SUCCESS || g_bCancelSearch)
goto Stop;
while (((lRet = ::RegEnumKeyEx(hKey, dwIndex, szSubKeyName, &cbName, NULL,NULL, NULL, NULL)) != ERROR_NO_MORE_ITEMS) && g_bCancelSearch != true)
{
// Do we have a key to open?
if (lRet == ERROR_SUCCESS)
{
/**********************************************
Do Something with the key
hKey is an open HKEY handle returned by ::RegOpenKeyEx
szSubKeyName is the key in string format returned by ::RegEnumKeyEx at dwIndex
usually something like 'SOFTWARE' or 'HARDWARE'
what is the human readable format for hKey
for example:
convertHKEYtoString(hKey) would return something like
HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\MyApp\MySettings
/*********************************************/
}
dwIndex++;
cbName = IS_KEY_LEN;
}
Stop:
//No more subkeys
::RegCloseKey(hKey);
}
|
|
|
|
|
|
Hi,
I have found several registry classes here at code project actually.
All of them assume you have the path (ie: HKEY_LOCAL_MACHINE\SOFTWARE\MyApp) to open the hKey.
I have the an open hKey and want the path in a string format to display it on a control.
'0X80000000' means nothing to the user, where as 'HKEY_LOCAL_MACHINE\SOFTWARE\MyApp' would be helpfull.
I can walk the key from a predefined key like HKLM forward, what I need is to walk backwards back to HKLM.
|
|
|
|
|
I guess the bigger question is why do you need this information? Perhaps if you explained, we might could offer a different approach.
"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
|
|
|
|
|
|
If you want to drag,drop of your program with Internet Explorer I think I saw on the codeproject an example of it.
|
|
|
|
|
Hi,
I want to design my own file storage format,not the simple text format and other existed file storage format(PDF or RTF etc.)
Is there any article to describe this question?
Is there any books to describe this question?
It will be better if there is an simple example for me.
Thank you very much!!
?????
|
|
|
|
|
That's not really complicated. The only thing you have to do is store what you want to save in the way you want. You are responsible of the format of your file, as long as you keep consistent between saving and loading there's no problem.
Anyway, if you are using MFC, I suggest that you take a look at this series of article: Serialization primer[^]. It doesn't talk about file format but it will get you started with serialization with MFC (that's the way to go if you are using MFC).
|
|
|
|
|
Using the Dbghlp functions
e.g. SymGetSymFromAddr
Where does Windows search for the Symbols (I guess its PDB's)
Is It were environment variable _NT_SYMBOL_PATH POINTS TO
|
|
|
|
|
ForNow wrote: Where does Windows search for the Symbols (I guess its PDB's)
You have to specify the search path in the SymInitialize() function. It is necessry that SymInitialize() must be called before calling any other Sym functions.
|
|
|
|
|
Thankx now that we are on this thread (little joke) was wondering I generate .pdb
When I am in Release mode I guess without the compiler /Zi option
I am able to run the Debugger and step thru the Code however in Release as Opposed to Debug I am unable to display certin Variables dont know if they are Local or Global
So what my question??? what is the difference (if you know) between a debug and release
.exe/dLL
|
|
|
|
|
ForNow wrote: I am unable to display certin Variables dont know if they are Local or Global
In release mode most of the variable values is not displayed or shows incorrect value, unless you have turn off the optimization ( /Od ).
|
|
|
|
|
BTW it worked Syminitlize that is I'll try /Od
thankx
|
|
|
|
|
I use enums a lot in my projects. The problem is that they're not encapsulated the way they are in C#, so there's the occasional problem of name clashes between more than one enum declaration when they declare the same name as a value. I was thinking about doing something like this:
struct WaveType
{
enum
{
Sine,
Triangle,
Sawtooth
};
};
Or maybe instead of a struct, use a namespace:
namespace WaveType
{
enum
{
Sine,
Triangle,
Sawtooth
};
};
Then I can access the enum values like so: WaveType::Sine , WaveType::Triangle ...
Would this be considered bad style? Have any of you done anything like this?
|
|
|
|
|
I prefer the second approach, and namespace is meant for this purpose (avoid name clash). I would suggest if you can group a set of classes, function, user defs... as some software module then declare them with in a namespace rather than declare only the enum within a namespace region. And if you are using the enumeration only within a class then declare the enumeration within the class declaration.
|
|
|
|
|
You've also the following option
class WaveTool
{
public:
enum
{
Sine,
Triangle,
Sawtooth
};
};
i.e. to wrap the enum inside a class that has the responsibility of offering related services.
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
|
|
|
|
|
<br />
m_hThread1 = CreateThread(NULL, 0, ThreadFun1, this, 0, &m_dw1);
m_hThread2 = CreateThread(NULL, 0, ThreadFun2, this, 0, &m_dw2);
How to get thread 1 using memory size when program run.
|
|
|
|
|
yoda speak ?!!?
Sure i am not what talking you are.
Seriously, it depends what the thread is doing; and normally, it's the same way as find finding out
what the current/main thread is doing.
|
|
|
|
|
Maximilien wrote: yoda speak ?!!?
Sure i am not what talking you are.
Or:
What you are talking about, I am not sure of.
"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
|
|
|
|
|
Hi,
a thread does not use memory, except for its stack;
when it creates some objects, they will occupy some memory, but they do not belong
to the thread, and they sit in the heap, common to all threads of the process.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|