What exactly is App?
I have a friend who is trying to access a VB com server through an exposed sub.
He has not used VB before, and is trying to launch & login to the app using a scripting language called Python (which is waaaaaaaaayyyyy cool).
the sub prototype in VB that he is calling looks like this
foo("LoginID" as string, "Password" as string, VBTrue as integer, APP as object)
He was given this API from his customer who wrote the VB code, and he's wondering what to pass for App, from the Python side.
Is App just a pointer to the application itself ?
Any suggestions ?
I think the interface function needs to be changed so he does not have to pass the App object.
[716 byte] By [
cappy2112] at [2007-11-19 19:44:37]

# 1 Re: What exactly is App?
Is there any description as to how the sub returns data to the app..
It could be that it's looking for a Object in the application to return data to..
Just a shot in the dark but try either ME or Text1 as the object its looking for...
# 2 Re: What exactly is App?
Is there any description as to how the sub returns data to the app..
It could be that it's looking for a Object in the application to return data to..
Just a shot in the dark but try either ME or Text1 as the object its looking for...
Subs don't return anything.
He hasn't seen the sub implementation, only the declaration.
However, the person who gave him that interface should know that App is VB specific, and can't be passed from a non VB app, unless APP is really just a function pointer, in which case that argument should be a long, not an object.
# 3 Re: What exactly is App?
Subs don't return anything.
He hasn't seen the sub implementation, only the declaration.
However, the person who gave him that interface should know that App is VB specific, and can't be passed from a non VB app, unless APP is really just a function pointer, in which case that argument should be a long, not an object.
Sorry.. but I beg to differ... A Byref defined variable will allow a sub to return data..
But your right, It could just be a misstype...
Gremmy
# 4 Re: What exactly is App?
Sorry.. but I beg to differ... A Byref defined variable will allow a sub to return data..
But your right, It could just be a misstype...
Gremmy
Also - the sub isn't being called from VB- it's called from Python, so there is no ME or text1 outside of VBland.
He doesn't have the implemention of foo() just the declaration
# 5 Re: What exactly is App?
As for your question, internally to VB6, App is a predefined object that can return information regarding the application itself, such as the version numbers, the path where it is running from, the exe name, and whether or not it is already running (though poorly).
As for that declaration, it's asking for an Object. An object can be almost anything.
Unless your friend can figure out what the customer is trying to do with the object, there is no way to suggest what to pass (if anything can even be passed), and that is something that your friend will have to take up with the customer.
From my perspective, the customer must have a specific object in mind to receive that they're taking an object as a parameter, though by making it late bound they're expecting the possibility for earlier and later versions to be passed.
Since I don't know Python, I don't know if your friend could create an object reference or even pass it, if he can even learn what the object he would have to pass would be.
# 6 Re: What exactly is App?
Also - the sub isn't being called from VB- it's called from Python, so there is no ME or text1 outside of VBland.
He doesn't have the implemention of foo() just the declaration
Sorry.. I assumed you were trying to call this sub from VB..the sub prototype in VB that he is calling looks like this
foo("LoginID" as string, "Password" as string, VBTrue as integer, APP as object)
Gremmy..
# 7 Re: What exactly is App?
As for your question, internally to VB6, App is a predefined object that can return information regarding the application itself, such as the version numbers, the path where it is running from, the exe name, and whether or not it is already running (though poorly).
As for that declaration, it's asking for an Object. An object can be almost anything.
Unless your friend can figure out what the customer is trying to do with the object, there is no way to suggest what to pass (if anything can even be passed), and that is something that your friend will have to take up with the customer.
From my perspective, the customer must have a specific object in mind to receive that they're taking an object as a parameter, though by making it late bound they're expecting the possibility for earlier and later versions to be passed.
Since I don't know Python, I don't know if your friend could create an object reference or even pass it, if he can even learn what the object he would have to pass would be.
>>As for that declaration, it's asking for an Object. An object can be almost >>anything.
I forgot to mention the customer told him that the Object is expected to be
App- so this function must have been called by a VB app at some point.
So I don't know of any way to pass the equivalent of App from outside of VB, from any language.
# 8 Re: What exactly is App?
My best guess for what he could try, though, would be to create a class in Python that resembles App in VB and pass that (if he can). Unless your friend knows what will try to be used by the customer, he may need to simulate all the properties and the methods, just to be safe.
I did find this Visual Basic to Python (http://vb2py.sourceforge.net/index.html) converter that I would have used to see what they would convert App to, but in order to use it, I have to have a Python interpreter. But since the project is in such an early version, I don't really expect much.