473,763 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

porting vc++ project to python?

hi,

i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.

regards,

m

ps i guess, it's an option to transform my current code into one or more
python extensions/modules, and then calling them from a python core
module?
Aug 22 '07 #1
3 1275
i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.
You have a couple of options, but it really depends on the structure
of your program.

Option 1: You could encapsulate the important portions of your code in
DLLs and access them from python using the ctypes module.

Option 1b: You could encapsulate the important portions of your code
as COM DLLs and access them from win32com.

Option 2: You could turn your code into python extensions (DLL):
http://docs.python.org/ext/

Option 3: You could rewrite portions of your code in python and access
it from VC++: same as before - http://docs.python.org/ext/

It all depends on how your project is structured, and what you
consider to be the most difficult part to convert. If your app has a
complex user interface and that is the most difficult part to convert
then option 3 is probably best. If the code is well encapsulated and
the user interface will be easy to rewrite then options 1 or 2 will
work best. It is probably best to stay away from 1b unless portions of
your stuff already exist as COM DLLs. If you do have COM DLLs however,
accessing them from Python is very easy.

Matt
Aug 22 '07 #2
marco Starglider wrote:
hi,

i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.

regards,

m

ps i guess, it's an option to transform my current code into one or more
python extensions/modules, and then calling them from a python core
module?

Clients of mine have had very good results wrapping C++ functionality
with Boost (http://www.boost.org/libs/python/doc/). It might work for
you too.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------

Aug 23 '07 #3
marco Starglider schrieb:
hi,

i have a very large project in visual studio2005->visual c++ in windowsxp.
i'd like to port it, or my next project, over to python.
is this possible without rewriting all my code?
are there multiple options to do this?
my project is so large, that entirely rewriting it
is actually no option.

regards,

m

ps i guess, it's an option to transform my current code into one or more
python extensions/modules, and then calling them from a python core
module?
It is. I personally prefer SIP, which is a C++ wrapper generator used to
wrap the Qt toolkit. But there are other options as well, e.g. SWIG and
Boost::Python.

Diez
Aug 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3306
by: Wolfgang Keller | last post by:
Hello, as a non-developer I am currently participating in an industrial "research" project to develop a so-called "web application". This application serves at the same time as middleware to connect several other "conventional" enterprise-applications such as ERP, SCADA etc. and to provide a GUI frontend to the users. The developers are into Struts, Enterprise Java Beans and the like, so it will be entirely implemented in Java with all...
2
2196
by: kikotores | last post by:
I am going back home for the summer but I have this big project to submit for one of my classes. It is written in Visual C++ 7.0 . Hoever the only C++ compiler I have at home is the free Borland Command line compiler (bcc32). I tried compiling my project with it but I got a bunch of nasty messages such as vector include file not found and stuff like that. I change the include directive to <vector.h> , <map.h> and so on but it still did not...
1
1471
by: Robin Charisse | last post by:
Hi, I have a VC++6 project that uses msxml to parse XML documents. I have been asked to port this to a .NET project but from the research I've done so far it looks as though the only way to do this is to rewrite the project from scratch in C#. Time is at a premium and given that I have no prior experience of either C# or Visual Studio .NET, this is not an acceptable solution. Is there any other way of doing this without wholesale code...
0
3644
by: Scott Chang | last post by:
Hi all, I tried to use Managed C++ coding of VC++.NET (2002)and OpenGL version 1.2 to draw a hexagon shape of benzene. My OpenGLdrawBenzene.cpp is the following: // This is the main project file for VC++ application project // generated using an Application Wizard. #include "stdafx.h" #include <stdlib.h>
5
1512
by: Pardeep Singh | last post by:
Hi all, I am migrating modules from VC++6 to VC++7. All the dll and exe modules are compiled successfully, but the applications crashes at startup. Please guide me what are the proper steps to migrate VC++6 code to VC++7. Thanks & Regards, Pardeep Singh Sangha
1
2279
by: siva.isukapalli | last post by:
Hi, We are involved in a porting project (from VC++ 6.0 to .Net VC++ 7.1). ** NOT C# or VB..NET. We have a custom app wizard written in 6.0. This basically creates a project with a set of template based classes. We have to port it. But there is a significant change in the way custom app wizards are created in both the versions of vc++.
1
3723
by: hash | last post by:
Hello! While trying to port VC6 code to VC8, I stuck at this DLL problem. While compiling my project which is DLL, I am getting this error mfcs80d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj) I then explicitly added mfc80d.dll to the ignore list and it compiled successfully. But while executing, I get the error that MFC80D.DLL is missing as obvious. I am not getting where am I goin wrong....
2
3844
by: sandip desale | last post by:
Dear All, We have a Tcl/Tk application written using Python 2.2. Using this application we want to call some customizable Java APIs. I tried porting Tcl/Tk application to Jython but not able to do the same as TKinter library is not available with JYthon. Can you please help me in porting Tkinter application to Jython? Also kindly let me know how to do the same. Thanks & Regards, Sandip Desale
6
1387
by: =?Utf-8?B?RGlwZXNoX1NoYXJtYQ==?= | last post by:
Hi all, I am porting an code written in VC++ to VC.Net to make it manage. But in Managed VC we dont use "const" keyboard at all. but my code is using it very frequently, so is their any alternative to it or we have to remove the "const" keyword from our code completely. Please suggest me the solution. Secondly i am getting one error as:: error C4439: 'function_name' : function definition with a managed type in the signature must have a...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.