[python-win32] VB Com object problem
Gary Scorby
Gary.Scorby at harlandfs.com
Tue Mar 14 16:47:35 CET 2006
I have a visual basic com object I am trying to use, so far
unsuccessfully. I am happily VB ignorant but will do my best to
describe the problem.
>>> import win32com.client
>>> biff = win32com.client.Dispatch("OBName.Main")
>>> biff.LoggedIn
0
>>> biff.TelLogin("Login", "Password", -1, App)
The "TelLogin" method is where things blow up. I need to send the
following 4 required parameters-
1) Login ID
2) Password
3) A VB True, which they tell me is equivalent to -1
4) The VB App keyword which is suppose to identify the calling
application, in this case Python. This is where things blow up.
Below is a description from the vendor about the App keyword and how it
is used. Looks very VB specific to me. I have been all over the web
trying to find an equivalent of what to send in Python. I have had no
luck. What in the name of Python, if anything, can I use in the 4th
parameter? I have successfully used other VB com objects with Python,
but never with an App requirement.
Thanks for any assistance.
Gary Scorby
This is the description from the vendor-
-----------------
The App object is a VB keyword. What we use it for in BPUTIL is to
determine properties of the application that is sending the message.
Here is how we use it.
We define a global variable:
Public myApp As Object
(Object Data Type: Object variables are stored as 32-bit (4-byte)
addresses that refer to objects. Using the Set statement, a variable
declared as an Object can have any object reference assigned to it.)
In the TelLogin routine we set myApp to the App object parameter passed
to the routine:
Public Sub TelLogin(sUsr As String, sPW As String, GetIni As Integer,
oApp As Object, Optional sBank As String, Optional sSIP As String)
Set myApp = oApp
>From there on we can look at the 'App' properties such as:
myApp.EXEName
This property would tell us the executable name that BPUTIL is bound to.
Here is a link to the App property:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/ht
ml/vbobjApp.asp
-----------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060314/ef5fe5ea/attachment.htm
More information about the Python-win32
mailing list