|
Take a look at CRegKey, WriteProfileString, WriteProfileInt, GetProfileString and GetProfileInt in MSDN.
P.
|
|
|
|
|
karmendra_js wrote:
How to use Registry for storing and retriving data.
Try CRegKey[^]
karmendra_js wrote:
I have a large (256 in number) set of data where and how to store this data in registry.
Better Convert that Numbver in String and then store in registry.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
If u r interested to use API u can use
RegSetValueEx
|
|
|
|
|
There seems to be some problem in my DLL that the application, when started, seems to call ProcessDetach on the DLL and continue its execution.
If I attach the visual studio debugger to the application and set breakpoints in DLL ProcessAttach, I do not see the app breaking the execution at the breakpoints. I also have a __try/__except around the stuff in ProcessAttach, but no exception seems to happen here.
Any ideas what might be happening?
Also, I dont want the app to run without this DLL, so can i call TerminiteProcess in the ProcessDetach of the DLL. Is it safe or you see anything that can go wrong?
Thanks!
/f
|
|
|
|
|
Hi,
For the last couple of days, modifications to files in visual studio is taking hell lot of time. I suspect this is due to perforce coming in the way. Is there a way to disable perforce integration in visual studio 6?
Thanks.
/f
|
|
|
|
|
Flace wrote:
I suspect this is due to perforce coming in the way.
What is "perforce?"
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
What is "perforce?"
Source control system, like CVS and VSS.
|
|
|
|
|
Flace wrote:
Is there a way to disable perforce integration in visual studio 6?
There is a registry setting to disable any source control system integration.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Nemanja Trifunovic wrote:
There is a registry setting to disable any source control system integration.
And what is that please?
|
|
|
|
|
Flace wrote:
And what is that please?
Believe me, I would have told you already if I remembered
Each time I (re)install Windows I forget where this setting is, and then spend time trying to find it out
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
What is the difference between LP and DP?.When do I have to use DPtoLP and LPtoDP function?.
NSS
|
|
|
|
|
The difference regards the sense of transformation between the device units and the logical units.
1) You use LPtoDP to map the coordinates of each point, or dimension of a size, from the device coordinate system into GDI’s logical coordinate system. This depends on the current mapping mode and on the settings of the origins and extents for the device’s window and viewport.
2) You use DPtoLP to do the mapping from GDI’s logical coordinate system into the device coordinate system.
SkyWalker
-- modified at 3:30 Monday 10th October, 2005
|
|
|
|
|
Can I call GetClientRect() to retrieve the size of the list window ( a child control to the dialog) in the constructor of the dialog box.
Example:
CMyDialog::CMyDialog()
{
CRect rect;
m_List.GetClientRect(&rect);
}
Normally, the function is invoked in the InitDialog() function?. I am bit confused about this.
thanks for help in advance
NSS
|
|
|
|
|
No,You can call the function only after your control is created.
|
|
|
|
|
Probably you are interested in doing something like this in the constructor:
CListCtrl *pW = (CListCtrl *)GetDlgItem(IDC_LIST1);
CRect rc;
if ( pW )
{
pW->GetClientRect(&rc);
int z = 1;
}
When executing the first line, you come to the following assertion: ASSERT(::IsWindow(m_hWnd)) which actually tells you that the child window is not a window yet.
That is why you have to place the code in OnInitDialog()
SkyWalker
-- modified at 3:10 Monday 10th October, 2005
|
|
|
|
|
|
Thanks for your help.
NSS
|
|
|
|
|
I want a fucntion to generate a random number between 0 and 1, and each time this function is executed, it will give me a diffent value (independent to time).Can you help me?Thanks a lot.
|
|
|
|
|
|
rand()/RAND_MAX.
Not exactly working. Integer arithmetic here.
-- modified at 14:13 Monday 10th October, 2005
|
|
|
|
|
The best you can hope for is a pseudo-random number. Use rand() for this?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I want to get a random number between 0 and 1.Can you help me?Thanks a lot.
|
|
|
|
|
Did you try the rand()[^] function? It returns an int, but you can always divide the resulting int by pow(10, sizeof(int) + 1) to get a number between 0 and 1.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
std::rand() / (double)RAND_MAX gives a uniformly distributed random number in range [0...1]. Following function gives a uniformly distributed value in half-open range [lo…hi).
template <typename T>
inline T random(T lo, T hi)
{
return (T)(lo + (__int64)std::rand() * (hi - lo) / (RAND_MAX + 1));
}
Seppo
-- modified at 9:09 Monday 10th October, 2005
|
|
|
|
|
How about 1 divid by the system generated random number?
So, if the system generated number is
10 => 1/10 = 0.1
100 -> 1/100 = 0.01
& etc.
|
|
|
|