Click here to Skip to main content
15,914,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: displaying an image Pin
ThatsAlok23-Sep-04 3:32
ThatsAlok23-Sep-04 3:32 
Question[DLL]: Can I declare a global variable in a DLL? Pin
Behzad Ebrahimi21-Sep-04 4:54
Behzad Ebrahimi21-Sep-04 4:54 
AnswerRe: [DLL]: Can I declare a global variable in a DLL? Pin
David Crow21-Sep-04 5:33
David Crow21-Sep-04 5:33 
GeneralRe: [DLL]: Can I declare a global variable in a DLL? Pin
ThatsAlok23-Sep-04 3:37
ThatsAlok23-Sep-04 3:37 
GeneralRe: [DLL]: Can I declare a global variable in a DLL? Pin
David Crow23-Sep-04 3:46
David Crow23-Sep-04 3:46 
GeneralTCP/IP: set push bit Pin
probst21-Sep-04 4:46
probst21-Sep-04 4:46 
GeneralRe: TCP/IP: set push bit Pin
Alexander M.,21-Sep-04 9:42
Alexander M.,21-Sep-04 9:42 
GeneralCFileDialog stops me writing to log file Pin
ChrisBidmead21-Sep-04 4:36
ChrisBidmead21-Sep-04 4:36 
i have an odd run time error occuring my app. it is a simple SMTP program. when i select button1 it opens a CFiledialog as it should if i select "cancel" it works as it should no problems, but if i select "ok" the selected file path is returned as it should, however when the message is sent no data is written to the log file.
this occurs even if the path returned is removed before sending the data it follows the same code path as if i had not selected a path

the button code is as follows

void CMail2Dlg::OnButton1()
{
UpdateData(); // saves control data to variables
// Create an instance
CFileDialog fileDlg( TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, "All Files (*.*)|*.*||", this);

// Initializes m_ofn structure
fileDlg.m_ofn.lpstrTitle = "Attach File";

// Call DoModal
if ( fileDlg.DoModal() == IDOK) // seems to be the cause of the problem!!!!
{
CString szlstfile = fileDlg.GetPathName(); // This is your selected file name with path
m_att = szlstfile; //sets path to a variable of my main modal dialog
UpdateData(FALSE); //variables to controls
}
}

// the following code is writing of data to a file which occurs in various functions


ofstream logc ("logs.txt",ios::out | ios::app);
if (logc.is_open())
{
logc << rVal; // rVal is the data
logc.close();
}

please could any1 helpConfused | :confused:
GeneralRe: CFileDialog stops me writing to log file Pin
David Crow21-Sep-04 5:45
David Crow21-Sep-04 5:45 
GeneralRe: CFileDialog stops me writing to log file Pin
ChrisBidmead21-Sep-04 6:21
ChrisBidmead21-Sep-04 6:21 
GeneralRe: CFileDialog stops me writing to log file Pin
David Crow21-Sep-04 8:34
David Crow21-Sep-04 8:34 
GeneralRe: CFileDialog stops me writing to log file Pin
ChrisBidmead21-Sep-04 10:20
ChrisBidmead21-Sep-04 10:20 
GeneralRe: CFileDialog stops me writing to log file Pin
David Crow21-Sep-04 10:24
David Crow21-Sep-04 10:24 
GeneralWindow not restoring from Task Bar Pin
LannieK21-Sep-04 4:04
LannieK21-Sep-04 4:04 
Generaltemplate question Pin
sandrineV21-Sep-04 4:02
sandrineV21-Sep-04 4:02 
Generalsend text using serial comm Pin
mark18221-Sep-04 3:54
mark18221-Sep-04 3:54 
GeneralRe: send text using serial comm Pin
Nicholas Cardi21-Sep-04 5:15
Nicholas Cardi21-Sep-04 5:15 
GeneralRe: send text using serial comm Pin
ThatsAlok23-Sep-04 3:37
ThatsAlok23-Sep-04 3:37 
QuestionHow to add Integer type Member Variable to a ComboBox? Pin
pubududilena21-Sep-04 3:25
pubududilena21-Sep-04 3:25 
AnswerRe: How to add Integer type Member Variable to a ComboBox? Pin
mark18221-Sep-04 3:37
mark18221-Sep-04 3:37 
GeneralRe: How to add Integer type Member Variable to a ComboBox? Pin
pubududilena21-Sep-04 3:52
pubududilena21-Sep-04 3:52 
GeneralRe: How to add Integer type Member Variable to a ComboBox? Pin
David Crow21-Sep-04 5:37
David Crow21-Sep-04 5:37 
Generalexecute device manager Pin
mark18221-Sep-04 3:24
mark18221-Sep-04 3:24 
GeneralRe: execute device manager Pin
BlackDice21-Sep-04 6:55
BlackDice21-Sep-04 6:55 
GeneralRe: execute device manager Pin
Alexander M.,21-Sep-04 9:47
Alexander M.,21-Sep-04 9:47 

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.