Click here to Skip to main content
15,889,335 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
Richard MacCutchan8-Aug-14 5:57
mveRichard MacCutchan8-Aug-14 5:57 
AnswerRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
«_Superman_»8-Aug-14 18:58
professional«_Superman_»8-Aug-14 18:58 
GeneralRe: Apparently different behaviour assigning C string to std::string, for Relese/Debug Pin
piul10-Aug-14 21:42
piul10-Aug-14 21:42 
QuestionHow to design (and do I want) an API? Pin
piul6-Aug-14 2:31
piul6-Aug-14 2:31 
AnswerRe: How to design (and do I want) an API? Pin
Espen Harlinn6-Aug-14 2:55
professionalEspen Harlinn6-Aug-14 2:55 
GeneralRe: How to design (and do I want) an API? Pin
piul6-Aug-14 2:59
piul6-Aug-14 2:59 
GeneralRe: How to design (and do I want) an API? Pin
Espen Harlinn6-Aug-14 3:09
professionalEspen Harlinn6-Aug-14 3:09 
AnswerRe: How to design (and do I want) an API? Pin
Cristian Amarie14-Aug-14 22:16
Cristian Amarie14-Aug-14 22:16 
If you're using this in C++ only, seems ok (let alone the preferences).
However, I'd do this:
- no namespace exports; be wary of linker decorations
- export just the needed functions, not all (i.e. the "public" interface)
- separate helpers from actors (i.e openConfigFile, isDefined vs getBool, getInt)
- do not return std::string or others from functions; rather, return just simple testable values (int, bool) and change to
bool openConfigFile(const std::string& filename, std::string& result); (or std::string* result)
- if you'll get this used in other places, favor a C-like interface and do the plumbing code, such as
BOOL WINAPI OpenConfigFileA(LPCSTR fileName, LPSTR* result);
or use VARIANTs is needed in VBS.
- or favor the COM-like exports with just structs with virtual pure functions and DllGetClassObject-like creators.

There are many things to consider. I'm using sometimes even paper and pen to weight all these.
QuestionConvert console to windows gui application Pin
Member 109951396-Aug-14 0:12
Member 109951396-Aug-14 0:12 
AnswerRe: Convert console to windows gui application Pin
Richard MacCutchan6-Aug-14 1:06
mveRichard MacCutchan6-Aug-14 1:06 
AnswerRe: Convert console to windows gui application Pin
Joe Woodbury6-Aug-14 15:38
professionalJoe Woodbury6-Aug-14 15:38 
AnswerRe: Convert console to windows gui application Pin
Cristian Amarie17-Aug-14 19:33
Cristian Amarie17-Aug-14 19:33 
Questionwhat is zed doing here? Pin
Alex Sturza5-Aug-14 8:29
Alex Sturza5-Aug-14 8:29 
AnswerRe: what is zed doing here? Pin
CPallini5-Aug-14 10:02
mveCPallini5-Aug-14 10:02 
GeneralRe: what is zed doing here? Pin
Alex Sturza5-Aug-14 10:46
Alex Sturza5-Aug-14 10:46 
GeneralRe: what is zed doing here? Pin
CPallini5-Aug-14 20:48
mveCPallini5-Aug-14 20:48 
AnswerRe: what is zed doing here? Pin
jeron15-Aug-14 11:17
jeron15-Aug-14 11:17 
GeneralRe: what is zed doing here? Pin
Alex Sturza5-Aug-14 11:28
Alex Sturza5-Aug-14 11:28 
GeneralRe: what is zed doing here? Pin
jeron15-Aug-14 11:41
jeron15-Aug-14 11:41 
GeneralRe: what is zed doing here? Pin
Alex Sturza5-Aug-14 11:46
Alex Sturza5-Aug-14 11:46 
AnswerRe: what is zed doing here? Pin
Pete O'Hanlon5-Aug-14 12:27
mvePete O'Hanlon5-Aug-14 12:27 
GeneralRe: what is zed doing here? Pin
Alex Sturza6-Aug-14 4:12
Alex Sturza6-Aug-14 4:12 
GeneralRe: what is zed doing here? Pin
Pete O'Hanlon6-Aug-14 5:31
mvePete O'Hanlon6-Aug-14 5:31 
Questionin this code,where is called database_close?pls help Pin
Alex Sturza5-Aug-14 6:19
Alex Sturza5-Aug-14 6:19 
QuestionRe: in this code,where is called database_close?pls help Pin
Richard MacCutchan5-Aug-14 6:55
mveRichard MacCutchan5-Aug-14 6:55 

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.