Announcement

Collapse
No announcement yet.

PowerBasic OCX Support.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PowerBasic OCX Support.

    Hello again,
    In Visual Basic 6.0 I'm including an OCX file by the name "LOWUSB.OCX" in the components and I execute the following code in a Sub / Function. USB9A is the name of the control that I place on the form
    Code:
    Dim IsOk as Integer
    USB9A.USB9AClose
    IsOk=USB9A.USB9AOpen("abcd")
    
    If IsOk=True Then
    
          If USB9A.USB9AMEM="1234" Then
                 MsgBox "Ok"
          Else
                 MsgBox "No"
          End If
    
    Else
          MsgBox "No"
    
    End If
    USB9A.USB9AClose


    Now My Question is how do I write the code for the same in PowerBasic. How do I include the OCX to PB??? I'm using PB 8.0. Please provide me with some example code. I started learning PB and I'm trying to implement something as I do in VB

    Thanks for your time.
    Last edited by Gary Beene; 26 Jul 2014, 12:29 AM. Reason: Code: tags

  • #2
    Please see the responses to your other thread:
    VB to Power BASIC Conversion

    In addition, for PBWin8 and 9 you may have to access such controls with ATL. There are several examples in the forum, try searching on ATL71. You will still need to have an include file that uses conventional Declare statements.

    If you can post the OCX code, you will likely get more direct advice, and perhaps some actual code to use and study.
    Rick Angell

    Comment


    • #3
      Dear Richard

      Thank you for your reply, but I dont have the source for OCX, it's a third party tool that I use with my VB Application.

      Thanks

      Comment


      • #4
        What is the name of the vendor and the tool?
        Rick Angell

        Comment


        • #5
          Arun,
          I think I get where you are leading, but just in case, do you mean like my trying to figure out a well known "Word.Application" idea vs a "My Unknown.Known to this system" idea???

          By that, I mean, the usual office programs (all well known) work, but trying to get the basics of something either you or I write (unknown), or a 3rd party...and finding problems getting it to work???


          Short answer is, "Not sure" but I am working on it, the long answer...keep checking the forums
          Engineer's Motto: If it aint broke take it apart and fix it

          "If at 1st you don't succeed... call it version 1.0"

          "Half of Programming is coding"....."The other 90% is DEBUGGING"

          "Document my code????" .... "WHYYY??? do you think they call it CODE? "

          Comment


          • #6
            Cliff

            Thank you very much for working on something for me. To let you know in detail.... I have an application developed in PB 6.0, but a developer a few years ago but now I don't have him with me. The application is related to something like drawing lines and curves ( bezier ) etc. In short a small CAD like application. The application works perfectly under windows 98. But when I run the same application I have two problems

            1. In 98 I can select the curve / lines / object by moving the mouse over the objects... But in XP I can select lines and all other things except the Curve....!!. I really dont know what would be the real problem. I know about the win32API.INC changes but until now I'm unable to figure out why and how since I just started learning PB.

            2. I have a hardware lock associated with the program that uses some DLLs that work perfectly in 98. But for windows XP the vendor had given me an OCX and some VB examples. NO DLL'S !!!!!!. This is what I'm trying to do. I dont believe that the OCX is available for download anywhere.

            When I open up the source in PB 8.0, I get lots and lots and lots of errors. I'm really struck for a long time. Will it be possible for you to identify why the curve is not getting selected??? I can send you a few modules if you can help me out.

            Thanks for your time.

            Comment


            • #7
              Is the VB code available?

              And does the vendor have a page describing the OCX? If so could you post the URL.

              There are some changes between 6.x and 8.x, one of the largest is that pointers must be passed BYVAL. This may account for many of the errors in trying to update your old code to work without getting to the OCX. But for the OCX folks will need to see the VB code at a minimum and also learn something about the OCX that the vendor publishes.

              You might also want to download Jose Roca's latest Type Library Browser at http://www.jose.it-berater.org and use it to examine the OCX.
              Rick Angell

              Comment


              • #8
                As Rick says - use the PB COM browser (PBBROW.EXE) or Jose' utility to generate an include (INC) file for the ActiveX library, then you #include this file with your PB code to call the object. The COM object browser is PB's equivalent to VB's "references" dialog, but VB handles it differently.

                You should be fine using the library as LOWUSB.OCX doesn't sound like a control library. Generally there are two types - standard and control. The control type is a lot more complex to implement and manage using PB.
                kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                Comment


                • #9
                  Jose's TLB may work best for OCX's as long as you have to work with PBWin 8. When you get PBWin 9 then either the PB COM Browser or TLB will normally read the OCX's .tlb to produce an include.
                  Rick Angell

                  Comment

                  Working...
                  X