License Public Domain
Lines 25
Keywords
process launch (4) wxWidgets (7)
Permissions
Owner: Stou S.
Group Owner: iCapsid
Viewable by Everyone
Editable by All Siafoo Users
Hide
Siafoo – the intersection of pastebin, help desk, version control, and social networking Join Siafoo Now or Learn More

Launching a process from wxWidgets Atom Feed 0

In Brief This snippet is part of fe3d, it is used for launching the nmap sub-process.
# 's
 1bool launch(vector<wxString>* args)
2{
3 if(args == NULL)
4 {
5 cerr<<"Can't launch nmap with null arguments"<<endl;
6 return false;
7 }
8
9 for(unsigned int i = 0; i < args->size(); ++i)
10 {
11 wxString arg(args->at(i).c_str(), wxConvUTF8);
12 m_Cmd += arg + wxT(" ");
13 }
14
15 m_Cmd = m_Path + wxT(" ") + m_Cmd;
16
17 m_Process = new wxProcess(0);
18 m_Process->Redirect();
19
20 m_ErrorStream = m_Process->GetErrorStream();
21 m_OutputStream = m_Process->GetInputStream();
22
23 long proc_code = ::wxExecute(m_Cmd, wxEXEC_ASYNC, m_Process);
24
25 if(proc_code == 0)
26 return false;
27
28 return true;
29}

This snippet is part of fe3d, it is used for launching the nmap sub-process.