Click here to Skip to main content
15,908,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGet COM Dll path from an other Exe Pin
MrKBA1-Dec-11 0:01
MrKBA1-Dec-11 0:01 
AnswerRe: Get COM Dll path from an other Exe Pin
«_Superman_»1-Dec-11 4:42
professional«_Superman_»1-Dec-11 4:42 
GeneralRe: Get COM Dll path from an other Exe Pin
Richard MacCutchan1-Dec-11 5:15
mveRichard MacCutchan1-Dec-11 5:15 
GeneralRe: Get COM Dll path from an other Exe Pin
Albert Holguin1-Dec-11 5:24
professionalAlbert Holguin1-Dec-11 5:24 
RantRe: Get COM Dll path from an other Exe Pin
«_Superman_»1-Dec-11 15:40
professional«_Superman_»1-Dec-11 15:40 
QuestionHow to prevent customization of main menu items (File, Edit, View, Window, Help, ...) when using CMFCMenuBar in Visual Studio 2010 Pin
User 2694230-Nov-11 23:08
professionalUser 2694230-Nov-11 23:08 
QuestionHow to return char* Pin
Paulraj G30-Nov-11 19:18
Paulraj G30-Nov-11 19:18 
AnswerRe: How to return char* Pin
«_Superman_»30-Nov-11 19:47
professional«_Superman_»30-Nov-11 19:47 
What you've done is almost correct.
2 things are not right.

First, you cannot use extern "C" if you're using std::string because string is an object of the basic_string class.
class is not understood by C.

Second, you cannot delete the memory inside the function.
Deletion has to be done by the caller.
Also there is no point in having any statements after the return statement.
«_Superman 
I love work. It gives me something to do between weekends.


Microsoft MVP (Visual C++)

Polymorphism in C

GeneralRe: How to return char* Pin
Richard MacCutchan30-Nov-11 22:30
mveRichard MacCutchan30-Nov-11 22:30 
GeneralRe: How to return char* Pin
«_Superman_»30-Nov-11 22:35
professional«_Superman_»30-Nov-11 22:35 
GeneralRe: How to return char* Pin
Richard MacCutchan30-Nov-11 23:45
mveRichard MacCutchan30-Nov-11 23:45 
JokeRe: How to return char* Pin
«_Superman_»30-Nov-11 23:56
professional«_Superman_»30-Nov-11 23:56 
AnswerRe: How to return char* Pin
Richard Andrew x6430-Nov-11 19:51
professionalRichard Andrew x6430-Nov-11 19:51 
GeneralRe: How to return char* Pin
Paulraj G30-Nov-11 20:01
Paulraj G30-Nov-11 20:01 
GeneralRe: How to return char* Pin
«_Superman_»30-Nov-11 20:13
professional«_Superman_»30-Nov-11 20:13 
GeneralRe: How to return char* Pin
Stefan_Lang6-Dec-11 0:33
Stefan_Lang6-Dec-11 0:33 
AnswerRe: How to return char* Pin
Software_Developer30-Nov-11 20:25
Software_Developer30-Nov-11 20:25 
QuestionRe: How to return char* Pin
CPallini1-Dec-11 1:53
mveCPallini1-Dec-11 1:53 
GeneralRe: How to return char* Pin
Addy Tas1-Dec-11 2:14
Addy Tas1-Dec-11 2:14 
AnswerRe: How to return char* Pin
Erudite_Eric1-Dec-11 4:09
Erudite_Eric1-Dec-11 4:09 
GeneralRe: How to return char* Pin
Addy Tas1-Dec-11 7:12
Addy Tas1-Dec-11 7:12 
GeneralRe: How to return char* Pin
Stefan_Lang6-Dec-11 1:41
Stefan_Lang6-Dec-11 1:41 
GeneralRe: How to return char* Pin
Erudite_Eric6-Dec-11 3:40
Erudite_Eric6-Dec-11 3:40 
Questiondxf extraction in c Pin
tanatswa3330-Nov-11 10:44
tanatswa3330-Nov-11 10:44 
AnswerRe: dxf extraction in c Pin
Albert Holguin30-Nov-11 11:43
professionalAlbert Holguin30-Nov-11 11:43 

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.