This discussion is archived
7 Replies Latest reply: Jan 27, 2011 6:58 AM by PhHein RSS

How can I work with WindowsAccessBridge.dll from VB6?

843807 Newbie
Currently Being Moderated
Hi,

I have one java application(e.g JAlbum). Whenever I start that application it promt to enter username and password.
Now what I want to do is?

I want to get that both text boxs values and set some values of that text boxes with my VB 6.0 code.

I have found that with help of WindowsAccessBridge.dll we can do something which I want. But they didn't provide any example source code in VB 6.0.

Can anybody help me that how can I get content of Java Application. How can I use WindowsAccessBridge.dll in my VB project. I can do it for windows application by using IAccesible. But I don't know that how can i do it for Java with WindowsAccessBridge.dll.

Please provide me some proper steps to work with WindowsAccessBridge.dll in VB 6.0.

Please help me as soon as possible. If possible please provide me some source code in vb 6 or links.

Thanks in advance.
  • 1. Re: How can I work with WindowsAccessBridge.dll from VB6?
    843807 Newbie
    Currently Being Moderated
    Hi Sanket Shah,

    We only provide the JavaFerret and JavaMonkey exmaples, and the .h and C/C++ libraries. To use this from Visual Basic, you will need to develop your own code to call the DLL entry points directly.


    Regards,

    Peter Korn
    Accessibility Principal,
    Oracle
  • 2. Re: How can I work with WindowsAccessBridge.dll from VB6?
    843807 Newbie
    Currently Being Moderated
    Hi Peter,
    Thanks for your reply.

    I have developed it using VB 6.0. Please check the below code.
    '' General Declaration
    
    Option Explicit
    
    Private Declare Function isJavaWindow Lib "WindowsAccessBridge" (Hwnd As Long) As Boolean
    Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
    Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function FindWindow _
                    Lib "user32.dll" _
                    Alias "FindWindowA" (ByVal lpClassName As String, _
                                         ByVal lpWindowName As String) As Long
                                         
    Private Sub Form_Load()
    
    Dim Var_g_HwndRec As Long
    Dim lb As Long
    Var_g_HwndRec = FindWindow(vbNullString, "CI for a proportion")
    lb = LoadLibrary("WindowsAccessBridge")
    MsgBox isJavaWindow(Var_g_HwndRec)
    
    End Sub
    At the time when I ran this program I got an runtime error "49', bad DLL calling convention.
    Can you please tell me that what could be the problem?
  • 3. Re: How can I work with WindowsAccessBridge.dll from VB6?
    843807 Newbie
    Currently Being Moderated
    Hi Sanket Shah,

    I'm sorry... it has been several decades since I wrote any BASIC code, and I've never used Microsoft Visual Basic. I have no idea what might be wrong with your code.


    Regards,

    Peter Korn
    Accessibility Principal,
    Oracle
  • 4. Re: How can I work with WindowsAccessBridge.dll from VB6?
    843807 Newbie
    Currently Being Moderated
    {color:#0000ff}Hi Peter,

    Please note that, if we execute the "Windoes_run" function (Which is void and no parameters ) from WindowsAccessbridge.dll then it works fine with no error.

    But if we try to execute "isJavaWindow(Java Window Handle)" the it gives error.

    Could you please let us know if anything else could be done to run the other functions which takes parameters.

    Even I tried running the Java Acess bridge code (2.0.1) with JDK 1.6.06 but unable to get the required output for Java monkey or Ferret code.

    Regards,
    Ashish{color}
  • 5. Re: How can I work with WindowsAccessBridge.dll from VB6?
    843807 Newbie
    Currently Being Moderated
    Ashish,

    Please review the programming documentation that is part of the Java Access Bridge for Windows. This is typically installed into file:///C:/Program%20Files/Java%20Access%20Bridge/doc/ (and specifically look at the file api.html). Also please look at the sample source code for the examples - e.g. JavaFerret - which is typically installed into file:///C:/Program%20Files/Java%20Access%20Bridge/src.zip/bridge/src - e.g. file:///C:/Program%20Files/Java%20Access%20Bridge/src.zip/bridge/src/JavaFerret.cpp

    With these, you should note that before you can use the Java Access Bridge, you need to call initializeAccessBridge() (and when you are finished, call shutdownAccessBridge()).

    We do not provide general programming support for the bridge - and most especially not for languages like VisualBasic (for which this wasn't designed). Specifically, I cannot help you "run the other functions which takes parameters". You need to figure that out on your own. And I suggest starting with a thorough study of the JavaFerret source code. If you can replicate some portion of that code in a working VisualBasic application, then you will likely be well on your way toward success.

    Good luck,

    Peter Korn
    Accessibility Principal,
    Oracle
  • 6. Re: How can I work with WindowsAccessBridge.dll from VB6?
    834763 Newbie
    Currently Being Moderated
    Hi Peter,

    Thanks for the prompt reply, basically I want to get the native java window (Like Java Monkey Application and Java Ferret Application) using java only, for that I tried different ways/options but unable to get the native java window and perform actions on that.

    It would be really great if you could guide me for that. I am still unable to start the Java Access Bridge.

    Please let me know the steps to get native java window using Java Access bridge and JDK 1.6.20.

    Also Note that, As per your previous suggestion, I tried to search and call initializeAccessBridge() (and when you are finished, call shutdownAccessBridge()), But unable to succeed it. I di not find such method in Accessbridge.jar.

    Please help me out.


    Best Regards

    Edited by: user13837581 on Jan 27, 2011 6:50 AM
  • 7. Re: How can I work with WindowsAccessBridge.dll from VB6?
    PhHein Guru Moderator
    Currently Being Moderated
    Welcome to the forum. Please don't post in threads that are long dead and don't hijack other threads. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.

    I'm locking this thread now.