CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2003
    Posts
    322

    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.
    Last edited by cappy2112; March 16th, 2006 at 04:56 PM.

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    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...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Apr 2003
    Posts
    322

    Re: What exactly is App?

    Quote Originally Posted by GremlinSA
    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.

  4. #4
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: What exactly is App?

    Quote Originally Posted by cappy2112
    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
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #5
    Join Date
    Apr 2003
    Posts
    322

    Re: What exactly is App?

    Quote Originally Posted by GremlinSA
    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

  6. #6
    Join Date
    Nov 2005
    Location
    Omaha, Nebraska, USA
    Posts
    696

    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.

  7. #7
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: What exactly is App?

    Quote Originally Posted by cappy2112
    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..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  8. #8
    Join Date
    Apr 2003
    Posts
    322

    Re: What exactly is App?

    Quote Originally Posted by ChaosTheEternal
    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.

  9. #9
    Join Date
    Nov 2005
    Location
    Omaha, Nebraska, USA
    Posts
    696

    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 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured