Click here to Skip to main content
15,914,488 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: fread() with excel and powerpoint files Pin
David Crow8-Jul-04 3:17
David Crow8-Jul-04 3:17 
GeneralAbout fatal error,when using customized template class in MFC proj. Pin
bg2sc7-Jul-04 20:06
bg2sc7-Jul-04 20:06 
GeneralRe: About fatal error,when using customized template class in MFC proj. Pin
Mike Dimmick8-Jul-04 1:57
Mike Dimmick8-Jul-04 1:57 
GeneralTiff to raw Pin
rita12027-Jul-04 19:52
rita12027-Jul-04 19:52 
GeneralRe: Tiff to raw Pin
ThatsAlok7-Jul-04 22:32
ThatsAlok7-Jul-04 22:32 
GeneralWhy can't U Update dynamic in sort mode Pin
inlandchris7-Jul-04 18:34
inlandchris7-Jul-04 18:34 
QuestionHow can i manipulate Registry Pin
Zeeshan Bilal7-Jul-04 18:29
Zeeshan Bilal7-Jul-04 18:29 
AnswerRe: How can i manipulate Registry Pin
Yogesh Kshatriya7-Jul-04 19:21
Yogesh Kshatriya7-Jul-04 19:21 
Check the following sample function for creating & setting a registry key.
You can use APIs RegOpenKeyEx, RegQueryMultipleValues, RegQueryValue defined in winreg.h to read the values from registry keys

BOOL CFTPDlg::RegisterFTPProfile(FTPProfile LocalCopyFTPProfile)
{
BOOL bRetVal;
HKEY hkResult;
CString strTmp;
unsigned char *lpBuf;
int n;

//Preapre the complete Path Name for selected profile.
strTmp = g_strProfileRegPath + CString("\\");
strTmp += (LPCTSTR)LocalCopyFTPProfile.strProfileName ;


bRetVal=RegCreateKeyEx(HKEY_LOCAL_MACHINE,
(LPCTSTR)strTmp,
NULL,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,
NULL,
&hkResult,
NULL);


if (bRetVal==ERROR_SUCCESS)
{

n=LocalCopyFTPProfile.strHostAdd.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)LocalCopyFTPProfile.strHostAdd);
bRetVal=RegSetValueEx(hkResult,
"HOST_ADD",
NULL,
REG_SZ,
lpBuf,
n);

free((void *)lpBuf);

n=LocalCopyFTPProfile.strLoginID.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)LocalCopyFTPProfile.strLoginID);
bRetVal=RegSetValueEx(hkResult,
"LOGINID",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);


n=LocalCopyFTPProfile.strPassword.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf, (LPCTSTR)LocalCopyFTPProfile.strPassword);
bRetVal=RegSetValueEx(hkResult,
"PASSWORD",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);

n=LocalCopyFTPProfile.strHostPath.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf,(LPCTSTR)LocalCopyFTPProfile.strHostPath);
bRetVal=RegSetValueEx(hkResult,
"HOST_PATH",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);

n=LocalCopyFTPProfile.strLocalPath.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf , (LPCTSTR)LocalCopyFTPProfile.strLocalPath);
bRetVal=RegSetValueEx(hkResult,
"LOCAL_PATH",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);

n=LocalCopyFTPProfile.strSleepTime.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf , (LPCTSTR)LocalCopyFTPProfile.strSleepTime);
bRetVal=RegSetValueEx(hkResult,
"SLEEP_TIME",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);

n=LocalCopyFTPProfile.strDescription.GetLength()+1;
lpBuf = (unsigned char *)calloc(n, sizeof(char));
strcpy((char *)lpBuf , (LPCTSTR)LocalCopyFTPProfile.strDescription);
bRetVal=RegSetValueEx(hkResult,
"DESCRIPTION",
NULL,
REG_SZ,
lpBuf,
n);
free(lpBuf);




RegCloseKey(hkResult);
return TRUE;

}




return FALSE;
}
GeneralError in Open key and Query Pin
Zeeshan Bilal7-Jul-04 20:31
Zeeshan Bilal7-Jul-04 20:31 
GeneralRe: Error in Open key and Query Pin
Yogesh Kshatriya7-Jul-04 22:05
Yogesh Kshatriya7-Jul-04 22:05 
AnswerRe: How can i manipulate Registry Pin
Yulianto.7-Jul-04 22:51
Yulianto.7-Jul-04 22:51 
Questionhow to send mail without smtp server? Pin
bugtwo7-Jul-04 16:44
bugtwo7-Jul-04 16:44 
AnswerRe: how to send mail without smtp server? Pin
palbano7-Jul-04 17:18
palbano7-Jul-04 17:18 
AnswerRe: how to send mail without smtp server? Pin
Ryan Binns7-Jul-04 18:16
Ryan Binns7-Jul-04 18:16 
GeneralRe: how to send mail without smtp server? Pin
bugtwo7-Jul-04 18:34
bugtwo7-Jul-04 18:34 
GeneralRe: how to send mail without smtp server? Pin
Liger_Zero_X7-Jul-04 19:32
Liger_Zero_X7-Jul-04 19:32 
GeneralRe: how to send mail without smtp server? Pin
bugtwo8-Jul-04 17:22
bugtwo8-Jul-04 17:22 
AnswerRe: how to send mail without smtp server? Pin
Ted Ferenc7-Jul-04 21:50
Ted Ferenc7-Jul-04 21:50 
AnswerRe: how to send mail without smtp server? Pin
David Crow8-Jul-04 3:19
David Crow8-Jul-04 3:19 
GeneralSnapShot Pin
Liger_Zero_X7-Jul-04 16:02
Liger_Zero_X7-Jul-04 16:02 
GeneralRe: SnapShot Pin
erkanina7-Jul-04 19:42
erkanina7-Jul-04 19:42 
GeneralRe: SnapShot Pin
Liger_Zero_X7-Jul-04 20:18
Liger_Zero_X7-Jul-04 20:18 
GeneralRe: SnapShot Pin
erkanina7-Jul-04 22:48
erkanina7-Jul-04 22:48 
GeneralRe: SnapShot Pin
Liger_Zero_X8-Jul-04 0:49
Liger_Zero_X8-Jul-04 0:49 
GeneralRe: SnapShot Pin
ThatsAlok8-Jul-04 1:30
ThatsAlok8-Jul-04 1:30 

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.