Hey, I having problems getting a remote file to be fetched. I suspect it's to do with my lack of understanding of pointers.
Here's what I tried first.
wxURL url(dlg.ThankYou());
wxInputStream *in_stream;
in_stream = url.GetInputStream();
wxOutputStream *out_stream = new wxOutputStream();
in_stream->Read(*out_stream);
wxString stringy;
out_stream->Write(stringy, out_stream->GetSize());
wxMessageBox(stringy);
Then I changed to
wxFileSystem* temp = new wxFileSystem();
wxInputStream *in_stream;
wxOutputStream *out_stream;
in_stream = (temp->OpenFile(dlg.ThankYou()))->GetStream();
in_stream->Read(*out_stream); Both crash at the Read, this is what DrMingw says:NIB2.EXE caused an Access Violation at location 00450c47 in module NIB2.EXE Reading from location 13dfffff.
Registers: eax=00001000 ebx=00001000 ecx=009efbb4 edx=13dfffff esi=00b1e9a0 edi=009ee7e0 eip=00450c47 esp=009ee7cc ebp=009ef7f8 iopl=0 nv up ei pl nz ac po nc cs=0167 ss=016f ds=016f es=016f fs=3bef gs=0000 efl=00010216
Call stack: 00450C47 NIB2.EXE:00450C47 004024C7 NIB2.EXE:004024C7 MyFrame::NewDomainSearch(wxCommandEvent&) MyFrame.cpp:77 ... wxOutputStream *out_stream; in_stream = (temp->OpenFile(dlg.ThankYou()))->GetStream(); > in_stream->Read(*out_stream); ...
0043537A NIB2.EXE:0043537A 004351CD NIB2.EXE:004351CD 0042671E NIB2.EXE:0042671E 0040677C NIB2.EXE:0040677C 00406528 NIB2.EXE:00406528 00415920 NIB2.EXE:00415920 BFF7363B KERNEL32.DLL:BFF7363B EnumSystemCodePagesW BFF94407 KERNEL32.DLL:BFF94407 CopyFileExW 009E8BEA Can anyone help me? |