everyone, I was trying to compile a program using C++/CLI to check my stocks, but I ran into an error when I put the variable in the URL. Can anyone help me, please?
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
this->webBrowser1->Navigate("http://finance.yahoo.com/echarts?s="num".HK+Interactive#chart1:symbol="num".hk;range=1d;indicator=volume;charttype=line;crosshair=on;ohlcvalues=0;logscale=on;source=undefined");
}
Oh, and by the way, this code is from a "Windows Forms Application" and the name of the variable is "num". Again, I would appreciate any help if possible. Thanks.
It looks like you aren't doing anything to build the string. I've never done managed C++, but I assume you can't do this:
"http://finance.yahoo.com/echarts?s="num
and get what you want. In C#, you could just use operator+:"http://finance.yahoo.com/echarts?s=" + num
, or use StringBuilder, or String.Format. I'd imagine there's something similar in managed C++.