|
It's ok dude.. No problem
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Did you find this file?
|
|
|
|
|
I am using this code to save data in txt file but i just dont understand what went wrong in that it saves all data rather then that market detail only.
<br />
<br />
CString csMarket="EURUSD";<br />
CString usMarket ="USDJPY";<br />
CString gbMarket="GBPUSD" ;<br />
<br />
if(csMarket == Market)
{<br />
myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite);<br />
<br />
LPSTR buf;<br />
int i= m_MainEdit.GetLength();<br />
buf = m_MainEdit.GetBuffer(i);<br />
myfile.Write(buf,i);<br />
myfile.Close();<br />
<br />
}<br />
else if(strcmp( Market,"USDJPY") == 0) <br />
<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 />
<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 />
|
|
|
|
|
Show the definition of Market . Wont thing's be more easier if you store your Market in a CString csMarket ?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Market is the name of market like2 "usdjpy","gld","slv" etc and with this, rate of market and the days highest "bid" and the lowest "bid"
|
|
|
|
|
Try this,
<br />
CString Market;<br />
<br />
if(Market==usMarket)<br />
{<br />
}<br />
else if(Market==csMarket)<br />
{<br />
<br />
}<br />
else if(Market==gbMarket)<br />
{<br />
<br />
}<br />
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
I cant do thsi caz Market detail are coming from remote server i need to save only this 3 market detail in txt file
CString csMarket="EURUSD";
CString usMarket ="USDJPY";
CString gbMarket="GBPUSD" ;
|
|
|
|
|
You'll get any one of these at a time ? if so, you can do one thing :
From your code, Market looks like a char* so you would better do,
<br />
myfile.Open(Market,CFile.modeCreate | CFile.modeWrite);<br />
So that it writes into separate files according to the value of "Market".
Or I still dont get your problem?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
abrakadbra wrote: if(csMarket == Market) //,myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite)
{
myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite);
// myfile.Write((LPCTSTR)m_MainEdit,m_MainEdit.GetLength()*sizeof(TCHAR));
LPSTR buf;
int i= m_MainEdit.GetLength();
buf = m_MainEdit.GetBuffer(i);
myfile.Write(buf,i);
myfile.Close();
}
Is this the snippet of code that you are questioning?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yes do you have any idea how to correct the following code....how to store only one market data in one txt file.
|
|
|
|
|
abrakadbra wrote: yes do you have any idea how to correct the following code....how to store only one market data in one txt file.
Like has been said at least two times before, change buf to only contain the data you wanted saved to the file.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is there any source code or link for databse programming which tell us how to save data in datbase coming from remote server.
|
|
|
|
|
|
abrakadbra wrote: Is there any source code or link for databse programming which tell us how to save data in datbase coming from remote server.
try msdn samples! or google
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Exception Handeling seems to hide behind obsure procedures. I've read and understood the principles as set out in Matt Pietrecks various articles on the subject, somehow, VCPP5.00 appears to work differently.
All I want to do is throw an exception, as a DWORD value of my liking, so that a catch block can either deal with it true a switch statement, or throw it further down the chain by default. It occurs to me that that's sort of basic, which even VCPP5.00 should be able to handle.
LateNightsInNewry
|
|
|
|
|
You're using VC5 ? Why ?
However, I'd have hoped it could do that, although C++ exceptions kind of suck if you're in any way used to .NET ones.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Why and How would that upset .NET?? My code is not NET aware, and will not ever be required to run under NET
LateNightsInNewry
|
|
|
|
|
Imagine if your company car was a Ferrari and on weekends you had to drive a scooter. The scooter is still a scooter, but you'd feel a lot worse about sitting on it if you were used to a Ferrari.
It won't matter to .NET, I meant that if you had used .NET exceptions and then tried to use C++ exceptions, you'll find yourself wishing they did more.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Get your Drift, however;
This question is not so much about a Ferari which I do not posess, but about the scooter going from A to B. You may be fortunate enough to write for a client base equiped with the latest harware. I am not so fortunate, the Software I write is supposed to run on Win98-SE. The question is still the same, Hoe do I throw exceptions by say Number under VCPP5.0
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: the Software I write is supposed to run on Win98-SE
OK. Are you under the mistaken impression that this means you need to use VC5 ?
Either way, I can't comment on VC5, but I would expect in general that anything that VC6 does in this regard, VC5 should be fine. Perhaps if you posted your code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Perhaps if you posted your code ?
The problem with that is, The code has not been written yet. I am doing something before I write code, which is called 'Planning your Process'. The Larger plan is as follows:-
I am writing a Server Client Program, where the Server maintains a Database, which is accessed by clients by requests for either information or update. Server and Clients typically run on different machines on a local network, but communicate by structured messages sent over a WIN32 Pipe. I am now investigating the possibility of terminating a long process on the Server, by means of the User on the Client Terminal clicking on 'Cancel' on the Wait box.
The entire design of the system is 'Proprietory' and 'From the Ground up', and is purpously designed to be non-compatible with any Microsoft Database format. Iam now looking for an exception handeling mechanism which handles exceptions by GUID_EXCEPTION_ID. If something like this exists already, I'll use it. If it does Not exist I've to Invent it.
LateNightsInNewry
|
|
|
|
|
The low level OS provided SEH is primarily used as a layer to implement higher level exception constructs used in higher level languages such as C++ or the .NET languages. I'm not sure about MSVC5 but I'd be surprised to find it works very differently from MSVC6 or higher.
Steve
|
|
|
|
|
just recently got visual studio 2005 and well to put a long story short it has been driving me crazy lol. but anyways i had to switch from using soem of the old libraries to usign the new ones and it has caused nothing but trouble. in my vc 6 i had a piece of code that would put any text i passed into a ostrstrea object(which in 2005 now is ostringstream) and it was stored into a char buffer which i would pass the buffer off to the setwindowtext function of a cedit control and it would display any text in the buffer but after a few changes to allow my program to compile the text will not display and i am not quite sure why. i have the code set up to work as it did in vc 6 but i am not sure what changes were made that now causes it to fail in vc 8, if someone could help me figure out what might be wrong i would greatly appreciate it.
|
|
|
|
|
swatgodjr wrote: i passed into a ostrstrea object(which in 2005 now is ostringstream)
I suspect this means you used to use strstream.h. The standard headers you're now using in VC2005 were there in VC6, but it's taken this long for the headers that are not part of standard C++ to be removed from the Microsoft compiler.
swatgodjr wrote: but i am not sure what changes were made
All the the changes made were to make the compiler more standards compliant, in other words, if your code had been legal C++, it would not have caused any problems.
swatgodjr wrote: if someone could help me figure out what might be wrong i would greatly appreciate it.
I'm more than happy to help. Not much I can do without seeing the code
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok not a problem, i been constantly looking for ways to redo the code correctly but not much luck yet well heres the code to one part of my program:
<br />
const int TEXT_SIZE = 5000;<br />
char szbuf[TEXT_SIZE];<br />
std::ostringstream str(szbuf);<br />
<br />
void CHelpDialog::help_mes(char num[], bool cnt, char mess[])<br />
{<br />
if(cnt == true)<br />
{<br />
str << " " << num << ". " << mess << "\r" << std::endl;<br />
<br />
}<br />
if(cnt == false)<br />
{<br />
str << " " << mess << "\r" << std::endl;<br />
}<br />
}<br />
<br />
BOOL CHelpDialog::OnInitDialog()<br />
{<br />
CEdit *pHelpText;<br />
pHelpText = (CEdit *) GetDlgItem(IDC_HELPTEXT);<br />
<br />
str.seekp(0);<br />
<br />
help_mes("1", true, "Everything entered in this program is case-sensitive so if");<br />
help_mes("", false, "your program fails to load when you type in name of the plug");<br />
help_mes("", false, "in to load, check if you spelled it correctly with the right");<br />
help_mes("", false, "capitalization.\n");<br />
help_mes("2", true, "If the program you enter fails to load, make sure you have the");<br />
help_mes("", false, "required dll files needed for the program.");<br />
help_mes("3", true, "If there is any more bugs found than please contact me to let me");<br />
help_mes("", false, "know. I can be reached at swatgod@gmail.com.\n");<br />
<br />
pHelpText->SetWindowText(szbuf);<br />
memset(szbuf, 0, sizeof(szbuf));<br />
<br />
return true;<br />
}<br />
that is all the code that basically deals with the problem area, any advice is very much appreciated .
|
|
|
|