Search found 79 matches

by Marcus Frenkel
Sun Jun 21, 2009 9:25 pm
Forum: C++ Development
Topic: Using event to send data to the main thread
Replies: 9
Views: 1394

Maybe there's a leak inside MyDataObject. You are right, the "problem" is with MyDataObject. I will post again the code in more detail. Secondary thread: . . void MyClass::MyFunction (const DataObject* DataObjectPtr) { . wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,ID_DataResult); event.SetCli...
by Marcus Frenkel
Sun Jun 21, 2009 6:35 pm
Forum: C++ Development
Topic: Using event to send data to the main thread
Replies: 9
Views: 1394

Using event to send data to the main thread

Hi, I need to send user defined data/object from a secondary thread to the main thread using events. I have the following code: Secondary thread . . wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED,ID_DataResult); event.SetClientData( new MyDataObject() ); wxPostEvent(frame, event); . . Main/GUI th...
by Marcus Frenkel
Sun Jun 21, 2009 12:16 pm
Forum: C++ Development
Topic: wxString vs wxArrayString vs wxString array
Replies: 8
Views: 1868

Thanks a lot to everyone. It's much more clear to me know.

Marcus
by Marcus Frenkel
Sun Jun 21, 2009 8:47 am
Forum: C++ Development
Topic: wxString vs wxArrayString vs wxString array
Replies: 8
Views: 1868

I want to let you know that having different names for all strings is not a problem at all in my case. In fact it will be more readable for me since I will load them with certain language file and it will be more easier to know which string to put where. Therefore, the only thing I'm focused is the ...
by Marcus Frenkel
Sat Jun 20, 2009 9:02 am
Forum: C++ Development
Topic: wxString vs wxArrayString vs wxString array
Replies: 8
Views: 1868

wxString vs wxArrayString vs wxString array

Hi,

I would like to double check which one of these take more memory and can be accessed faster:

1) 100 wxString variables
2) wxArrayString with 100 wxString variables as elements
3) wxString array with 100 wxString variables as elements

Thank you!
Marcus
by Marcus Frenkel
Fri Jun 12, 2009 9:36 am
Forum: C++ Development
Topic: downloading a file using wxURL : doesn't work as a thread
Replies: 6
Views: 1410

This is an old case closed post but just one note. According to http://wiki.wxwidgets.org/WxURL : "Under Windows, wxURL and wxThread may have problems to work well together. Be sure to construct the wxURL and call wxURL::GetInputStream inside the main thread." If it works OK like in the TrV case, is...
by Marcus Frenkel
Fri Jun 12, 2009 8:24 am
Forum: C++ Development
Topic: wxTread: communication between the main and second thread
Replies: 6
Views: 1305

..it may be easier to use wxThread::Delete and wxThread::TestDestroy....And you really should use mutex/critical sections. I need to end the loop in the secondary thread properly because when it ends additional actions are taken - client is unregistered from a server. I will try to use mutex/critic...
by Marcus Frenkel
Wed Jun 10, 2009 8:32 pm
Forum: C++ Development
Topic: wxTread: communication between the main and second thread
Replies: 6
Views: 1305

I might recommend using events for most communcations between threads, instead of sleeping. The reason why I use sleep is for performance only (avoiding sleep in the loop causes crash) and is not related to the communication with the thread. In my case I do it like this: 1) The Class with the funct...
by Marcus Frenkel
Wed Jun 10, 2009 4:51 pm
Forum: C++ Development
Topic: wxTread: communication between the main and second thread
Replies: 6
Views: 1305

wxTread: communication between the main and second thread

I need to make sure that this code is OK when I want to communicate in a direction from the main thread to the second thread. Sample class: class MyExampleClass : public ExampleClass { public: .. void TestTerminate(bool ToTerminate=false){ DoTerminate=ToTerminate; } protected: bool DoTerminate; }; /...
by Marcus Frenkel
Fri Mar 20, 2009 5:35 pm
Forum: C++ Development
Topic: Get Windows serial number
Replies: 6
Views: 1368

That's fine enough since I only need unique ID of the Windows installation. Thanks to all for the help.
by Marcus Frenkel
Fri Mar 20, 2009 5:12 pm
Forum: C++ Development
Topic: Get Windows serial number
Replies: 6
Views: 1368

Re: Get Windows serial number

chris_bern wrote:

Code: Select all

wxRegKey *key = new wxRegKey("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion");
Solution for MSW will be fine enough. Is the serial number always stored in that place of the registry regardless of the Microsoft Windows version?
by Marcus Frenkel
Wed Mar 18, 2009 10:40 pm
Forum: C++ Development
Topic: Get Windows serial number
Replies: 6
Views: 1368

Get Windows serial number

Hi,

Is there any wx function to get the registration serial number of the running MS Windows OS?

Marcus
by Marcus Frenkel
Mon Mar 09, 2009 8:33 pm
Forum: C++ Development
Topic: Best location to store passwords
Replies: 11
Views: 2163

..Adding the MAC adder into the encryption will not stay secret long. As soon as the first user changes their nic and things stop working, it will be figured out. -Max Yes, indeed. Maybe using some additional IDs in the encryption may increase the security. I'm thinking about wxGetOsDescription and...
by Marcus Frenkel
Mon Mar 09, 2009 5:34 pm
Forum: C++ Development
Topic: wxHTTP operation creating a new thread?
Replies: 7
Views: 1577

Unfortunately, using wxURL creates a second thread as well... :( In one of my apps I use wxThread to download files in a separate thread using wxURL. I'm not sure that wxURL and wxHTTP use separate threads if they are started from the main thread. You've mentioned that wxHTTP and wxURL create anoth...
by Marcus Frenkel
Mon Mar 09, 2009 1:34 am
Forum: C++ Development
Topic: Best location to store passwords
Replies: 11
Views: 2163

Thanks to all for the replies. As Max pointed out, the password is already encrypted so the encryption itself is not the issue. Hash is not needed since the password should be sent as plain text. I'm considering the following security treat: - Someone can just copy the config file containing the enc...