Search found 305 matches

by Lucky75
Mon Mar 29, 2010 2:45 am
Forum: C++ Development
Topic: Socket input event only happening once
Replies: 3
Views: 748

I won't get any more input events until I read all the data that's already there? And actually, I tried uncommenting the code originally but for some reason I never got to the last line, and none of the data was actually printed :( Edit: Aha! You might actually be correct. It seems to work! Do I nee...
by Lucky75
Mon Mar 29, 2010 1:59 am
Forum: C++ Development
Topic: Socket input event only happening once
Replies: 3
Views: 748

Socket input event only happening once

Hi, I'm trying to adapt the client socket example to my purposes, but I only seem to be able to get input events once, and then I don't get any more. Any ideas as to why? Am I doing something wrong? Thanks! BEGIN_EVENT_TABLE(MyFrame, wxFrame) ... stuff .... EVT_SOCKET(SOCKET_ID, MyFrame::OnSocketEve...
by Lucky75
Sat Mar 27, 2010 9:47 pm
Forum: C++ Development
Topic: Socket Events not being triggered
Replies: 6
Views: 1253

The console application is actually an embedded web server (http://www.webtoolkit.eu), and unfortunately it needs to be a console application. Another problem is that regardless of what I do, the socket server code needs to be running in a separate thread than the rest of the console application, wh...
by Lucky75
Sat Mar 27, 2010 4:29 pm
Forum: C++ Development
Topic: Socket Events not being triggered
Replies: 6
Views: 1253

Hmm, I'm trying to figure out how to use IMPLEMENT_APP_NO_MAIN, but I don't know where to go, even after looking at the mfc sample.

What am I passing in as the parameter? Does that create an event loop? I assume I still need to inherit from wxFrame or something as well?
by Lucky75
Sat Mar 27, 2010 9:22 am
Forum: C++ Development
Topic: Socket Events not being triggered
Replies: 6
Views: 1253

I know that the gui will always be available, but I also need to have a main function, as I'm trying to add this on top of a console app which is already coded. I *think* that means I can't use the whole "IMPLEMENT_APP(MyApp)" can I? Is it possible to create a hidden window but have a main() functio...
by Lucky75
Sat Mar 27, 2010 2:52 am
Forum: C++ Development
Topic: Socket Events not being triggered
Replies: 6
Views: 1253

Socket Events not being triggered

Hey, I'm trying to set up a client/server socket connection, so I'm slightly adapting the socket server example so that the server doesn't have a frame/gui, it just runs from the command line. However, I can't seem to get any sort of events being triggered, even though the client seems to think that...
by Lucky75
Sat Mar 27, 2010 12:42 am
Forum: C++ Development
Topic: Implement app without IMPLEMENT_APP(MyApp)?
Replies: 2
Views: 1329

Implement app without IMPLEMENT_APP(MyApp)?

Hey, I have an embedded c++ web server running in a console app, and I'm trying to use the WxServer demo with it as well, but I don't know how to create a new instance of the app (frame and all). Is there a way that I can add the wxApp without starting with it? i.e., do I need to use IMPLEMENT_APP, ...
by Lucky75
Mon Dec 28, 2009 3:30 am
Forum: C++ Development
Topic: wxsocket determine content length?
Replies: 3
Views: 608

Hmm, yeah, I could do something like that. Aren't there 3 ways to tell if the server is done sending through? Parsing the content length from the header is one way, but I thought that not all servers necessarily send the CL? And is there an easy way to parse the headers, store them into separate var...
by Lucky75
Mon Dec 28, 2009 2:38 am
Forum: C++ Development
Topic: wxsocket determine content length?
Replies: 3
Views: 608

wxsocket determine content length?

Hi, I'm trying to send a get request, and I get a response, but I'm unsure of how to determine the length of the buffer to read into? I was thinking of doing void OnSocketEvent(wxSocketEvent& event) { if(event.GetSocketEvent() == wxSOCKET_INPUT) { while(m_sock->IsData() { m_sock->Read(buffer,1024) f...
by Lucky75
Sun Dec 27, 2009 6:11 am
Forum: C++ Development
Topic: simple wxSocket get request?
Replies: 5
Views: 984

Haha, wow, I feel stupid now. Yeah, that was the problem. Thanks :)

So apparently I'm doing everything correctly?

What's the real difference between server socket and client socket? Or would you just recommend using the base socket class?
by Lucky75
Sat Dec 26, 2009 11:19 pm
Forum: C++ Development
Topic: simple wxSocket get request?
Replies: 5
Views: 984

Hey, thanks for the response. I don't actually want to have it be HTTP, it's just for now. Eventually I'm going to be doing other things with it, so I want to make it as open as possible. It actually does connect though. I get a connection event, then I get an output event when I write the GET reque...
by Lucky75
Sat Dec 26, 2009 7:37 pm
Forum: C++ Development
Topic: simple wxSocket get request?
Replies: 5
Views: 984

simple wxSocket get request?

Hi all, I'm rather confused about how to use the wxSockets. I've read the help thread and the docs, but they don't really help all that much. How would I just send a sample get request to say, google, and write the data to a file? Doesn't seem to be working for me :( I don't seem to get a response. ...
by Lucky75
Thu Aug 30, 2007 3:07 pm
Forum: C++ Development
Topic: Not enough storage is available to process this command...
Replies: 13
Views: 3007

1269x639 all prepareplot() does is set stuff on the screen. void GraphWin::preparePlot(wxBufferedDC &mydc, bool autoscale) { wxColour lineColour = wxColor(200, 200, 0); //set middle line colour int width, height; this->GetClientSize(&width, &height); if(autoscale) { // draw horizontal line down midd...
by Lucky75
Thu Aug 30, 2007 1:58 pm
Forum: C++ Development
Topic: Not enough storage is available to process this command...
Replies: 13
Views: 3007

I think I am deleting everything though... void GraphWin::PlotIt(bool scaleflag) { wxWindow *myParent = GetParent(); // get pointer to parent window (ScrollingPlotFrame) ScrollingPlotFrame *pWindow = wxDynamicCast(myParent, ScrollingPlotFrame); if(pWindow&&scaleflag) // if a new sample rate is set, ...
by Lucky75
Thu Aug 30, 2007 1:18 pm
Forum: C++ Development
Topic: Not enough storage is available to process this command...
Replies: 13
Views: 3007

It happens when I open a certain number of windows (the number varies, usually 6 or 7).
Yeah, it is a runtime thing.

How do I fix a gdi leak? I thought the pens, etc were cleaned up by the system. And I don't have a paint event, i have a timer and a fcn that uses wxbuffereddc