Click here to Skip to main content
15,877,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Converting : String to Unicode Pin
Nibu babu thomas20-Sep-06 20:33
Nibu babu thomas20-Sep-06 20:33 
AnswerRe: Converting : String to Unicode Pin
Haroon Sarwar20-Sep-06 20:32
Haroon Sarwar20-Sep-06 20:32 
QuestionRestirct resizing at run time..... Pin
kiranin20-Sep-06 19:38
kiranin20-Sep-06 19:38 
AnswerRe: Restirct resizing at run time..... Pin
Nibu babu thomas20-Sep-06 19:42
Nibu babu thomas20-Sep-06 19:42 
GeneralRe: Restirct resizing at run time..... Pin
kiranin20-Sep-06 20:05
kiranin20-Sep-06 20:05 
GeneralRe: Restirct resizing at run time..... Pin
Nibu babu thomas20-Sep-06 20:14
Nibu babu thomas20-Sep-06 20:14 
GeneralRe: Restirct resizing at run time..... Pin
kiranin20-Sep-06 20:54
kiranin20-Sep-06 20:54 
Questionproblem with txt file [modified] Pin
With_problem20-Sep-06 19:02
With_problem20-Sep-06 19:02 
while reciving data and printing it in edit box i need to write it in txt file but only few fields not all can you help me to do that..
Code i am using for .txt file and printnig data in edit box.
I have made the comment line before the code to be correct.

<br />
void CWartz_newDlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market, LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp) <br />
{<br />
	// TODO: Add your control notification handler code here<br />
     // THIS ARE MARKET NAME ACCORDINGLE NEED TO CERATE .txt FILE<br />
     CString csMarket="EURUSD";<br />
     CString usMarket ="USDJPY";<br />
    CString gbMarket="GBPUSD" ;<br />
<br />
	sessionid=SessionId;<br />
	CurrentRequestId=RequestId;<br />
	CString MarketSt,a,b,c,d;<br />
<br />
	a.Format("%d",MarketNo);<br />
	b.Format("%c",BidDirection);<br />
	c.Format("%c",AskDirection);<br />
        d.Format("%d",MarketState);<br />
<br />
      // THIS ARE THE FIELD RECIVING FROM REMOTE SERVER <br />
         //  And I need only 4 fields to save on txt file according to market like     //Market,Bid,High,Low,<br />
<br />
        m_MainEdit=m_MainEdit + SessionId +  RequestId + a ; <br />
	m_MainEdit=m_MainEdit + Market  + Bid + b +Ask + c + High ;<br />
	m_MainEdit=m_MainEdit + Low + d +"\t" + Timestamp + "\r\n";<br />
    <br />
	UpdateData(FALSE);<br />
	iLineCount=m_EditCtrl.GetLineCount();<br />
	m_EditCtrl.LineScroll(iLineCount);<br />
    <br />
	  //from here .txt file will be create need coding for this section<br />
	 if(csMarket== Market)   //,myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite)<br />
	{<br />
		 myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite);<br />
		 myfile.SeekToEnd();<br />
		 myfile.Write((LPCTSTR)m_MainEdit,m_MainEdit.GetLength()*sizeof(TCHAR));<br />
          	 myfile.Close();<br />
		 <br />
	}<br />
	//else if(strcmp( Market,"USDJPY") == 0) // CString csMarketA="USDJPY";<br />
<br />
	 else if(usMarket == Market)<br />
	 {<br />
           myfile.Open("UsdJpy.txt",CFile.modeCreate | CFile.modeWrite);<br />
	   LPSTR buf1;<br />
	   int i = m_MainEdit.GetLength();<br />
	    buf1 = m_MainEdit.GetBuffer(i);<br />
	   myfile.Write(buf1,i);<br />
	   myfile.Close();<br />
	}<br />
<br />
	 else if(gbMarket == Market)<br />
	 {<br />
		 myfile.Open("GbpUsd.txt",CFile.modeCreate | CFile.modeWrite);<br />
		 LPSTR buf2;<br />
		 int i = m_MainEdit.GetLength();<br />
		 buf2 = m_MainEdit.GetBuffer(i);<br />
		 myfile.Write(buf2,i);<br />
		 myfile.Close();<br />
		 <br />
	 }<br />
}<br />
<br />



-- modified at 1:18 Thursday 21st September, 2006
AnswerRe: problem with txt file Pin
David Crow21-Sep-06 3:52
David Crow21-Sep-06 3:52 
QuestionHow can i know ( in MFC ) that some dialog window is open now ? Pin
Yanshof20-Sep-06 18:54
Yanshof20-Sep-06 18:54 
AnswerRe: How can i know ( in MFC ) that some dialog window is open now ? Pin
Naveen20-Sep-06 18:56
Naveen20-Sep-06 18:56 
AnswerRe: How can i know ( in MFC ) that some dialog window is open now ? Pin
Rinu_Raj20-Sep-06 18:59
Rinu_Raj20-Sep-06 18:59 
AnswerRe: How can i know ( in MFC ) that some dialog window is open now ? Pin
Nibu babu thomas20-Sep-06 19:49
Nibu babu thomas20-Sep-06 19:49 
QuestionRe: How can i know ( in MFC ) that some dialog window is open now ? Pin
David Crow21-Sep-06 3:55
David Crow21-Sep-06 3:55 
Questioninp( ) and outp( ) functions Pin
vijay_aroli20-Sep-06 18:31
vijay_aroli20-Sep-06 18:31 
AnswerRe: inp( ) and outp( ) functions Pin
Mohammad Rastkar20-Sep-06 18:39
Mohammad Rastkar20-Sep-06 18:39 
GeneralRe: inp( ) and outp( ) functions Pin
vijay_aroli20-Sep-06 18:47
vijay_aroli20-Sep-06 18:47 
AnswerRe: inp( ) and outp( ) functions Pin
Mohammad Rastkar20-Sep-06 19:09
Mohammad Rastkar20-Sep-06 19:09 
GeneralRe: inp( ) and outp( ) functions Pin
David Crow21-Sep-06 4:00
David Crow21-Sep-06 4:00 
AnswerRe: inp( ) and outp( ) functions Pin
susiriss20-Sep-06 19:04
susiriss20-Sep-06 19:04 
QuestionRe: inp( ) and outp( ) functions Pin
vijay_aroli20-Sep-06 19:11
vijay_aroli20-Sep-06 19:11 
AnswerRe: inp( ) and outp( ) functions Pin
susiriss20-Sep-06 22:04
susiriss20-Sep-06 22:04 
QuestionRe: inp( ) and outp( ) functions [modified] Pin
vijay_aroli20-Sep-06 23:50
vijay_aroli20-Sep-06 23:50 
QuestionRe: inp( ) and outp( ) functions Pin
David Crow21-Sep-06 4:05
David Crow21-Sep-06 4:05 
QuestionConsole comminication problem Pin
susiriss20-Sep-06 18:24
susiriss20-Sep-06 18:24 

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.