Click here to Skip to main content
15,917,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionOn the fly changing the form of a CFormView Pin
ilgale26-Sep-08 0:18
ilgale26-Sep-08 0:18 
AnswerRe: On the fly changing the form of a CFormView Pin
SandipG 26-Sep-08 0:58
SandipG 26-Sep-08 0:58 
AnswerRe: On the fly changing the form of a CFormView Pin
Ahmed Charfeddine26-Sep-08 1:02
Ahmed Charfeddine26-Sep-08 1:02 
AnswerRe: On the fly changing the form of a CFormView Pin
Iain Clarke, Warrior Programmer27-Sep-08 12:04
Iain Clarke, Warrior Programmer27-Sep-08 12:04 
QuestionWhats the best way to simplyfy this function? Pin
monsieur_jj25-Sep-08 23:59
monsieur_jj25-Sep-08 23:59 
QuestionRe: Whats the best way to simplyfy this function? Pin
CPallini26-Sep-08 0:20
mveCPallini26-Sep-08 0:20 
AnswerRe: Whats the best way to simplyfy this function? Pin
monsieur_jj26-Sep-08 0:53
monsieur_jj26-Sep-08 0:53 
AnswerRe: Whats the best way to simplyfy this function? Pin
SandipG 26-Sep-08 0:54
SandipG 26-Sep-08 0:54 
monsieur_jj wrote:
Size = BufferSize;
StrTable.LoadStringA(IDS_UPDATEINSTALL);
lResult = RMRegQueryValueEx(Regentry, StrTable.GetString(), NULL, &Type, reinterpret_cast<lpbyte>(SoftwareInstaller), &Size);
Size = BufferSize;
StrTable.LoadStringA(IDS_UPDATEFILE);
RMRegQueryValueEx(Regentry, StrTable.GetString(), NULL, &Type, reinterpret_cast<lpbyte>(SoftwarePath), &Size);
if(lResult == ERROR_SUCCESS)
{
Path = SoftwarePath;
InstallFolder = SoftwareInstaller;
if(!(Path.empty()))
{
ExecuteInstaller(Path, InstallFolder);
}
}
RegCloseKey(Regentry);
Regentry = NULL;


You can put these bunch of statements in some function and pass the parameters appropriately instead of repeating same code everywhere.


monsieur_jj wrote:
LaunchInstaller = "";
StrTable.LoadStringA(IDS_ServiceRegEntry);
LaunchInstaller.append(StrTable.GetString());
StrTable.LoadStringA(IDS_LongProjectName);
LaunchInstaller.append(StrTable.GetString());
StrTable.LoadStringA(IDS_ServiceParam);
LaunchInstaller.append(StrTable.GetString());
LaunchInstaller.append("\\");
StrTable.LoadStringA(IDS_RERITEKEY);
LaunchInstaller.append(StrTable.GetString());
LaunchInstaller.append("\\");
LaunchInstaller.append(tcItemText);



I can also see the above statements repeated you can have function for this as well.

I think that should simplify your code considerably.
I hope it helps..

Regards,
Sandip.

GeneralRe: Whats the best way to simplyfy this function? Pin
Rajesh R Subramanian26-Sep-08 0:58
professionalRajesh R Subramanian26-Sep-08 0:58 
GeneralRe: Whats the best way to simplyfy this function? Pin
SandipG 26-Sep-08 1:00
SandipG 26-Sep-08 1:00 
AnswerRe: Whats the best way to simplyfy this function? Pin
Ahmed Charfeddine26-Sep-08 1:16
Ahmed Charfeddine26-Sep-08 1:16 
QuestionRunning MFC7 (2003) project in Windows Vista problem? Pin
Hadi Dayvary25-Sep-08 23:40
professionalHadi Dayvary25-Sep-08 23:40 
AnswerRe: Running MFC7 (2003) project in Windows Vista problem? Pin
Rajesh R Subramanian26-Sep-08 0:48
professionalRajesh R Subramanian26-Sep-08 0:48 
GeneralRe: Running MFC7 (2003) project in Windows Vista problem? Pin
Hadi Dayvary26-Sep-08 10:07
professionalHadi Dayvary26-Sep-08 10:07 
Questioninclude file for a COM client (consumer) Pin
George_George25-Sep-08 23:30
George_George25-Sep-08 23:30 
AnswerRe: include file for a COM client (consumer) Pin
santhoshv8425-Sep-08 23:53
santhoshv8425-Sep-08 23:53 
QuestionT-SQL type application? Pin
George_George25-Sep-08 23:21
George_George25-Sep-08 23:21 
QuestionC++ and ADO Pin
roguecode25-Sep-08 23:14
roguecode25-Sep-08 23:14 
QuestionNo source code for debugger Pin
Ahmed Charfeddine25-Sep-08 22:04
Ahmed Charfeddine25-Sep-08 22:04 
QuestionGet the language identifier of a window Pin
Joseph Marzbani25-Sep-08 21:34
Joseph Marzbani25-Sep-08 21:34 
AnswerRe: Get the language identifier of a window Pin
Ahmed Charfeddine25-Sep-08 22:37
Ahmed Charfeddine25-Sep-08 22:37 
GeneralRe: Get the language identifier of a window Pin
Joseph Marzbani26-Sep-08 0:34
Joseph Marzbani26-Sep-08 0:34 
GeneralRe: Get the language identifier of a window Pin
Ahmed Charfeddine26-Sep-08 0:53
Ahmed Charfeddine26-Sep-08 0:53 
QuestionHow can use a string to set the registry value? Pin
Le@rner25-Sep-08 21:17
Le@rner25-Sep-08 21:17 
AnswerRe: How can use a string to set the registry value? Pin
Cedric Moonen25-Sep-08 21:22
Cedric Moonen25-Sep-08 21:22 

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.