Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: printf style formatting Pin
bob1697223-May-06 7:54
bob1697223-May-06 7:54 
GeneralRe: printf style formatting [modified] Pin
led mike23-May-06 7:06
led mike23-May-06 7:06 
GeneralRe: printf style formatting [modified] Pin
bob1697223-May-06 8:09
bob1697223-May-06 8:09 
GeneralRe: printf style formatting [modified] Pin
John R. Shaw23-May-06 12:34
John R. Shaw23-May-06 12:34 
QuestionHow to read / write Windows NT Extended Attribute Data and Property Data stream Pin
Touseef Afzal23-May-06 4:09
Touseef Afzal23-May-06 4:09 
QuestionMixing C inside MFC programs Pin
blacksalt23-May-06 3:57
blacksalt23-May-06 3:57 
AnswerRe: Mixing C inside MFC programs Pin
Cedric Moonen23-May-06 4:06
Cedric Moonen23-May-06 4:06 
AnswerRe: Mixing C inside MFC programs Pin
John R. Shaw23-May-06 13:11
John R. Shaw23-May-06 13:11 
1. Include any external C source code files in the project, the same as including a C++ file. The compiler knows the difference between the two file types base on the file extension.

2. Enclose the prototypes for the C functions in the header file or anywhere that a C prototype is provided [in a C++ file], using the extern “C” declaration as follows:
extern "C"
{
    void prn();
}


3. Now you are set to do what ever you want as far as MFC development is concerned.

There is one other possibility; copying all your C files along with their headers into the project folder and changing the extension to ‘.cpp’. I generally do not recommend this if you have other C programs that depend on the same sources, as it is usually better to avoid having multiple copies of the same sources. Then again doing this makes the sources more specific to the C++ project being developed.

Any way you get the general idea of how it works.

Oh, you will have to change any code that is dependent on user interaction via standard input/output or any other non-Windows method. The difficulty of that depends on how you wrote the original code to begin with.

Good Luck!


INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
GeneralRe: Mixing C inside MFC programs Pin
blacksalt24-May-06 3:59
blacksalt24-May-06 3:59 
GeneralRe: Mixing C inside MFC programs Pin
John R. Shaw3-Jun-06 4:41
John R. Shaw3-Jun-06 4:41 
QuestionDeleting a line in a text file Pin
Azghar Hussain23-May-06 3:56
professionalAzghar Hussain23-May-06 3:56 
AnswerRe: Deleting a line in a text file Pin
Cedric Moonen23-May-06 4:03
Cedric Moonen23-May-06 4:03 
GeneralRe: Deleting a line in a text file Pin
Azghar Hussain23-May-06 4:12
professionalAzghar Hussain23-May-06 4:12 
GeneralRe: Deleting a line in a text file Pin
toxcct23-May-06 4:16
toxcct23-May-06 4:16 
GeneralRe: Deleting a line in a text file Pin
Cedric Moonen23-May-06 4:18
Cedric Moonen23-May-06 4:18 
GeneralRe: Deleting a line in a text file Pin
Azghar Hussain23-May-06 4:25
professionalAzghar Hussain23-May-06 4:25 
GeneralRe: Deleting a line in a text file Pin
led mike23-May-06 6:00
led mike23-May-06 6:00 
Questionhow to change back ground color of slider control Pin
aaaan23-May-06 3:14
aaaan23-May-06 3:14 
AnswerRe: how to change back ground color of slider control Pin
Laxman Auti23-May-06 3:26
Laxman Auti23-May-06 3:26 
Questiondata visualisation in command prompt [modified] Pin
McBridou23-May-06 2:45
McBridou23-May-06 2:45 
QuestionDraw transparent bitmap in desktop Pin
Hadi Dayvary23-May-06 2:33
professionalHadi Dayvary23-May-06 2:33 
AnswerRe: Draw transparent bitmap in desktop Pin
_AnsHUMAN_ 23-May-06 2:41
_AnsHUMAN_ 23-May-06 2:41 
GeneralRe: Draw transparent bitmap in desktop Pin
Hadi Dayvary23-May-06 2:58
professionalHadi Dayvary23-May-06 2:58 
GeneralRe: Draw transparent bitmap in desktop Pin
Laxman Auti23-May-06 3:01
Laxman Auti23-May-06 3:01 
AnswerRe: Draw transparent bitmap in desktop Pin
ThatsAlok23-May-06 2:46
ThatsAlok23-May-06 2:46 

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.