Sophie
May 31st, 1999, 10:38 AM
I hope someone can shed some light!!!
I'm trying to get a path I've saved prior. When I do the GetprofilePath it never finds what I've set it to and I know it's there. Can someone tell me what I'm doing wrong. Thank you!
Also It writes the information in my win.ini how do I make it to write in the registry?
Thanks
void CVRUtilitiesApp::OnBackupsetupPathtobackup()
{
// TODO: Add your command handler code here
CString str = GetProfileString("Virtual Recorder", "Path to");
if(!str.IsEmpty()){
CDlgIni dlg;
dlg.DoModal();
}
else{
CPathVRecord dlgVR;
dlgVR.DoModal();
}
}
void CPathVRecord::OnOK()
{
bool canExit = true;
UpdateData(TRUE);
CString vRecord = GetVirtualRecorder();
if(vRecord.IsEmpty()){
AfxMessageBox(IDS_WARN_NOPATHENTERED, MB_OK|MB_ICONSTOP);
canExit= false;
}
if(canExit){
WriteProfileString("Virtual Recorder", "Path to", vRecord);
CDlgIni dlg;
dlg.DoModal();
CDialog::OnOK();
}
}
void CDlgIni::OnOK()
{
bool canExit = true;
UpdateData(TRUE); //Will update all existing variables.
CString backUpPath = GetBackUpPath();
if(backUpPath.IsEmpty()){
AfxMessageBox(IDS_WARN_NOPATHENTERED, MB_OK|MB_ICONSTOP);
canExit= false;
}
else{
Path path (ToString(backUpPath));
Path pathreponse(ToString(backUpPath));
Path pathLessons(ToString(backUpPath));
pathreponse.AppendToPath("Lavac\\Record.sav");
pathLessons.AppendToPath("Lavac\\Lecons");
if(!pathreponse.IsDirect() || !pathLessons.IsDirect()){
AfxMessageBox(IDS_WARN_BACKUPPATH_NOTEXIST, MB_OK|MB_ICONSTOP);
canExit = false;
}
else{
if(!theApp.IsVRecordActive()){
bool iniChanged = true;
Path destLesson = path;
Path destResp = path;
CString finalLesson= ToCString(destLesson.AppendToPath("Lavac\\LECONS"));
CString finalResp = ToCString(destResp.AppendToPath("Lavac\\record.sav"));
WritePrivateProfileString("DIRECTORIES", "LESSONS", finalLesson,"vrecord.ini");
WritePrivateProfileString("DIRECTORIES", "FLOPPY", finalResp,"vrecord.ini");
theApp.SetIniChanged(iniChanged);
//VRIniInfo iniInfo;
//Path getServerPath = ToString(iniInfo.GetServerBasePath());
//CString serverPath = ToCString(getServerPath.AppendToPath("Lavac\\Vrecord"));
CString str = AfxGetApp()->GetProfileString("Virtual Recorder", "Path to");
ShellExecute (AfxGetMainWnd()->GetSafeHwnd(), "open", "Vrecord.exe", "/OEM/L:English/S/R/Admin", str , SW_SHOWNORMAL);
}
}
}
if(canExit)
CDialog::OnOK();
}
I'm trying to get a path I've saved prior. When I do the GetprofilePath it never finds what I've set it to and I know it's there. Can someone tell me what I'm doing wrong. Thank you!
Also It writes the information in my win.ini how do I make it to write in the registry?
Thanks
void CVRUtilitiesApp::OnBackupsetupPathtobackup()
{
// TODO: Add your command handler code here
CString str = GetProfileString("Virtual Recorder", "Path to");
if(!str.IsEmpty()){
CDlgIni dlg;
dlg.DoModal();
}
else{
CPathVRecord dlgVR;
dlgVR.DoModal();
}
}
void CPathVRecord::OnOK()
{
bool canExit = true;
UpdateData(TRUE);
CString vRecord = GetVirtualRecorder();
if(vRecord.IsEmpty()){
AfxMessageBox(IDS_WARN_NOPATHENTERED, MB_OK|MB_ICONSTOP);
canExit= false;
}
if(canExit){
WriteProfileString("Virtual Recorder", "Path to", vRecord);
CDlgIni dlg;
dlg.DoModal();
CDialog::OnOK();
}
}
void CDlgIni::OnOK()
{
bool canExit = true;
UpdateData(TRUE); //Will update all existing variables.
CString backUpPath = GetBackUpPath();
if(backUpPath.IsEmpty()){
AfxMessageBox(IDS_WARN_NOPATHENTERED, MB_OK|MB_ICONSTOP);
canExit= false;
}
else{
Path path (ToString(backUpPath));
Path pathreponse(ToString(backUpPath));
Path pathLessons(ToString(backUpPath));
pathreponse.AppendToPath("Lavac\\Record.sav");
pathLessons.AppendToPath("Lavac\\Lecons");
if(!pathreponse.IsDirect() || !pathLessons.IsDirect()){
AfxMessageBox(IDS_WARN_BACKUPPATH_NOTEXIST, MB_OK|MB_ICONSTOP);
canExit = false;
}
else{
if(!theApp.IsVRecordActive()){
bool iniChanged = true;
Path destLesson = path;
Path destResp = path;
CString finalLesson= ToCString(destLesson.AppendToPath("Lavac\\LECONS"));
CString finalResp = ToCString(destResp.AppendToPath("Lavac\\record.sav"));
WritePrivateProfileString("DIRECTORIES", "LESSONS", finalLesson,"vrecord.ini");
WritePrivateProfileString("DIRECTORIES", "FLOPPY", finalResp,"vrecord.ini");
theApp.SetIniChanged(iniChanged);
//VRIniInfo iniInfo;
//Path getServerPath = ToString(iniInfo.GetServerBasePath());
//CString serverPath = ToCString(getServerPath.AppendToPath("Lavac\\Vrecord"));
CString str = AfxGetApp()->GetProfileString("Virtual Recorder", "Path to");
ShellExecute (AfxGetMainWnd()->GetSafeHwnd(), "open", "Vrecord.exe", "/OEM/L:English/S/R/Admin", str , SW_SHOWNORMAL);
}
}
}
if(canExit)
CDialog::OnOK();
}