Re: console in mfc
From: Scott McPhillips [MVP] (scottmcp_at_mvps.org.nothere)
Date: 06/08/04
- Next message: Steve Russell: "rounding and remainders"
- Previous message: Subhash Badri: "Does ShellExecute leak memory?"
- In reply to: francis: "console in mfc"
- Next in thread: Joseph M. Newcomer: "Re: console in mfc"
- Reply: Joseph M. Newcomer: "Re: console in mfc"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 08 Jun 2004 00:40:42 -0500
francis wrote:
> what i'm trying do do here is to integrate a .c file into an mfc environment. my expected output is when i click a button; a console window would appear that would print HELLO WORLD. I'm a newbie at this, and i might ask questions that may seem trivial to the experienced so please be patient with me..:) i'm doing this so that i could get a hang of calling .c functions in mfc.
>
> this is the .c and .h file that i am trying to use.
>
> hello.h
> ------------
> #if defined(__cplusplus)
> extern "C" {
> #endif
>
> void Hello();
>
> #if defined(__cplusplus)
> }
> #endif
>
> hello.c
> ----------------------
> #include <stdio.h>
> #include <stdlib.h>
> #include <conio.h>
> #include "hello.h"
>
>
> void Hello()
> {
> char c;
>
> printf("HELLO WORLD!!!");
>
> c = getch();
> }
>
> i have encountered error such as c1853 and c1010 and i resolved both this problems by making my .c file not use precomp headings and then doing a rebuild all. the erors were gone but the program still wouldn't work. I added the the function Hello(); on the BN_CLICKED part of the code and i include the hello.h. What is it that i am missing? I was told by the people here that it would work after the rebuild? i'm confused....
>
>
>
Programs that use windows for user interaction do not have a console
output. printf goes nowhere. You can build a console program, or you
can build a windowed program. It is even possible to add a console
window to a windowed program. But that is an unusual combination and
probably not a good learning exercise.
-- Scott McPhillips [VC++ MVP]
- Next message: Steve Russell: "rounding and remainders"
- Previous message: Subhash Badri: "Does ShellExecute leak memory?"
- In reply to: francis: "console in mfc"
- Next in thread: Joseph M. Newcomer: "Re: console in mfc"
- Reply: Joseph M. Newcomer: "Re: console in mfc"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|