473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to use python com server in c++?

dear all,
i have a python com server like this:

import win32com.server.register

class HelloWorld:
_reg_clsid_ = "{B0EB5AAB-0465-4D54-9CF9-04ADF7F73E4E}"
_reg_desc_ = 'Python test com server'
_reg_progid_ = "Leojay.ComServer"
_public_methods_ = ['Add', 'Mul']

def Add(self, a, b):
return a+b
def Mul(self, a, b):
return a*b
if __name__ == '__main__':
win32com.server.register.UseCommandLine(HelloWorld )
after registering the com server, i can use it in visual basic .net:
Dim a As Integer = 5
Dim b As Integer = 8
Dim h As Object = CreateObject("Leojay.ComServer")
MsgBox(h.Add(a, b).ToString() + " " + h.Mul(a, b).ToString())

but i don't know how to use it in visual c++.

who has any idea about using this com server in viusal c++?
a detailed sample of early binding would be better, thanks.

--
Best Regards,
Leo Jay
Aug 19 '06 #1
1 1555
Leo Jay wrote:
dear all,
i have a python com server like this:

import win32com.server.register

class HelloWorld:
_reg_clsid_ = "{B0EB5AAB-0465-4D54-9CF9-04ADF7F73E4E}"
_reg_desc_ = 'Python test com server'
_reg_progid_ = "Leojay.ComServer"
_public_methods_ = ['Add', 'Mul']

def Add(self, a, b):
return a+b
def Mul(self, a, b):
return a*b
if __name__ == '__main__':
win32com.server.register.UseCommandLine(HelloWorld )
after registering the com server, i can use it in visual basic .net:
Dim a As Integer = 5
Dim b As Integer = 8
Dim h As Object = CreateObject("Leojay.ComServer")
MsgBox(h.Add(a, b).ToString() + " " + h.Mul(a, b).ToString())

but i don't know how to use it in visual c++.

who has any idea about using this com server in viusal c++?
a detailed sample of early binding would be better, thanks.
too complicated for my brain. Waiting for a good answer.
Aug 19 '06 #2

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

Similar topics

2
by: DeepBleu | last post by:
When one is using an HTML form via a web broswer, the user submits the form contents and these are passed to a CGI Python script on the web server. I need to write a client script that connects to...
0
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To:...
15
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility,...
0
by: GeicoGecko | last post by:
Hey guys, There was no python section in the "Web Development" forum so I'm hoping I can pose my question in here. Our system We currently have a python webserver using SimpleHTTPServer,...
1
by: PALLAVI SHARMA | last post by:
Sir, i have configure the ms access file on webserver. MS. Access file is showing in .../db/mohan.mdb on web server. could you tell me what path should in write in my language to update the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.