Click here to Skip to main content
15,907,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSimulating mouse clicks on SysDateTimePick32 control Pin
Still learning how to code14-Jan-06 21:40
Still learning how to code14-Jan-06 21:40 
AnswerRe: Simulating mouse clicks on SysDateTimePick32 control Pin
Gary R. Wheeler15-Jan-06 4:23
Gary R. Wheeler15-Jan-06 4:23 
GeneralRe: Simulating mouse clicks on SysDateTimePick32 control Pin
Still learning how to code15-Jan-06 22:00
Still learning how to code15-Jan-06 22:00 
GeneralRe: Simulating mouse clicks on SysDateTimePick32 control Pin
Gary R. Wheeler17-Jan-06 16:11
Gary R. Wheeler17-Jan-06 16:11 
Questionhow to draw table? Pin
Ali Tavakol14-Jan-06 21:13
Ali Tavakol14-Jan-06 21:13 
AnswerRe: how to draw table? Pin
includeh1015-Jan-06 3:54
includeh1015-Jan-06 3:54 
GeneralRe: how to draw table? Pin
Ali Tavakol15-Jan-06 20:14
Ali Tavakol15-Jan-06 20:14 
Questionvariable, a simple suggestion to C/C++ beginner Pin
includeh1014-Jan-06 17:13
includeh1014-Jan-06 17:13 
I read many posts on this forum, I have a simple suggestion to C/C++ beginner: use variable properly.

assume you have a varable, which is called MyUser.
is name of the variable good? my answer is "No".

a variable includes 2 parts: type and meaning.
MyUser only includes second part: meaning, but doesn't show type of the variable.

good idea for defining the variable depends on its type, you should add type as prefix for the variable, E.g.

char*pszMyUser; //prefix psz=a Pointer of Zero based String
char**ppszMyUser; //ppsz=a pointer to a Pointer of Zero based String
int iMyUser; //i=integer, some people use "n" or "u"
SYSTEMTIME tmMyUser; //tm=SYSTEMTIME

there are no rules for defining name of prefix, but please respect public usage, E.g, people always use psz for char*, so we should not use other names.

===================================
there are many advantages if you use variable with prefix,
for example, you can update your code easily when program grows large or after one or more years. your code is also readable for others.

===================================
if you have 2 or more C/C++ samples for study, you have to choose one as start sample. first, test their performance, second, see which samples use prefix properly - the one which doesn't use prefix is not good normally.

===================================
if you have a class defined in this way:
class myfile
{
public:
LPTSTR filename;
BOOL dirty;
int data;
};

I suggest you change it as:
class myfile
{
public:
LPTSTR pszFileName;
BOOL bDirty; //b=boolean
int iData;
};

========================
today is sunday.
believe me or not, it is up to you.















































A nice tool for optimizing your Microsoft html-help contents.

Includeh10
AnswerRe: variable, a simple suggestion to C/C++ beginner Pin
El Corazon14-Jan-06 17:49
El Corazon14-Jan-06 17:49 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
Stephen Hewitt14-Jan-06 18:03
Stephen Hewitt14-Jan-06 18:03 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
El Corazon14-Jan-06 18:39
El Corazon14-Jan-06 18:39 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
Shraddhan22-Jan-06 23:34
Shraddhan22-Jan-06 23:34 
Questionstructure representing file Pin
John Simon14-Jan-06 14:50
John Simon14-Jan-06 14:50 
AnswerRe: structure representing file Pin
El Corazon14-Jan-06 15:04
El Corazon14-Jan-06 15:04 
QuestionHard maths problem Pin
Christian Graus14-Jan-06 12:41
protectorChristian Graus14-Jan-06 12:41 
AnswerRe: Hard maths problem Pin
Sean Cundiff14-Jan-06 14:25
Sean Cundiff14-Jan-06 14:25 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 19:56
protectorChristian Graus14-Jan-06 19:56 
AnswerRe: Hard maths problem Pin
Stephen Hewitt14-Jan-06 14:35
Stephen Hewitt14-Jan-06 14:35 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 19:52
protectorChristian Graus14-Jan-06 19:52 
AnswerRe: Hard maths problem Pin
Michael A. Barnhart14-Jan-06 14:36
Michael A. Barnhart14-Jan-06 14:36 
AnswerRe: Hard maths problem Pin
El Corazon14-Jan-06 14:41
El Corazon14-Jan-06 14:41 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 20:05
protectorChristian Graus14-Jan-06 20:05 
Questioni need TIC TAC TOE source vc++ Pin
peyman1361814-Jan-06 10:23
peyman1361814-Jan-06 10:23 
AnswerRe: i need TIC TAC TOE source vc++ Pin
Christian Graus14-Jan-06 12:38
protectorChristian Graus14-Jan-06 12:38 
QuestionAccessing Video Files Pin
AJ12314-Jan-06 9:15
AJ12314-Jan-06 9:15 

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.