Click here to Skip to main content
16,011,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to sotre data from a dialog to Execel file? Pin
18-Jan-01 2:50
suss18-Jan-01 2:50 
GeneralRe: How to sotre data from a dialog to Execel file? Pin
David Fedolfi18-Jan-01 3:50
David Fedolfi18-Jan-01 3:50 
GeneralRe: GOT it Pin
18-Jan-01 4:59
suss18-Jan-01 4:59 
GeneralRe: GOT it Pin
18-Jan-01 4:59
suss18-Jan-01 4:59 
GeneralRe: GOT it Pin
18-Jan-01 4:59
suss18-Jan-01 4:59 
GeneralDetect Ie download from another application Pin
Tom K17-Jan-01 5:27
Tom K17-Jan-01 5:27 
GeneralRe: Detect Ie download from another application Pin
Ghazi H. Wadi18-Jan-01 4:11
Ghazi H. Wadi18-Jan-01 4:11 
GeneralNeed Help with using CString to read string registry keys Pin
eric kaminski17-Jan-01 4:41
eric kaminski17-Jan-01 4:41 
Hey guys,

I'm new to using MFC and to programming in general. I'm having great difficulty with Using CString to read off reg_sz values from the registry.

I keep getting this Debug assertion after i leave the function i have these registry reads in

Program: MyApp
File: dbgheap.c
Line:1011

Expression:_CrltsValidHeapPinter(pUserData)
exception 03h in my MyApp.exe

heres the function snippet:

DWORD dwType =0, dwSize=256;
.........
.......
float ftemp;
for(int i=0; i<6 ;i++)
{
//open key
......

RegQueryValueEx(tempKey,"Label", NULL, &dwType,(BYTE*) RegRead.GetBuffer(256), &dwSize);
RegRead.ReleaseBuffer();

//convert string to float value
ftemp=atof(LPCTSTR(RegRead));

m_sClass->Function(i,ftemp,value);
.......

m_sClass->Function1(i,ftemp,value,value2);
}
Once i leave the function this loop is contained in, the compiler throws that degug assertion. If i remove all references to this operation i dont get the assertion. Therefore i assume im using CString wrong somehow. Am i? What is the proper way to make the registry read then?

Background:
I am trying to retrieve a float value i wrote to the registry as a REG_SZ and then use it.

This may be a stupid question but it's not to someone new at this.

I appreciate any help
Confused | :confused:

"DWORD my man!"
GeneralRe: Need Help with using CString to read string registry keys Pin
Jim Howard17-Jan-01 6:04
Jim Howard17-Jan-01 6:04 
GeneralRe: Need Help with using CString to read string registry keys Pin
eric kaminski17-Jan-01 6:19
eric kaminski17-Jan-01 6:19 
GeneralRe: Need Help with using CString to read string registry keys Pin
David Fedolfi17-Jan-01 7:34
David Fedolfi17-Jan-01 7:34 
GeneralUsing CreateThread with ThreadProc as a member function Pin
17-Jan-01 3:18
suss17-Jan-01 3:18 
GeneralRe: Using CreateThread with ThreadProc as a member function Pin
Ghazi H. Wadi17-Jan-01 3:46
Ghazi H. Wadi17-Jan-01 3:46 
GeneralRe: Using CreateThread with ThreadProc as a member function Pin
17-Jan-01 4:46
suss17-Jan-01 4:46 
GeneralRe: Using CreateThread with ThreadProc as a member function Pin
Erik Funkenbusch17-Jan-01 9:52
Erik Funkenbusch17-Jan-01 9:52 
GeneralRe: Using CreateThread with ThreadProc as a member function Pin
Tim Deveaux18-Jan-01 13:18
Tim Deveaux18-Jan-01 13:18 
GeneralMultiline List On WinCE Pin
17-Jan-01 2:54
suss17-Jan-01 2:54 
GeneralCPropertysheet and titles Pin
Kevin Gutteridge16-Jan-01 23:57
Kevin Gutteridge16-Jan-01 23:57 
GeneralRe: CPropertysheet and titles Pin
17-Jan-01 1:13
suss17-Jan-01 1:13 
GeneralRe: CPropertysheet and titles Pin
Kevin Gutteridge17-Jan-01 6:24
Kevin Gutteridge17-Jan-01 6:24 
GeneralRe: CPropertysheet and titles Pin
David Fedolfi17-Jan-01 6:37
David Fedolfi17-Jan-01 6:37 
GeneralRe: CPropertysheet and titles Pin
Kevin Gutteridge18-Jan-01 0:15
Kevin Gutteridge18-Jan-01 0:15 
GeneralReport Writer Pin
16-Jan-01 22:29
suss16-Jan-01 22:29 
Generalconstant String Memory Usage Pin
16-Jan-01 19:15
suss16-Jan-01 19:15 
GeneralRe: constant String Memory Usage Pin
Walter Gildersleeve18-Jan-01 1:05
Walter Gildersleeve18-Jan-01 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.