embedding phoenix in C++

Good day.

I’m working on embedding python3 in a C++ application that uses
wxWidgets. I was able to build Phoenix, call a python script from C++
have the script open a frame (which is awesome). My problem is passing
wxWidgets objects back and forth.

wxPython has a sample that uses wxPyMake_wxObject(), but I can’t seem to
find anything equivalent in Phoenix. Is there anything set up right now
for this that I can use? If not, how high is this on the list of
priorities?

Thanks

···


Jonathan McDougall

Jonathan McDougall wrote:

Good day.

I'm working on embedding python3 in a C++ application that uses
wxWidgets. I was able to build Phoenix, call a python script from C++
have the script open a frame (which is awesome). My problem is passing
wxWidgets objects back and forth.

wxPython has a sample that uses wxPyMake_wxObject(), but I can't seem to
find anything equivalent in Phoenix. Is there anything set up right now
for this that I can use? If not, how high is this on the list of
priorities?

There hasn't been a lot of thought yet about embedding but take a look at the src/wxpy_api.h file. It should have at least some of the functions and macros that you would need to do it.

···

--
Robin Dunn
Software Craftsman

Hello, according to your description, you succeed to embed wxPython in C++. But I fail to complete it. In my program, when wxPyMake_wxObjec() function is called, an exception occur, the related message is: Unhandled exception in 0x00ea7a35 in TestWxWidget2.exe: 0xC0000005: Access violation reading location 0x00000000.
I do not know why. My tools are Visual Studio 2010, Python2.7 and wxPython2.8.11. I hope you can help me to solve the problem. My email is hurricanecqj.chen@gmail.com. I hope you can help me by mail. Thank you very much!!!

You’re replying to a 3 year old thread. I haven’t touched wxWidgets at
all since then. May I suggest you start a new thread with your question?

···

On Monday, May 23, 2016 at 11:47:46 AM UTC-4, hurrican...@gmail.com wrote:

Hello, according to your description, you succeed to embed wxPython in C++.


Jonathan McDougall

Hello, according to your description, you succeed to embed wxPython in
C++. But I fail to complete it. In my program, when *wxPyMake_wxObjec() *function
is called, an exception occur, the related message is: Unhandled exception
in 0x00ea7a35 in TestWxWidget2.exe: 0xC0000005: Access violation reading
location 0x00000000.
    I do not know why. My tools are Visual Studio 2010, Python2.7 and
wxPython2.8.11. I hope you can help me to solve the problem.

I don't know if it has anything to do with your problem (but it might) --
Unless you are re-compiling Python, then you want to use VisualStudio 2008
, or, even better the "MS compiler for Python2.7 -- which is a slightly
differently packaged VS 2008):

https://www.microsoft.com/en-us/download/details.aspx?id=44266

Also -- if you possible can, I would recommend calling C++ from Python,
rather than Python from C++ -- it's pretty similar really, but if your
"host" application is Python, you don't have to make sure you've
initialized python correctly.

-CHB

···

On Mon, May 23, 2016 at 2:55 AM, <hurricanecqj.chen@gmail.com> wrote:

My email is hurricanecqj.chen@gmail.com. I hope you can help me by mail.
Thank you very much!!!

--
You received this message because you are subscribed to the Google Groups
"wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I am glad to know your suggestion. Can you tell me your suggestion? Thank you very much!!!

···

2016-05-23 23:55 GMT+08:00 Jonathan McDougall jonathanmcdougall@gmail.com:

On Monday, May 23, 2016 at 11:47:46 AM UTC-4, hurrican...@gmail.com wrote:

Hello, according to your description, you succeed to embed wxPython in C++.

You’re replying to a 3 year old thread. I haven’t touched wxWidgets at
all since then. May I suggest you start a new thread with your question?


Jonathan McDougall

You received this message because you are subscribed to a topic in the Google Groups “wxPython-dev” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxPython-dev/sbMDm0Ggv6w/unsubscribe.

To unsubscribe from this group and all its topics, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I have downloaded and installed Microsoft Visual C++ Compiler for Python 2.7, but I do not know use it. Ca n you tell me ite uasge? Thank you very much!!!

···

2016-05-24 3:43 GMT+08:00 Chris Barker chris.barker@noaa.gov:

You received this message because you are subscribed to a topic in the Google Groups “wxPython-dev” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxPython-dev/sbMDm0Ggv6w/unsubscribe.

To unsubscribe from this group and all its topics, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

On Mon, May 23, 2016 at 2:55 AM, hurricanecqj.chen@gmail.com wrote:

Hello, according to your description, you succeed to embed wxPython in C++. But I fail to complete it. In my program, when wxPyMake_wxObjec() function is called, an exception occur, the related message is: Unhandled exception in 0x00ea7a35 in TestWxWidget2.exe: 0xC0000005: Access violation reading location 0x00000000.
I do not know why. My tools are Visual Studio 2010, Python2.7 and wxPython2.8.11. I hope you can help me to solve the problem.

I don’t know if it has anything to do with your problem (but it might) – Unless you are re-compiling Python, then you want to use VisualStudio 2008 , or, even better the "MS compiler for Python2.7 – which is a slightly differently packaged VS 2008):

https://www.microsoft.com/en-us/download/details.aspx?id=44266

Also – if you possible can, I would recommend calling C++ from Python, rather than Python from C++ – it’s pretty similar really, but if your “host” application is Python, you don’t have to make sure you’ve initialized python correctly.

-CHB

My email is hurricanecqj.chen@gmail.com. I hope you can help me by mail. Thank you very much!!!

You received this message because you are subscribed to the Google Groups “wxPython-dev” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov