Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fread crash Pin
Chris Losinger19-Jul-05 9:27
professionalChris Losinger19-Jul-05 9:27 
GeneralRe: fread crash Pin
sfeldi19-Jul-05 20:39
sfeldi19-Jul-05 20:39 
GeneralRe: fread crash Pin
sfeldi19-Jul-05 21:09
sfeldi19-Jul-05 21:09 
GeneralRe: fread crash Pin
Chris Losinger20-Jul-05 1:11
professionalChris Losinger20-Jul-05 1:11 
GeneralRe: fread crash Pin
sfeldi19-Jul-05 20:38
sfeldi19-Jul-05 20:38 
QuestionTextOut being clipped in Windows 2000? Pin
MacWarrior19-Jul-05 3:10
MacWarrior19-Jul-05 3:10 
AnswerRe: TextOut being clipped in Windows 2000? Pin
David Crow19-Jul-05 3:21
David Crow19-Jul-05 3:21 
GeneralReading REG_SZ from Win registry Pin
rudoq3219-Jul-05 3:09
rudoq3219-Jul-05 3:09 
I have problem to read long strings from windows registry.
I have no problems with writing...

my code>

char m_sPiasPath[MAX_PATH];
char m_sIniPath[1024];

CRegKey cRegKey;
if(ERROR_SUCCESS!=cRegKey.Create(HKEY_CURRENT_USER,"Software\\psm",REG_NONE,REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,0,0 ))
{
MessageBox(0,"Can't create register key","PSM",MB_ICONWARNING);
}
else
{
if(ERROR_SUCCESS!=cRegKey.QueryValue(m_sPiasPath,"pias",&dwData))
{
// find pias.exe
CFileFind cFileFind;
if(cFileFind.FindFile("pias.exe"))
{
cFileFind.FindNextFile();
strcpy(m_sPiasPath,cFileFind.GetFilePath());
if(ERROR_SUCCESS!=RegSetValueEx((HKEY)cRegKey,"pias",0,REG_SZ,(BYTE*)((LPCTSTR)cFileFind.GetFilePath()),
cFileFind.GetFilePath().GetLength()));
}
else
MessageBox(0,"Can't find \"pias.exe\". Try run it manual.","PSM",MB_ICONWARNING);
}

// psm.ini
if(ERROR_SUCCESS!=cRegKey.QueryValue(m_sIniPath,"psm_p",&dwData))
{
if(::AfxMessageBox("Can't read path for \"psm.ini\" from windows registry.\nDo you want to select it?",
MB_ICONQUESTION|MB_YESNO)==IDYES)
{
CSelectPathDlg dlg;
dlg.DoModal();
strcpy(m_sIniPath,dlg.m_sFolder);
if(strlen(m_sIniPath))
{
if(ERROR_SUCCESS!=RegSetValueEx((HKEY)cRegKey,"psm_p",0,REG_SZ,(BYTE*)m_sIniPath,
strlen(m_sIniPath)))
{
::AfxMessageBox("Can't create registry key.",MB_ICONWARNING);
}
}
}
}

}

cRegKey.Close();

Thanks for help...

R.
GeneralRe: Reading REG_SZ from Win registry Pin
David Crow19-Jul-05 3:19
David Crow19-Jul-05 3:19 
GeneralRe: Reading REG_SZ from Win registry Pin
Blake Miller19-Jul-05 5:50
Blake Miller19-Jul-05 5:50 
GeneralRe: Reading REG_SZ from Win registry Pin
John R. Shaw20-Jul-05 9:53
John R. Shaw20-Jul-05 9:53 
QuestionHow to handle IE (ATL/COM/MFC) Pin
19-Jul-05 3:03
suss19-Jul-05 3:03 
GeneralInsert image or icon Pin
Halawlaws19-Jul-05 2:49
Halawlaws19-Jul-05 2:49 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 2:55
David Crow19-Jul-05 2:55 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 3:22
Halawlaws19-Jul-05 3:22 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 3:27
David Crow19-Jul-05 3:27 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 3:28
Halawlaws19-Jul-05 3:28 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 5:30
David Crow19-Jul-05 5:30 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 5:32
Halawlaws19-Jul-05 5:32 
GeneralRe: Insert image or icon Pin
David Crow19-Jul-05 5:38
David Crow19-Jul-05 5:38 
GeneralRe: Insert image or icon Pin
Halawlaws19-Jul-05 5:40
Halawlaws19-Jul-05 5:40 
GeneralRe: Change position Pin
Halawlaws19-Jul-05 5:51
Halawlaws19-Jul-05 5:51 
GeneralRe: Change position Pin
David Crow19-Jul-05 5:58
David Crow19-Jul-05 5:58 
GeneralRe: Change position Pin
Halawlaws19-Jul-05 6:00
Halawlaws19-Jul-05 6:00 
GeneralRe: Change position Pin
David Crow19-Jul-05 6:13
David Crow19-Jul-05 6:13 

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.