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

C / C++ / MFC

 
GeneralRe: How to creat exe files? Pin
Dody_DK17-Nov-04 7:37
Dody_DK17-Nov-04 7:37 
GeneralRe: How to creat exe files? Pin
gamitech17-Nov-04 10:35
gamitech17-Nov-04 10:35 
GeneralRe: How to creat exe files? Pin
Dody_DK17-Nov-04 10:53
Dody_DK17-Nov-04 10:53 
GeneralRe: How to creat exe files? Pin
gamitech17-Nov-04 10:56
gamitech17-Nov-04 10:56 
GeneralRunning main() from a dialog-based control Pin
aaadetos13-Nov-04 9:30
aaadetos13-Nov-04 9:30 
GeneralRe: Running main() from a dialog-based control Pin
aaadetos13-Nov-04 12:55
aaadetos13-Nov-04 12:55 
GeneralRe: Running main() from a dialog-based control Pin
John R. Shaw13-Nov-04 16:58
John R. Shaw13-Nov-04 16:58 
GeneralRe: Running main() from a dialog-based control Pin
aaadetos14-Nov-04 16:16
aaadetos14-Nov-04 16:16 
Confused | :confused: John,
Thanks a lot for the constructive criticism. Yeah, i'm definitely a newbie grappling with the fundamentals. I moved the code from main() to my control button, including the appropriate #include files, and the project currently comiples without error.[THANK YOU!] I also deleted the source file containing main()(didn't bother to have any main, since WinMain() is supposed to be hidden anyway....However, while it compiles without error, it doesn't seem to do what I want it to!!

Below is the code:
void CKuchukDlg::OnAnalyze()
{
// let maximum number of layers = 100: this value can be modified.
int num_layers;

CKuchukDlg MyClass; // instance of object MyClass of class CKuchukDlg
MyClass.m_iLayers = num_layers;

int i = 1; // index to count what line is being read: start at line 1;
int H_ft[100],kh_md[100], kv_md[100];
float visc_cp[100], por[100], ct_psi[100];

char line[100];


ifstream inputdeck;
inputdeck.open("input.txt", ios::in);

if (inputdeck.fail())
{
//cout<<"Error With Files!";
AfxMessageBox("File Read Error!", MB_ICONSTOP);
}

else
{
cin.ignore(60, '\n');
cin.ignore(60, '\n');

while (i <= num_layers && cin.getline(line,100)) //
{
cin>>H_ft[i]>>kh_md[i]>>kv_md[i]>>visc_cp[i]>>por[i]>>ct_psi[i];
i++;

} /* while block */
}


ofstream outputdeck;
outputdeck.open("output.txt", ios::out);

outputdeck<<"Pressure\n";

extern double pressure(double x);
extern double press;

outputdeck<<press<<endl;

}


On clicking the "Analyze" button, the whole application closes. This is not supposed to happen.

I'd be greatful for any further input you or anyone else may have.
Thanks a lot!
GeneralRe: Running main() from a dialog-based control Pin
John R. Shaw17-Nov-04 7:39
John R. Shaw17-Nov-04 7:39 
GeneralRe: Running main() from a dialog-based control Pin
aaadetos19-Nov-04 21:39
aaadetos19-Nov-04 21:39 
GeneralRe: Running main() from a dialog-based control Pin
John R. Shaw20-Nov-04 11:03
John R. Shaw20-Nov-04 11:03 
GeneralCEdit subclass question Pin
nguyenvhn13-Nov-04 6:48
nguyenvhn13-Nov-04 6:48 
GeneralRe: CEdit subclass question Pin
BlackDice13-Nov-04 11:39
BlackDice13-Nov-04 11:39 
GeneralRe: CEdit subclass question Pin
nguyenvhn13-Nov-04 14:46
nguyenvhn13-Nov-04 14:46 
GeneralRe: CEdit subclass question Pin
John R. Shaw13-Nov-04 17:29
John R. Shaw13-Nov-04 17:29 
GeneralRe: CEdit subclass question Pin
Ravi Bhavnani13-Nov-04 23:21
professionalRavi Bhavnani13-Nov-04 23:21 
GeneralCAsyncSocket Question Pin
Rassul Yunussov13-Nov-04 0:01
Rassul Yunussov13-Nov-04 0:01 
Generaltime critical thread Pin
LeeeNN12-Nov-04 20:17
LeeeNN12-Nov-04 20:17 
GeneralRe: time critical thread Pin
Michael Dunn13-Nov-04 5:39
sitebuilderMichael Dunn13-Nov-04 5:39 
GeneralRe: time critical thread Pin
Anonymous13-Nov-04 9:57
Anonymous13-Nov-04 9:57 
GeneralRe: time critical thread Pin
John R. Shaw13-Nov-04 17:49
John R. Shaw13-Nov-04 17:49 
GeneralPostThreadMessage Pin
includeh1012-Nov-04 19:17
includeh1012-Nov-04 19:17 
GeneralRe: PostThreadMessage Pin
peterchen12-Nov-04 19:50
peterchen12-Nov-04 19:50 
Questionemail ? Pin
BaldwinMartin12-Nov-04 18:25
BaldwinMartin12-Nov-04 18:25 
GeneralCTreeCtrl item display limit or multiline Pin
Pakosan12-Nov-04 18:02
Pakosan12-Nov-04 18:02 

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.