|
Thanks for ur replay.
long lRet = RegCreateKeyEx(HKEY_LOCAL_MACHINE,_T("Some Path"), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey,
&dwDisposition);
lRet is 5 in the case vc++ 2008 and in the case vc++ 2005 lRet is 0
|
|
|
|
|
vicky00000 wrote: lRet is 5 in the case vc++ 2008 and in the case vc++ 2005 lRet is 0
The documentation for RegCreateEx says a non-zero value is returned, when the function fails. 5 is a non-zero value AFAIK.
The documentation also says: use FormatMessage()[^] with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I would suspect it's an access denied error since you're writing to HKEY_LOCAL_MACHINE.
Your app needs to run with elevated privileges to do that.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery,
Yes, this is access denied error, could you please explain how to overcome this problem.
Thanks in advance.
|
|
|
|
|
Writing to HKEY_LOCAL_MACHINE requires the code to run with administrator rights/elevated privileges.
Does it work if you run your app as an administrator?
Why do you need to write to HKEY_LOCAL_MACHINE? That should generally only be done at install time
(running elevated).
If you have common application data that needs to be shared between users, then you should store that at the
recommended application shared data folder, not in the registry.
Unless, of course, all users of your app have no problem running the app as an administrator.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Awesome!
Thanks for the update!
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
i have a dialog box which shows a video and some controls now i want to implement a graph. what is the procedure to create a graph dynamically? i also need to read data from the file and plot it into the graph. guess that is the second part.. not thinking about that.. priority is to create a graph.
|
|
|
|
|
See if this[^] helps.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
1) by searching google
2) by searching codeproject articles
3) by searching again and again...
|
|
|
|
|
well i was expecting something like this from somebody.. and yes i am doing what u have told me... .. the last point has been really taken into consideration...
|
|
|
|
|
|
yes.. actually rajesh send me that link.. i think that will be of great help to me... .. will get back if i need some help..
|
|
|
|
|
if you need some help directly related to the use of that control, better ask in the forum at the bottom of the article itself, so that the author will be email notified, and will reply come back to you problem more easily.
|
|
|
|
|
search for NTGraph Control in google.... i have used this control for drawing graph, i have successfully completed this project using this control...
Regards
Brahma
brahma reddy
|
|
|
|
|
are you sure you wanted to say that to me ?
if you don't reply to the OP, he won't receive a notification email...
|
|
|
|
|
hi,
i am opening a binary file in visual studio2005.so the file will be the active window.when i click the addin in tool menu i have to take the binary file as input.
if any one knows about this please give me the code .
pmr
|
|
|
|
|
Hi,
I m using CColorDialog to display the color pallete dialog in my project.
its working fine..
but i wan my dialogs to be updated with the color selected by the color selected by the user in tat CColorDialog.
I m using SetCurrentColor().But the color s not updated in the dialog..
how to achieve tis..
suggestions reqd..
My snippet follows:
[ color c;
CColorDialog dlg;
dlg.m_cc.Flags |= CC_FULLOPEN | CC_RGBINIT;
dlg.m_cc.rgbResult = RGB(155, 0, 0);
dlg.DoModal();
c.SetCurrentColor(RGB(155, 0, 0));
c.DoModal(); ]
Gita
|
|
|
|
|
color c; // is this a derived class from CColorDialog ?
c.SetCurrentColor(RGB(155, 0, 0));
c.DoModal();
"Call this function after calling DoModal to force the current color selection to the color value specified in clr." from msdn.
This function is called from within a message handler.
if you want before DoModal, you can do similar to dlg.m_cc.rgbResult = RGB(155, 0, 0);
|
|
|
|
|
Hello everyone,
For the following code from Bjarne's book, it is stated that template parameter T for function g will be instantised as int other than double. My question is why there are not two instantiations for both int and double version of template function g?
template <class T> void f (T a) { g(a); }
void g(int);
void h()
{
extern g (double);
f (2);
}
Here is the related statement from Bjarne,
--------------------
Each use of a template for a given set of template arguments defines a point of instantiation.
That point is the nearest global or namespace scope enclosing its use,
just before the declaration that contains that use.
--------------------
Does it before g (double) is not global function or namespace scope enclosing its use? If yes, I do not know why g (double) is not a global function, since it is declared as extern and some other compile unit should expose it?
thanks in advance,
George
|
|
|
|
|
Simply I cannot understand you point: you're calling f(2) , i.e. template function with int argument. It is quite obvious that compiler will instantiate only the int specialization of the template function.
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
|
|
|
|
|
Hi CPallini,
Why statement extern g (double); will not instantise a double version f, i.e. f (double)?
regards,
George
|
|
|
|
|
And why should it do? The template function is f , not g .
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
|
|
|
|
|
Hi CPallini,
Bjarne's point, void g(int) statement will instantise
template <class T> void f (T a) { g(a); }
by deducing the type of T int, since in g(a), type of a is T and we are declaring g(int).
My question is why extern g(double) does not have the same effect to deduct parameter T to double?
regards,
George
|
|
|
|
|
OK, things are more clear, at least to me, changing the sample into
template <class t=""> void f (T a) { g(a); }
void g(int x) { return;}
void h()
{
extern void g (double);
f (2.5);
}
</class>
I made a test (defining void g (double) ) into another source file. The result was that only int specialization of f was built by the compiler, confirming Bjarne point.
Now, while it is clear that g(double) is exposed by correnponding source file, maybe that its declaration make it scoped only into h() i.e. local.
I have to admit the point it is not so clear.
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
|
|
|
|