Search found 176 matches

by Romas
Fri Sep 11, 2009 2:26 pm
Forum: C++ Development
Topic: How to convert wxArrayString into wxString efficiently
Replies: 10
Views: 3861

Hello Andre, As I am old timer dev, I like to save memory allocation times. So, looking at the code: wxString some_function () { wxString str.... return str; } gives me the look, that it will allocate memory twice: for string at wxString str (plus when you assign sth to it) and you create new wxStri...
by Romas
Fri Sep 11, 2009 11:42 am
Forum: C++ Development
Topic: User defined pointer
Replies: 10
Views: 1585

I think that this is not wise to play with pointers of your choise as this makes your code more error prone. I suggest to use subclassing (as it was mentioned by DavidHart) or store the pointer as variable to the parent window.
by Romas
Fri Sep 11, 2009 5:56 am
Forum: C++ Development
Topic: How to convert wxArrayString into wxString efficiently
Replies: 10
Views: 3861

Hm,

Whats wrong with the given code? Of course, if you want speed you would use reference to string, alloc memory before loop, I would use operator << to append to string, but the whole functionality would be the same. :)
by Romas
Wed Sep 09, 2009 8:36 am
Forum: C++ Development
Topic: ShowModal executes the code out of mainloop?
Replies: 3
Views: 1431

You do not understand the main principle of thread.

ShowModal doesn't create a new thread, it creates another message pump loop which will stop the main loop while dialog is showing. However, the messages to main loop should be received.
by Romas
Sun Sep 06, 2009 7:04 pm
Forum: C++ Development
Topic: Problem using the StatusBar
Replies: 3
Views: 1227

I think the problem lies somewhere else. Can you show the exit place of you code? Maybe you have bad pointers in your program?
by Romas
Thu Sep 03, 2009 12:58 pm
Forum: C++ Development
Topic: Getting a window's bitmap?
Replies: 5
Views: 1469

The only idea that came to my mind is to do custom draw to bitmap. That is, you know the window, you know it's data and do custom draw to given bitmap. I really doubt, that you will get the window bitmap of scrolled window... Also, you could try to get dc of the window, look at it's update region, t...
by Romas
Wed Sep 02, 2009 7:00 pm
Forum: C++ Development
Topic: Getting a window's bitmap?
Replies: 5
Views: 1469

IMHO, you cannot get "screen shot" of a window that is not visible (no drawings, no size events, nothing has happend). However if window once has been active, you might win sth. But I cannot tell you anything concrete. Sorry
by Romas
Wed Sep 02, 2009 10:16 am
Forum: C++ Development
Topic: [Sockets] wxSOCKET_LOST event not handled ?
Replies: 3
Views: 1007

To terminate gracefull with the server you need to apply particular action sequence. I think you do not receive socket lost because of big timeout. Try to wait up to 1 min, maybe then you will receive a timeout (I think this depends on platform you are coding)
by Romas
Mon Aug 31, 2009 1:33 pm
Forum: C++ Development
Topic: [Socket] many problems with sockets
Replies: 13
Views: 2378

It doesn't need an array, you have just passed it. Remember, it uses void * as parameter, which is a pointer to memory, whatever format :) Glad I could help...
by Romas
Mon Aug 31, 2009 12:20 pm
Forum: C++ Development
Topic: [Socket] many problems with sockets
Replies: 13
Views: 2378

ok, let's do in this way, change server and client flags to wxSOCKET_NOWAIT, then on client read do, char buff [12]; client->Read (buff, 12); If this not helps, I will try to make simple project on my local computer later.

BTW: have you looked at the samples folder of wxwidgets?
by Romas
Mon Aug 31, 2009 11:46 am
Forum: C++ Development
Topic: [Socket] many problems with sockets
Replies: 13
Views: 2378

relax, it is not an easy task to debug in forum :) first of all! char* msg = "asdasd"; ... dati->Write(msg,200); Can you answer, what is the length of the buffer msg? is it really 200? I don't think so... Try to do strlen (msg) And after you do the Read from the client, please check LastCo...
by Romas
Mon Aug 31, 2009 10:56 am
Forum: C++ Development
Topic: [Socket] many problems with sockets
Replies: 13
Views: 2378

Can you do "write" with "char *" buffer (even in unicode build)? And can you see what client receives. And, please note, that if you are trying to send a number, you can fail with the endian stuff (of course, when testing on the same computer and platform you will not notice this).
by Romas
Mon Aug 31, 2009 9:56 am
Forum: C++ Development
Topic: [Socket] many problems with sockets
Replies: 13
Views: 2378

What I've ment, was server* frame = new server(NULL); I don't like the lines in your code: int msg = 1; if(dati->IsConnected()) dati->Write(&msg,dati->LastCount()); For what can I see in docs, you are trying to pass a buffer, which is in your case 4 bytes of msg (sizeof (int) == 4), and then you...
by Romas
Mon Aug 31, 2009 6:56 am
Forum: C++ Development
Topic: [Socket] many problems with sockets
Replies: 13
Views: 2378

What is a "server" objet in your code? I do not see where you are using it...
by Romas
Fri Aug 28, 2009 9:57 am
Forum: C++ Development
Topic: embedding wxWidgets
Replies: 11
Views: 2231

I think it will be a hassle to embed particular classes. It will be much easier to build a static library and use whatever you need from it. Howevever, you will need to make a build and your exe size will grow. (You can config setup.h to make library smaller and more specific to your needs).