Fails to convert process name to wxString

Eran Ifrah eran.ifrah at gmail.com
Fri Nov 2 15:46:34 PDT 2007


>> OS X is a Unix so if you don't use Linux-specific tricks (/proc?) but
just
I thought of using popen & ps command on Linux
Eran


On 11/3/07, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
>
> On Fri, 2 Nov 2007 23:29:49 +0200 Eran Ifrah <eran.ifrah at gmail.com> wrote:
>
> EI> First let me open with the fact that I managed to find the bug and fix
> it.
>
> Uff.
>
> EI> If all is Unicode (wx & my code) then the only function which I did
> not
> EI> check was the WinAPI function, and there lied the problem, let me
> explain:
> EI> In my code I loaded the functions by using LoadLibrary(), this code
> was
> EI> taken from a legacy code, reading this code, reveals a sad fact:  it
> used
> EI> LoadLibraryA !
>
> Yes, it looked like this but I couldn't believe this was what happening as
> I didn't even know you could link together object files compiled with
> _UNICODE and without. But in fact this is possible, of course, I should
> have asked you to check this before...
>
> EI> Btw, I would like to contribute 2 function to wxWidgets, something
> like:
> EI> wxGetProcessList() - which returns an array of pairs of image name &
> process
> EI> ID (I can implement and test it on Linux/Windows) AND
> EI> wxGetProcessName(long pid) - which returns the process name by its PID
> EI> (returns the full path of the executable which created the process
> where
> EI> possible, unlike the former function which only return it name & ID)
>
> Such functions should rather be (static) members of wxProcess I think.
> Also, I don't really know what would the function returning the process
> list be useful for (what can you do with just the name and the PID?) but a
> function to find PID by name could be useful. Anyhow, please post
> proposals
> for your API to wx-dev before implementing it, this could result in some
> improvements/enhancements. TIA!
>
> EI> I dont know if they will be accepted, since I don't have an access to
> Mac
> EI> machine (so I cant really implement it for Mac), or maybe they are not
> as
> EI> useful as I think they are, let me know what do you think.
>
> OS X is a Unix so if you don't use Linux-specific tricks (/proc?) but just
> parse the ps output there should be no problem with making it work there
> too.
>
> Regards,
> VZ
>
> --
> TT-Solutions: wxWidgets consultancy and technical support
>                http://www.tt-solutions.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>


-- =

Eran Ifrah
eran.ifrah at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20071103/36f=
28976/attachment.htm


More information about the wx-users mailing list