Search found 85 matches

by rafae11
Wed Nov 06, 2013 4:30 pm
Forum: C++ Development
Topic: Inter-Thread Communication.
Replies: 2
Views: 1227

Inter-Thread Communication.

I have three threads a main thread and two worker threads. Worker thread one just polls and processes serial comms data after its done processing it sends information back to the main thread. the 2nd worker thread just runs a simple finite state machine how do i pass the information to the worker th...
by rafae11
Mon Jun 17, 2013 10:55 am
Forum: C++ Development
Topic: concurrent threads.
Replies: 3
Views: 1027

concurrent threads.

I have 4 threads and i need to make sure they all trigger at exactly 5ms. How do i make sure that all of my threads fire at the same time? wxString cpdata1, cpdata2, cpdata3, cpdata4; cpdata1 << "\\\\.\\" << combo_x->GetStringSelection(); cpdata2 << "\\\\.\\" << combo_y->GetStringSelection(); cpdata...
by rafae11
Wed May 29, 2013 9:06 pm
Forum: C++ Development
Topic: How to change text of Combobox when item is selected in it?
Replies: 1
Views: 1233

Re: How to change text of Combobox when item is selected in

I have been using this code for my combo box. hope it helps you. void comportOnCombobox( wxCommandEvent& event ) { // get current selection wxString temp = comport->GetString(comport->GetSelection()); // i have a temporary variable elsewhere wxString save.clear(); // clear combobox comport->Clear();...
by rafae11
Wed May 29, 2013 11:53 am
Forum: C++ Development
Topic: simulate left mouse click
Replies: 1
Views: 993

simulate left mouse click

i have a button that i click that calls another button.
I want to simulate a left mouse click in order to run that funciton.
how do i do this?

Thanks

Code: Select all

Run_CalibrationOnButtonClick( wxCommandEvent& event )
{
      relinquishOnButtonClick(EVT_LEFT_DOWN(sim.MouseClick(wxMOUSE_BTN_LEFT)));
}
by rafae11
Mon Apr 29, 2013 3:32 pm
Forum: C++ Development
Topic: call a function after thread finishes executing.
Replies: 2
Views: 957

Re: call a function after thread finishes executing.

wxThread::ExitCode Thread::Entry() { //generate report and print if(input_report()) { wxCustomEvent f, err; f.SetEventType(wxCUSTOM_EVENT_PRINTREPORT); ::wxPostEvent(m_parent, f); } return 0; } Thanks i tried to use wxPostEvent and it works. BEGIN_EVENT_TABLE(mainframe, wxFrame) EVT_CUSTOM_EVENT(wx...
by rafae11
Tue Apr 23, 2013 3:45 pm
Forum: C++ Development
Topic: call a function after thread finishes executing.
Replies: 2
Views: 957

call a function after thread finishes executing.

I wish to call the print function immediately after the deployonbuttonclick has finished processing. void wxfbIntegrationFrame::DeployOnButtonClick( wxCommandEvent& event ) { //Deploy->Enable(false); //print_report->Enable(true); wxString BSC = BSCSNtxt->GetValue(); wxString PSN = PSSNtxt->GetValue(...
by rafae11
Wed Mar 27, 2013 12:29 pm
Forum: C++ Development
Topic: displaying binary data on screen
Replies: 4
Views: 1106

Re: displaying binary data on screen

ok thx.
by rafae11
Wed Mar 27, 2013 10:45 am
Forum: C++ Development
Topic: displaying binary data on screen
Replies: 4
Views: 1106

Re: displaying binary data on screen

i get different output when i try to display on a wxmessagebox. i only get the first 3 chracters. and it stops.
by rafae11
Wed Mar 27, 2013 9:55 am
Forum: C++ Development
Topic: displaying binary data on screen
Replies: 4
Views: 1106

displaying binary data on screen

// reading a complete binary file #include <iostream> #include <fstream> using namespace std; using namespace std; ifstream::pos_type size; char * memblock; int main () { ifstream file ("c:\\temp\\1015.bin", ios::in|ios::binary|ios::ate); if (file.is_open()) { size = file.tellg(); memblock = new ch...
by rafae11
Tue Mar 26, 2013 9:58 am
Forum: C++ Development
Topic: switching between multiple frames
Replies: 4
Views: 2146

Re: switching between multiple frames

could you please show me an example please it would be of great help.

i need seven instances of different frames.
i don't need to delete them just hide them if not needed.
and can call each other depending on the button pressed.
by rafae11
Mon Mar 25, 2013 9:33 am
Forum: C++ Development
Topic: switching between multiple frames
Replies: 4
Views: 2146

Re: switching between multiple frames

how do i pass the instance of frame to my other frame classes?

void otherframes::Done( wxCommandEvent& event )
{
frame->Show(true);
this->Destroy();
}

i get an error says undeclared identifier frame.
by rafae11
Fri Mar 22, 2013 4:07 pm
Forum: C++ Development
Topic: switching between multiple frames
Replies: 4
Views: 2146

switching between multiple frames

Hi, I have a program with a main frame with 4 buttons create , read , write , update. when i click on create. a new frame is created with one button called done. The main frame becomes hidden. I wish to restore the main frame when i press on done and close the created frame. here is my code so far. ...
by rafae11
Thu Jan 10, 2013 11:10 am
Forum: C++ Development
Topic: wxfile to write in binary mode.
Replies: 2
Views: 1033

Re: wxfile to write in binary mode.

you are correct. :)
it is by default in binary mode.
by rafae11
Wed Jan 09, 2013 2:17 pm
Forum: C++ Development
Topic: wxfile to write in binary mode.
Replies: 2
Views: 1033

wxfile to write in binary mode.

can i write in binary mode using wxfile?

something similiar to the code below.

Code: Select all

  
  ofstream myFile ("data.bin", ios::out | ios::binary);
by rafae11
Fri Dec 21, 2012 11:33 am
Forum: C++ Development
Topic: wxtextfile append data
Replies: 3
Views: 1127

Re: wxtextfile append data

#ifndef DTHREAD_H #define DTHREAD_H #include "readbin.h" #include "calibration.h" #include "wx/wx.h" #include <vector> #include <wx/textfile.h> using namespace std; // a thread class that will periodically send events to the GUI thread class DThread : public wxThread { wxFrame* m_parent; wxString m...