Click here to Skip to main content
15,913,361 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Read from text file Pin
David Crow22-Oct-09 3:34
David Crow22-Oct-09 3:34 
AnswerRe: Read from text file Pin
sonualex26-Oct-09 20:21
sonualex26-Oct-09 20:21 
QuestionRe: Read from text file Pin
David Crow27-Oct-09 2:59
David Crow27-Oct-09 2:59 
AnswerRe: Read from text file Pin
sonualex27-Oct-09 3:05
sonualex27-Oct-09 3:05 
GeneralRe: Read from text file Pin
David Crow27-Oct-09 3:28
David Crow27-Oct-09 3:28 
GeneralRe: Read from text file Pin
sonualex27-Oct-09 20:29
sonualex27-Oct-09 20:29 
QuestionRe: Read from text file Pin
David Crow28-Oct-09 3:45
David Crow28-Oct-09 3:45 
AnswerRe: Read from text file Pin
sonualex28-Oct-09 23:22
sonualex28-Oct-09 23:22 
thanks again David.. with ur guidance i succeded in completing the project...
my exe is workin fine... iam able to save the contents of editox to text file and import the data from the same text file....
thanking u once again...

my code for OnSave includes

S1 += "Critical****";
S1 += nextline;
S1 += "--------------------------";
S1 += nextline;

flEdit.Write(S1, S1.GetLength());


A.Empty();
m_edit1.GetWindowText(A);
flEdit.Write(A, A.GetLength());
S1 = '\0';

flEdit.Write(S1, S1.GetLength());

flEditClose()

and my code for OnOPen includes

CString mystring;
CString buffer1;
pFile = fopen ("Prioritynotes.txt" , "r");

if (pFile == NULL) perror ("Error opening file");

else
{

while (!feof(pFile))
{

c = fgetc (pFile);
mystring+= c;

if (c=='\n')
{

mystring.TrimRight();

//CODE FOR EXTACTING THE CONTENTS UNDER EACH TITLE

char d[3];
CString test = mystring;
CString crt = "Critical****" ;
CString line = "--------------------------";
CString imp= "Important***";
CString les = "Less Important**";
CString nor = "Normal*";

if(test==crt)
{
mystring ="";
z=1;
}

if(z==1)
{
if(test==imp)
{
mystring =" ";
z=2;
buffer2+=mystring;
m_edit2.SetWindowText(buffer2);
mystring ="";

}
if(mystring !="--------------------------")
{
d[0] = 0x0D;
d[1]= 0x0A;
d[2]= 00;
mystring+= d;

buffer1+=mystring;
m_edit1.SetWindowText(buffer1);
mystring = "" ;

}

}

//SIMILARLY FOR OTHER TITLES....
GeneralRe: Read from text file Pin
David Crow29-Oct-09 2:20
David Crow29-Oct-09 2:20 
GeneralRe: Read from text file Pin
sonualex30-Oct-09 1:01
sonualex30-Oct-09 1:01 
Question#include problem Pin
kk.tvm21-Oct-09 18:30
kk.tvm21-Oct-09 18:30 
AnswerRe: #include problem Pin
«_Superman_»21-Oct-09 18:41
professional«_Superman_»21-Oct-09 18:41 
AnswerRe: #include problem Pin
Naveen21-Oct-09 18:50
Naveen21-Oct-09 18:50 
QuestionHow can set focus on Button in FormView? Pin
Le@rner21-Oct-09 18:27
Le@rner21-Oct-09 18:27 
Questionhow to send messages between diferents dialogs? Pin
timbk21-Oct-09 18:04
timbk21-Oct-09 18:04 
AnswerRe: how to send messages between diferents dialogs? Pin
theCPkid21-Oct-09 18:23
theCPkid21-Oct-09 18:23 
AnswerRe: how to send messages between diferents dialogs? Pin
Adam Roderick J21-Oct-09 18:44
Adam Roderick J21-Oct-09 18:44 
AnswerRe: how to send messages between diferents dialogs? Pin
Cool_Dev21-Oct-09 22:34
Cool_Dev21-Oct-09 22:34 
GeneralRe: how to send messages between diferents dialogs? Pin
timbk22-Oct-09 5:44
timbk22-Oct-09 5:44 
GeneralRe: how to send messages between diferents dialogs? Pin
Cool_Dev22-Oct-09 23:31
Cool_Dev22-Oct-09 23:31 
GeneralRe: how to send messages between diferents dialogs? Pin
timbk28-Oct-09 12:51
timbk28-Oct-09 12:51 
QuestionRe: how to send messages between diferents dialogs? Pin
David Crow22-Oct-09 3:36
David Crow22-Oct-09 3:36 
AnswerRe: how to send messages between diferents dialogs? Pin
timbk22-Oct-09 5:37
timbk22-Oct-09 5:37 
GeneralRe: how to send messages between diferents dialogs? Pin
David Crow22-Oct-09 5:42
David Crow22-Oct-09 5:42 
GeneralRe: how to send messages between diferents dialogs? Pin
timbk22-Oct-09 5:52
timbk22-Oct-09 5:52 

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.