Announcement

Collapse
No announcement yet.

Asking for some direction please

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

    Asking for some direction please

    Every step in this process leads me into another large realm of my own ignorance. I would like to publicly apologize to Dominic Mitchell for my recent negative comments.

    I'm working on translating the Code Module and as you probably already know, there are Objects all over VB6 (duh). The files I've been able to find do not have TypeLibs, so I need to ask two questions.

    Can anyone direct me to a source for the standard VB6 component files? Or would anyone be willing to post the TypeLibs from those files?

    Has anyone already figured out a way to use the PB COM browser or maybe Jose Roca's TypeLib programatically?

    I promise more humility from now on. Thank you.
    Do not go quiet into that good night,
    ... Rage, rage against the dark.

    #2
    Can anyone direct me to a source for the standard VB6 component files? Or would anyone be willing to post the TypeLibs from those files?
    Several weeks ago I exported the type libraries from several of VB6's runtimes and I didn't find anything in them that seemed to be remotely usable or useful. What I was hoping to find but didn't was some programatic access to a way of instantiating such things as VB Forms and its standard controls like text boxes, labels, buttons, etc. What I found instead were various equates and conversion routines. Like I said, nothing immediately useful - at least to me. But perhaps I missed something. If I did, I'd appreciate knowing about it too, as it would provide a whole new approach to converting VB6 code. In other words, what I'm saying, is that instead of using DDT Create Dialog ... or SDK CreateWindow() to create UI elements, just use VB's exported COM interfaces to do this. It would be elegant if it were possible to do that. But like I said, I have not as yet found a way. So assumming its not possible, all that leaves one is doing what you are doing now Stan - or like I did several years back.


    Has anyone already figured out a way to use the PB COM browser or maybe Jose Roca's TypeLib programatically?
    Jose posted the code to his TypeLib Browser about two years ago. So its around. The code to the PowerBASIC COM Browser I'm sure is proprieatary. I'm sure it would be possible to simply extract the required code from Jose's Type Lib Browser to generate the COM interfaces based on a Program ID which your code converter already knew. For example, in the example I just posted last week using the ADO Data Control and the MSDatGrd.ocx components, the *.vbp file would look like so, and you can see it contains the GUIDs of the two COM components...

    Code:
    Type=Exe
    Form=Form1.frm
    Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\Windows\SysWOW64\stdole2.tlb#OLE Automation
    Object={67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0; MSADODC.OCX
    Reference=*\G{00000205-0000-0010-8000-00AA006D2EA4}#2.5#0#..\..\..\..\Program Files (x86)\Common Files\System\ado\msado25.tlb#Microsoft ActiveX Data Objects 2.5 Library
    Object={CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0; MSDATGRD.OCX
    Reference=*\G{56BF9020-7A2F-11D0-9482-00A0C91110ED}#1.0#0#..\..\..\..\Windows\SysWow64\MSBIND.DLL#Microsoft Data Binding Collection VB 6.0 (SP4)
    IconForm="frmDataGrid1"
    Startup="frmDataGrid1"
    ExeName32="DataGrid.exe"
    Command32=""
    Name="prjDataGrid1"
    HelpContextID="0"
    CompatibleMode="0"
    MajorVer=1
    MinorVer=0
    RevisionVer=0
    AutoIncrementVer=0
    ServerSupportFiles=0
    VersionCompanyName="Appalachian Forestry Software"
    CompilationType=0
    OptimizationType=0
    FavorPentiumPro(tm)=0
    CodeViewDebugInfo=0
    NoAliasing=0
    BoundsCheck=0
    OverflowCheck=0
    FlPointCheck=0
    FDIVCheck=0
    UnroundedFP=0
    StartMode=0
    Unattended=0
    Retained=0
    ThreadPerObject=0
    MaxNumberOfThreads=1
    About ten years ago I bought Paul Squires 'FireFly' Visual Designer product, and I believe he used Jose's code to generate the Type Library interfaces for the ActiveX Controls a user added to a project.

    You would need to clear doing this with Jose I think.

    If I were attempting to do what you are attempting Stan, what I would do would be have a form where the user specified the Visual Basic project directory where all the *.frm, *.vbp, *.vpw, *.bas files are located, and then the program would analyze what it found there, and report to the user what it found. If it found from the *.vbp file that ActiveX COM Components were used anywhere in the project, then it would have to direct the user to manually generate those includes from either PowerBASIC's or Jose's Type Lib Browser. I realize this is an unfortunate hack, but I don't see a practical alternative, given the resources available.
    Fred
    "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

    Comment


      #3
      Realize too that almost all of the Visual Basic controls that display data such as text boxes, combo boxes, listboxes, etc., have a 'DataSource' property. What gets set into that property is a recordset from an underlying data source such as an Access database, SQL Server Database, etc. Any code converted would need to populate the control with data from that source. In Visual Basic it didn't take much code to do it, or even none at all if you followed my posts, but it will take a good bit of PowerBASIC code to do it. And so we're talking ADO, ODBC, or whatever.
      Fred
      "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

      Comment


        #4
        Originally posted by Fred Harris View Post
        Several weeks ago I exported the type libraries from several of VB6's runtimes and I didn't find anything in them that seemed to be remotely usable or useful....
        Yeah, that was my impression several years ago. I'm working on something a little different, but it's not concrete in my own mind yet. My own copy of VB6 has gone the way of old floppies so I don't have the same access to it that I used to have. Would you be willing to email me copies of those libraries? My method is simple, but time consuming. I stare at the problem until it answers itself.

        I'm sure it would be possible to simply extract the required code from Jose's Type Lib Browser to generate the COM interfaces based on a Program ID which your code converter already knew. For example, in the example I just posted last week using the ADO Data Control and the MSDatGrd.ocx components, the *.vbp file would look like so, and you can see it contains the GUIDs of the two COM components...
        Should be possible, but it doesn't feel like the answer I want.

        You would need to clear doing this with Jose I think.
        Certainly.

        If I were attempting to do what you are attempting ... have a form where the user specified the Visual Basic project directory where all the *.frm, *.vbp, *.vpw, *.bas files are located ...
        Good idea.

        ... ActiveX COM Components were used anywhere in the project, then it would have to direct the user to manually generate those includes ... an unfortunate hack, but I don't see a practical alternative ...
        Neither do I, Fred. I'm staring at my spreadsheet and it keeps telling me I need those libraries.

        Originally posted by Fred Harris View Post
        Realize too that almost all of the Visual Basic controls that display data such as text boxes, combo boxes, listboxes, etc., have a 'DataSource' property.... a recordset from an underlying data source ...
        That is a problem. I managed to build a very large spreadsheet describing the most common properties. I think I can reconstruct most of the common functionality without using the VB6 GUIDs, but there's the information I asked for -- have a strong intuition that what's missing in my spreadsheet data is in those type libraries.

        And if worse comes to worst, I'll just throw in an ODBC interface like you suggest.... like anything about this is a easy as it looked before getting started.

        (Repeating myself -- I'm serious when i ask if you would be willing to email those libraries. The TypeLibs, not the actual MS files.)
        Last edited by StanHelton; 1 Oct 2014, 01:25 PM. Reason: Clarify
        Do not go quiet into that good night,
        ... Rage, rage against the dark.

        Comment


          #5
          (Repeating myself -- I'm serious when i ask if you would be willing to email those libraries. The TypeLibs, not the actual MS files.)
          The type libraries are included in the OCXs as a resource. They are not separate files.
          Forum: http://www.jose.it-berater.org/smfforum/index.php

          Comment


            #6
            ... have a 'DataSource' property. What gets set into that property is a recordset from an underlying data source such as an Access database, SQL Server Database, etc. Any code converted would need to populate the control with data from that source. In Visual Basic it didn't take much code to do it, or even none at all if you followed my posts, but it will take a good bit of PowerBASIC code to do it. And so we're talking ADO, ODBC..
            Actually you are talking ADO only, not ODBC.

            An ADO recordset object is what is returned by a 'SELECT' statement when using ADO (OLE) to access a datasource (DBMS, flat file or specialty storage such as an Excel(r) spreadsheet file).

            This code here..
            Generic 'ADO' Connection and Query Tester (CC 5+/Win 9+) 11-02-08
            .. shows how to return the recordset, and how to translate said recordset object into something perhaps a bit more familar to PB programmers: a STRING ARRAY. (Code created before WSTRING was a supported datatype).

            Populating a control instead of a PB STRING ARRAY is really not much of a stretch at all. You could rearrange some things in there and instead of calling "ADOExecuteSelect()" you could call "ExecuteSelectandPopulateControlWithResults()" with very little new code required.

            That code is public domain, meaning it may as well be your own. (I personally happen to believe it is better than your own; but I can hardly be considered an unbiased observer).

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


              #7
              Has anyone already figured out a way to use the PB COM browser or maybe Jose Roca's TypeLib programatically?
              There is not need for it. PB does not use type libraries, but interface declarations. Therefore, it is more practical to save the declarations in include files and reuse them when needed.
              Forum: http://www.jose.it-berater.org/smfforum/index.php

              Comment


                #8
                Several weeks ago I exported the type libraries from several of VB6's runtimes and I didn't find anything in them that seemed to be remotely usable or useful.
                The objects implemented in the VB6 runtime can only be instantiated using VB6. These include the simplest controls, such Command Button. Other controls are implemented in a bunch of OCXs.

                For example, COMCTL32.OCX implements the following controls:

                Code:
                ' ========================================================================================
                ' CoClass name: TabStrip
                ' ========================================================================================
                ' CLSID (Class identifier): {9ED94440-E5E8-101B-B9B5-444553540000}
                ' Help string: Microsoft TabStrip Control
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: ITabStrip
                ' Default interface IID: {E6E17E8A-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: ITabStripEvents
                ' Default events interface IID: {9ED94442-E5E8-101B-B9B5-444553540000}
                ' Implemented interfaces:
                '  ITabStrip (default interface)
                '  ITabStripEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Tabs
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E432-850A-101B-AFC0-4210102A8DA7}
                ' Help string: Returns a reference to a collection of Tab objects in the TabStrip control.
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: ITabs
                ' Default interface IID: {7791BA50-E020-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  ITabs (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Tab
                ' ========================================================================================
                ' CLSID (Class identifier): {0713F341-850A-101B-AFC0-4210102A8DA7}
                ' Help string: Returns a reference to a collection of Tab objects in the TabStrip control.
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: ITab
                ' Default interface IID: {7791BA52-E020-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  ITab (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Toolbar
                ' ========================================================================================
                ' CLSID (Class identifier): {612A8624-0FB3-11CE-8747-524153480004}
                ' Help string: Microsoft Toolbar Control
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: IToolbar
                ' Default interface IID: {E6E17E8C-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: IToolbarEvents
                ' Default events interface IID: {612A8626-0FB3-11CE-8747-524153480004}
                ' Implemented interfaces:
                '  IToolbar (default interface)
                '  IToolbarEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Buttons
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E452-850A-101B-AFC0-4210102A8DA7}
                ' Help string: ToolBar Buttons
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IButtons
                ' Default interface IID: {7791BA40-E020-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  IButtons (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Button
                ' ========================================================================================
                ' CLSID (Class identifier): {0713F354-850A-101B-AFC0-4210102A8DA7}
                ' Help string: ToolBar Button
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IButton
                ' Default interface IID: {7791BA42-E020-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  IButton (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: StatusBar
                ' ========================================================================================
                ' CLSID (Class identifier): {6B7E638F-850A-101B-AFC0-4210102A8DA7}
                ' Help string: Microsoft StatusBar Control
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: IStatusBar
                ' Default interface IID: {E6E17E88-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: IStatusBarEvents
                ' Default events interface IID: {6B7E6391-850A-101B-AFC0-4210102A8DA7}
                ' Implemented interfaces:
                '  IStatusBar (default interface)
                '  IStatusBarEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Panels
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E89E-850A-101B-AFC0-4210102A8DA7}
                ' Help string: StatusBar Panels collection
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IPanels
                ' Default interface IID: {2C787A50-E01C-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  IPanels (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Panel
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E89F-850A-101B-AFC0-4210102A8DA7}
                ' Help string: StatusBar Panel
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IPanel
                ' Default interface IID: {6E1B5150-DB62-11D0-A0D8-0080C7E7B78D}
                ' Implemented interfaces:
                '  IPanel (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ProgressBar
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8D2-850A-101B-AFC0-4210102A8DA7}
                ' Help string: Microsoft ProgressBar Control
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: IProgressBar
                ' Default interface IID: {E6E17E84-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: IProgressBarEvents
                ' Default events interface IID: {0713E8D1-850A-101B-AFC0-4210102A8DA7}
                ' Implemented interfaces:
                '  IProgressBar (default interface)
                '  IProgressBarEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: TreeView
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8A2-850A-101B-AFC0-4210102A8DA7}
                ' Help string: Displays a hierarchical list of Node objects, each of which consists of a label and an optional bitmap.
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: ITreeView
                ' Default interface IID: {E6E17E8E-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: ITreeViewEvents
                ' Default events interface IID: {0713E8A4-850A-101B-AFC0-4210102A8DA7}
                ' Implemented interfaces:
                '  ITreeView (default interface)
                '  ITreeViewEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Nodes
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C0-850A-101B-AFC0-4210102A8DA7}
                ' Help string: Treeview Nodes collection
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: INodes
                ' Default interface IID: {7791BA60-E020-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  INodes (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Node
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C1-850A-101B-AFC0-4210102A8DA7}
                ' Help string: An object in a TreeView control that can contain images and text.
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: INode
                ' Default interface IID: {7791BA62-E020-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  INode (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ListView
                ' ========================================================================================
                ' CLSID (Class identifier): {58DA8D8A-9D6A-101B-AFC0-4210102A8DA7}
                ' Help string: Displays a collection of ListItems such as files or folders.
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: IListView
                ' Default interface IID: {F4D83600-895E-11D0-B0A6-000000000000}
                ' Default events interface: ListViewEvents
                ' Default events interface IID: {58DA8D8C-9D6A-101B-AFC0-4210102A8DA7}
                ' Implemented interfaces:
                '  IListView (default interface)
                '  ListViewEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ListItems
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C4-850A-101B-AFC0-4210102A8DA7}
                ' Help string: ListView Item collection
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IListItems
                ' Default interface IID: {F4D83601-895E-11D0-B0A6-000000000000}
                ' Implemented interfaces:
                '  IListItems (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ListItem
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C5-850A-101B-AFC0-4210102A8DA7}
                ' Help string: An item in a ListView control that contains the index of icons associated with it, text, and an array of strings representing subitems that are displayed in Report view.
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IListItem
                ' Default interface IID: {F4D83602-895E-11D0-B0A6-000000000000}
                ' Implemented interfaces:
                '  IListItem (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ColumnHeaders
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C6-850A-101B-AFC0-4210102A8DA7}
                ' Help string: ListView Column Header collection
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IColumnHeaders
                ' Default interface IID: {F4D83603-895E-11D0-B0A6-000000000000}
                ' Implemented interfaces:
                '  IColumnHeaders (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ColumnHeader
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C7-850A-101B-AFC0-4210102A8DA7}
                ' Help string: ListView Column Header
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IColumnHeader
                ' Default interface IID: {F4D83604-895E-11D0-B0A6-000000000000}
                ' Implemented interfaces:
                '  IColumnHeader (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ImageList
                ' ========================================================================================
                ' CLSID (Class identifier): {58DA8D8F-9D6A-101B-AFC0-4210102A8DA7}
                ' Help string: Contains a collection of ListImage objects, each of which can be referred to by its index or key
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: IImageList
                ' Default interface IID: {E6E17E80-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: ImageListEvents
                ' Default events interface IID: {58DA8D91-9D6A-101B-AFC0-4210102A8DA7}
                ' Implemented interfaces:
                '  IImageList (default interface)
                '  ImageListEvents (default events interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ListImages
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C2-850A-101B-AFC0-4210102A8DA7}
                ' Help string: A bitmap or icon of any size that can be used in other controls.
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IImages
                ' Default interface IID: {8556BCD0-E01E-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  IImages (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: ListImage
                ' ========================================================================================
                ' CLSID (Class identifier): {0713E8C3-850A-101B-AFC0-4210102A8DA7}
                ' Help string: A bitmap or icon of any size that can be used in other controls.
                ' Attributes: 2 [&H00000002] [Cancreate]
                ' Default interface: IImage
                ' Default interface IID: {8556BCD2-E01E-11CF-8E74-00A0C90F26F8}
                ' Implemented interfaces:
                '  IImage (default interface)
                ' ========================================================================================
                
                ' ========================================================================================
                ' CoClass name: Slider
                ' ========================================================================================
                ' CLSID (Class identifier): {373FF7F0-EB8B-11CD-8820-08002B2F4F5A}
                ' Help string: A calibrated control with a slider for setting or selecting values.
                ' Attributes: 38 [&H00000026] [Cancreate] [Licensed] [Control]
                ' Default interface: ISlider
                ' Default interface IID: {E6E17E86-DF38-11CF-8E74-00A0C90F26F8}
                ' Default events interface: ISliderEvents
                ' Default events interface IID: {373FF7F2-EB8B-11CD-8820-08002B2F4F5A}
                ' Implemented interfaces:
                '  ISlider (default interface)
                '  ISliderEvents (default events interface)
                ' ========================================================================================
                Forum: http://www.jose.it-berater.org/smfforum/index.php

                Comment


                  #9
                  There is not need for it. PB does not use type libraries, but interface declarations. Therefore, it is more practical to save the declarations in include files and reuse them when needed.
                  But maybe Stan doesn't have all the actual *.ocx files? If so, then he wouldn't be able to generate the interfaces even if he had the source code to both your and the PowerBASIC COM Browser. Do such files as the MSFlxGrd.ocx, MSDatGrd.ocx, etc., show up in your Type Lib Browser Stan?
                  Fred
                  "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

                  Comment


                    #10
                    Originally posted by José Roca View Post
                    The type libraries are included in the OCXs as a resource. They are not separate files.
                    Thank you.

                    I've probably misused my terms. Your TypeLib5.0 and the PB COM browser can save a PB code template designed to access the TypeLib being viewed. That's the kind of file I meant.

                    Originally posted by José Roca View Post
                    There is not need for it. PB does not use type libraries, but interface declarations. Therefore, it is more practical to save the declarations in include files and reuse them when needed.
                    Right. That's the kind of thing I want to do with these files, but I don't have access to the VB6 installation OCX, DLL, & etc. files so I can't do it myself.

                    Originally posted by José Roca View Post
                    The objects implemented in the VB6 runtime can only be instantiated using VB6. These include the simplest controls, such Command Button. Other controls are implemented in a bunch of OCXs.
                    Those CLASS descriptions you posted are very helpful. Thank you, again.

                    Yes, I understand. I like to think there is an approach that does not require those files be present. I want to try to get to some of those COM objects blithely passed over in my VB6 manuals set (no longer have the software, just the books). I want to peer into the OCX black boxes deeply enough to build PB objects or DLLs to do a similar job.

                    by MCM --
                    .. shows how to return the recordset, and how to translate said recordset object ...

                    That code is public domain, meaning it may as well be your own. (I personally happen to believe it is better than your own; but I can hardly be considered an unbiased observer).
                    Thank you. That code is also helpful. Positive you are correct about "better than your own", but can we reserve final judgement for a date to be determined? My ego is already bruised right now.
                    Do not go quiet into that good night,
                    ... Rage, rage against the dark.

                    Comment


                      #11
                      The objects implemented in the VB6 runtime can only be instantiated using VB6. These include the simplest controls, such Command Button.
                      Thanks for confirming my beliefs on that Jose. I hadn't given the Common Controls any thought, but I do remember in VB4-6 one had to include a Reference to those if one needed them, so that adds up.

                      My greatest fear, when I considered personally throwing a big chunk of time at this project, was doing that and later finding out when finished, that the common or 'regular' Windows controls, i.e., buttons, text boxes, combo boxes, list boxes, labels, etc., could be instantiated through a published COM interface - however obscure it might have been. But I guess Microsoft didn't want to make it too easy to duplicate Visual Basic.
                      Fred
                      "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

                      Comment


                        #12
                        But your next step (or maybe the one after that) Stan, will be attempting to discern from reading through the various files in a VB project, what objects can be instantiated through Dialog New / CreateWindow() calls, as opposed to COM calls that require NewCom or some of the more esoteric stuff like the Atl or OleCon stuff Jose and I have illustrated.
                        Fred
                        "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

                        Comment


                          #13
                          My greatest fear, when I considered personally throwing a big chunk of time at this project, was doing that and later finding out when finished, that the common or 'regular' Windows controls, i.e., buttons, text boxes, combo boxes, list boxes, labels, etc., could be instantiated through a published COM interface - however obscure it might have been. But I guess Microsoft didn't want to make it too easy to duplicate Visual Basic.
                          There were several pieces of code here putting an OOP interface on window creation with PB code; this goes back 3-5 years now.

                          I don't recall how far it really got but I distinctly remember seeing some CLASS/END CLASS blocks with METHODS like "Create" calling CreateWindowEx().

                          There may in fact be some "starter" code available here if you have your heart set on providing some kind of OOP syntax support for screen creation and management.

                          MCM
                          Michael Mattias
                          Tal Systems (retired)
                          Port Washington WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment


                            #14
                            There were several pieces of code here putting an OOP interface on window creation with PB code; this goes back 3-5 years now.

                            I don't recall how far it really got but I distinctly remember seeing some CLASS/END CLASS blocks with METHODS like "Create" calling CreateWindowEx().

                            There may in fact be some "starter" code available here if you have your heart set on providing some kind of OOP syntax support for screen creation and management.
                            No, I really don't Michael. Some of those early attempts you mentioned were possibly mine. It was just of novelty value for me. But Jose put a lot of work into his CWindow class, and if I personally wanted to wrap the Api with PowerBASIC I'm pretty sure I'd use his. That's why I think if someone was serious about creating a converter app from VB to PowerBASIC serious consideration should be given to a conversion using Jose's CWindow class.

                            The reason I think that way is because OOP ideas have so permiated programming culture that solutions in terms of OOP could be more palatable to folks coming from a Visual Basic or even C++ background. Folks coming from such backgrounds like stuff like this ...

                            txtFirstName.Text

                            instead of...

                            GetWindowText(hCtl, szFirstName, 256)

                            or this ...

                            Dialog Get Text ....

                            But Jose's statement to the effect that Visual Basic Forms themselves, as well as the Standard Windows Controls that a user would decorate one with, are created within the runtime by proprietary code, puts to rest my idea that the coolest way to convert VB code, would be to instantiate these objects directly threough COM interface calls that would be available somewhere in VB's dlls. But I couldn't find anything that remotely looked like that could be doable.

                            So that leaves three possibilities in terms of converting VB code to PowerBASIC...

                            1) DDT code;
                            2) SDK code;
                            3) OOP code in terms of something like Jose's CWindow Class.

                            I've recently had a change of heart on this whole thing. Up until recently I was in the camp of 'Yes, this can be done'. Now I'm in the other camp. While I think its a theoretical possibility, I don't believe anymore that its a practical possibility. Some of the problems I have with it...

                            1) Just how many VB6'ers are still out there?

                            2) Even if a perfect converter were available, what good would it do for a new PowerBASIC user who now has perfectly working PowerBASIC code which he/she doesn't understand?
                            Fred
                            "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

                            Comment


                              #15
                              Is this of interest ?



                              OLE/COM interfaces for VB6 programming.

                              Comment


                                #16
                                There are three broad categories of controls in Visual Basic:

                                a) Intrinsic controls, such as the command button and frame controls. These controls are contained inside the Visual Basic .exe file.

                                b) ActiveX controls, which exist as separate files with a .ocx file name extension. These include controls that are available in all editions of Visual Basic (DataCombo, DataList controls, and so on) and those that are available only in the Professional and Enterprise editions (such as Listview, Toolbar, Animation, and Tabbed Dialog). Many third-party ActiveX controls are also available.

                                c) Insertable Objects, such as a Microsoft Excel Worksheet object containing a list of all your company's employees, or a Microsoft Project Calendar object containing the scheduling information for a project.

                                Intrinsic Controls

                                The following table summarizes the intrinsic controls found in the Visual Basic toolbox.

                                CheckBox Displays a True/False or Yes/No option. You can check any number of check boxes on a form at one time.

                                ComboBox Combines a text box with a list box. Allows a user to type in a selection or select an item from a drop-down list.

                                Command button CommandButton Carries out a command or action when a user chooses it.

                                Data Enables you to connect to an existing database and display information from it on your forms.

                                DirListBox Displays and allows a user to select directories and paths.

                                DriveListBox Displays and allows a user to select valid disk drives.

                                FileListBox Displays and allows a user to select from a list of files.

                                Frame Provides a visual and functional container for controls.

                                HScrollBar and VScrollBar Allow a user to add scroll bars to controls that do not automatically provide them. (These are not the same as the built-in scroll bars found with many controls.)

                                Image Displays bitmaps, icons, or Windows metafiles, JPEG, or GIF files; acts like a command button when clicked.

                                Label Displays text a user cannot interact with or modify.

                                Line Adds a straight-line segment to a form.

                                ListBox Displays a list of items that a user can choose from.

                                OLE container Embeds data into a Visual Basic application.

                                OptionButton The Option Button control, as part of an option group with other option buttons, displays multiple choices, from which a user can choose only one.

                                PictureBox Displays bitmaps, icons, or Windows metafiles, JPEG, or GIF files. It also displays text or acts as a visual container for other controls.

                                Shape Adds a rectangle, square, ellipse, or circle to a form, frame, or picture box.

                                TextBox Provides an area to enter or display text.

                                Timer Executes timer events at specified time intervals.

                                As they are contained inside the Visual Basic .exe file, and not in an OCX, they can only be used with VB6.
                                Forum: http://www.jose.it-berater.org/smfforum/index.php

                                Comment


                                  #17
                                  Standard ActiveX Controls

                                  The Learning edition of Visual Basic contains a number of ActiveX controls (referred to as standard ActiveX controls) that allow you to add advanced features to your applications. ActiveX controls have the file name extension .ocx and can be used in your project by manually adding them to the toolbox.

                                  The following table summarizes the standard ActiveX controls available in the Learning edition of Visual Basic.

                                  ADO Data Control ADODC Creates a connection to a database using ADO. Assignable to the DataSource property of other controls such as the DataGrid.

                                  Common dialog CommonDialog Provides a standard set of dialog boxes for operations such as opening and saving files, setting print options, and selecting colors and fonts.

                                  DataCombo DataCombo Provides most of the features of the standard combo box control, plus increased data access capabilities.

                                  DataGrid DataGrid A grid control that allows can be data-bound to a data source such as the ADO Data Control. Reading and editing the recordset is possible.

                                  DataList DataList Provides most of the features of the standard list box control, plus increased data access capabilities.

                                  Microsoft Hierarchical FlexGrid MSHFlexGrid A read-only grid control that can be bound the Data Environment designer to show hierarchical recordsets.

                                  These can be used with PB, but except the Common Dialogs, require the use of a OLE Container to host them.
                                  Forum: http://www.jose.it-berater.org/smfforum/index.php

                                  Comment


                                    #18
                                    Originally posted by Fred Harris View Post
                                    ... But Jose put a lot of work into his CWindow class, and if I personally wanted to wrap the Api with PowerBASIC I'm pretty sure I'd use his... using Jose's CWindow class.
                                    I'll try to find that later today, then.

                                    The reason I think that way is because OOP ideas have so permiated programming culture that solutions in terms of OOP could be more palatable to folks coming from a Visual Basic or even C++ background.
                                    Exactly.

                                    But Jose's statement to the effect that Visual Basic Forms themselves, as well as the Standard Windows Controls that a user would decorate one with, are created within the runtime by proprietary code, puts to rest my idea that the coolest way to convert VB code, would be to instantiate these objects directly threough COM interface calls that would be available somewhere in VB's dlls. But I couldn't find anything that remotely looked like that could be doable.
                                    Right now I'm going on the assumption that the MS proprietary code will not be available. I'm also assuming that one can observe what the VB process does and write some original PB code that will do the same thing. The consensus here seems to be that directly using the VB components cannot work. I'm not going to try to crack that nut with so many in agreement. What can be done is to build another nut in PB. An awful lot of the Gee-Whiz stuff in VB6 can and has been duplicated without hacking the code. Experience tells me I can build something easier on that basis than I can access the arcane details of a multi-language thing like VB6.

                                    So that leaves three possibilities in terms of converting VB code to PowerBASIC...

                                    1) DDT code;
                                    2) SDK code;
                                    3) OOP code in terms of something like Jose's CWindow Class.
                                    Keeping in mind that a mix of all three will more closely resemble the VB6 style refugees are used to.

                                    1) Just how many VB6'ers are still out there?[
                                    It is a shrinking group. What surprises me is the number of businesses with legacy apps asking for upgrades.

                                    2) Even if a perfect converter were available, what good would it do for a new PowerBASIC user who now has perfectly working PowerBASIC code which he/she doesn't understand?
                                    Probably not much. That's why the concept has to be a mix of the three approaches. While there are things PB does so much more cleanly under the hood it is not the same "transparent user experience" provided in VB6. As you said, some of these refugees are likely to believe that programming is OOP and vice versa.

                                    Originally posted by Steve Ten View Post
                                    Is this of interest ?
                                    OLE/COM interfaces for VB6 programming.
                                    I'm interested. Downloaded and on my list to evaluate soonest.

                                    Stan
                                    Do not go quiet into that good night,
                                    ... Rage, rage against the dark.

                                    Comment


                                      #19
                                      ActiveX Controls

                                      ADO Data Control
                                      The ADO Data Control is similar to the intrinsic Data control and the Remote Data Control (RDC). The ADO Data Control allows you to quickly create a connection to a database using Microsoft ActiveX Data Objects (ADO).

                                      Animation Control
                                      The Animation control allows you to create buttons which display animations, such as .avi files, when clicked. The control can play only AVI files that have no sound. In addition, the Animation control can display only uncompressed .avi files or .avi files that have been compressed using Run-Length Encoding (RLE).

                                      CommonDialog Control
                                      The CommonDialog control provides a standard set of dialog boxes for operations such as opening and saving files, setting print options, and selecting colors and fonts. The control also has the ability to display help by running the Windows Help engine.

                                      CoolBar Control
                                      A CoolBar control contains a collection of Band objects used to create a configurable toolbar that is associated with a form.

                                      DataCombo Control
                                      The DataCombo control is a data-bound combo box that is automatically populated from a field in an attached data source, and optionally updates a field in a related table of another data source.

                                      DataGrid Control
                                      Displays and enables data manipulation of a series of rows and columns representing records and fields from a Recordset object.

                                      DataList Control
                                      The DataList control is a data-bound list box that is automatically populated from a field in an attached data source, and optionally updates a field in a related table of another data source.

                                      DataRepeater Control
                                      The DataRepeater control functions as a scrollable container of data-bound user controls. Each control appears in its own row as a "repeated" control, allowing the user to view several data-bound user controls at once.

                                      DateTimePicker Control
                                      The DateTimePicker control enables you to provide a formatted date field that allows easy date selection. In addition, users can select a date from a dropdown calendar interface similar to the MonthView control.

                                      DBCombo Control
                                      The DBCombo control is a data bound combo box with a drop-down list box which is automatically populated from a field in an attached Data control, and optionally updates a field in a related table of another Data control. The text box portion of DBCombo can be used to edit the selected field.

                                      DBList Control
                                      he DBList control is a data bound list box which is automatically populated from a field in an attached Data control, and optionally updates a field in a related table of another Data control.

                                      FlatScrollBar Control
                                      The FlatScrollBar control is a mouse-sensitive version of the standard Windows scroll bar that offers two-dimensional formatting options. It can also replace the standard Windows three-dimensional scroll bar. The FlatScrollBar provides increased interactivity when using the scroll arrows and the scroll box.

                                      ImageCombo Control
                                      The ImageCombo control is a picture-enabled version of the standard Windows combo box. Each item in the list portion of the control can have a picture assigned to it.

                                      ImageList Control
                                      An ImageList control contains a collection of ListImage objects, each of which can be referred to by its index or key. The ImageList control is not meant to be used alone, but as a central repository to conveniently supply other controls with images.

                                      ListView Control
                                      The ListView control displays items using one of four different views. You can arrange items into columns with or without column headings as well as display accompanying icons and text.

                                      MAPIMessages Control
                                      The messaging application program interface (MAPI) controls allow you to create mail-enabled Visual Basic MAPI applications.

                                      MAPISession Control
                                      The messaging application program interface (MAPI) controls allow you to create mail-enabled Visual Basic MAPI applications.

                                      Masked Edit Control
                                      The Masked Edit control provides restricted data input as well as formatted data output. This control supplies visual cues about the type of data being entered or displayed.

                                      Microsoft Internet Transfer Control
                                      The Internet Transfer control provides implementation of two of the most widely used protocols on the Internet, HyperText Transfer Protocol (HTTP) and File Transfer Protocol (FTP).

                                      MonthView Control
                                      The MonthView control enables you to create applications that let users view and set date information via a calendar-like interface.

                                      MSChart Control
                                      A chart that graphically displays data.

                                      MSComm Control
                                      The MSComm control provides serial communications for your application by allowing the transmission and reception of data through a serial port.

                                      MSFlexGrid Control
                                      The Microsoft FlexGrid (MSFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a Data control, MSFlexGrid displays read-only data.

                                      MSHFlexGrid Control
                                      The Microsoft Hierarchical FlexGrid (MSHFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a data control, MSHFlexGrid displays read-only data.

                                      Multimedia MCI Control
                                      The Multimedia MCI control manages the recording and playback of multimedia files on Media Control Interface (MCI) devices. Conceptually, this control is a set of push buttons that issues MCI commands to devices such as audio boards, MIDI sequencers, CD-ROM drives, audio CD players, videodisc players, and videotape recorders and players. The MCI control also supports the playback of Video for Windows (*.avi) files.

                                      PictureClip Control
                                      The PictureClip control allows you to select an area of a source bitmap and then display the image of that area in a form or picture box. PictureClip controls are invisible at run time.

                                      ProgressBar Control
                                      The ProgressBar control shows the progress of a lengthy operation by filling a rectangle with chunks from left to right.

                                      RemoteData Control
                                      Provides access to data stored in a remote ODBC data source through bound controls. The RemoteData control enables you to move from row to row in a result set and to display and manipulate data from the rows in bound controls.

                                      RichTextBox Control
                                      The RichTextBox control allows the user to enter and edit text while also providing more advanced formatting features than the conventional TextBox control.

                                      Slider Control
                                      A Slider control is a window containing a slider and optional tick marks. You can move the slider by dragging it, clicking the mouse to either side of the slider, or using the keyboard.

                                      SSTab Control
                                      The SSTab control provides a group of tabs, each of which acts as a container for other controls. Only one tab is active in the control at a time, displaying the controls it contains to the user while hiding the controls in the other tabs.

                                      StatusBar Control
                                      A StatusBar control provides a window, usually at the bottom of a parent form, through which an application can display various kinds of status data. The StatusBar can be divided up into a maximum of sixteen Panel objects that are contained in a Panels collection.

                                      SysInfo Control
                                      The SysInfo control allows you to respond to certain system messages sent to all applications by the operating system. Your application can then adapt to changes in the operating system if necessary.

                                      TabStrip Control
                                      A TabStrip control is like the dividers in a notebook or the labels on a group of file folders. By using a TabStrip control, you can define multiple pages for the same area of a window or dialog box in your application.

                                      Toolbar Control
                                      A Toolbar control contains a collection of Button objects used to create a toolbar that is associated with an application.

                                      TreeView Control
                                      A TreeView control displays a hierarchical list of Node objects, each of which consists of a label and an optional bitmap. A TreeView is typically used to display the headings in a document, the entries in an index, the files and directories on a disk, or any other kind of information that might usefully be displayed as a hierarchy.

                                      UpDown Control
                                      An UpDown control has a pair of arrow buttons which the user can click to increment or decrement a value, such as a scroll position or a value in an associated control, known as a buddy control.

                                      Winsock Control
                                      The Winsock control, invisible to the user, provides easy access to TCP and UDP network services. It can be used by Microsoft Access, Visual Basic, Visual C++, or Visual FoxPro developers. To write client or server applications you do not need to understand the details of TCP or to call low level Winsock APIs. By setting properties and invoking methods of the control, you can easily connect to a remote machine and exchange data in both directions.
                                      Forum: http://www.jose.it-berater.org/smfforum/index.php

                                      Comment


                                        #20
                                        Originally posted by Steve Ten View Post
                                        Only useful to work with VB6, that is unable to use low-level COM interfaces without a typelib. With PB you can use them with just interface declarations, all of them available in my headers.
                                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                                        Comment

                                        Working...
                                        X
                                        😀
                                        🥰
                                        🤢
                                        😎
                                        😡
                                        👍
                                        👎