Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

ActiveX is Dead! Long live ActiveX!

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

    ActiveX is Dead! Long live ActiveX!

    ActiveX is dead! Long live ActiveX!

    In a world governed by .NET you almost think that ActiveX is dead. In a certain way this is true. Everything must be save, everything must be marshaled, everything must be dot netted. But in a certain way, ActiveX is so easy. Especially when you use a free Visual Basic tool that has been written by Microsoft to promote ActiveX several years ago and what they have withdrawn from the internet. It is as simple as writing vba macros in Word or Excel.

    I've always been interested in COM and ActiveX and how to use these controls in Alpha Five. As fellow Xbasic coders have experienced, each ActiveX control is different from each other and not every control is working well in Alpha Five. Some even let Alpha Five crash and burn.

    I discovered that this is not always on the record of Alpha Five. I saw events not working in Alpha Five. In the past, I myself, said that this was a problem of Alpha Five. Now I know better when it comes to events. Other things such as passing variants and arrays, I have no experience so far and did not tested it yet. But this will come.

    Creating a control
    When you make an ActiveX there are always standard properties and events declared in the ActiveX control, at leat in the software I use. But to let them work properly to the outside the programmer who build the ActiveX must map these events in a proper way. I tested this with the Gauge.ocx ActiveX control which I have developed. I made the same mistake. I saw the event code in Alpha Five but it didn't work despite the fact that the events were declared. What did I wrong? Simply, I forgot the Raise Event command. Made other ActiveX builders the same mistake?

    When you write an Event Click() in the declaration section of a vb control class and compile the control, Alpha Five will discover the events in the ocx and put them in the ActiveX Xbasic event section of the control. The sad thing is when the programmer forgot to put a raise event sub in his control it is of no use for Alpha Five or other applications.

    There are other known cases the events did work in Word but not in Alpha Five. In that case I cannot recall my above discoveries and there must be other problems involved.

    Gauge.ocx
    To learn and test this I made a simple ActiveX control.



    This control is a clock that you can place on a form and give the hands, dial and back a color of your choice. There are events that you can use as the next Xbasic code show.

    Code:
    [FONT=Courier New][FONT=Courier New]function click as v ()[/FONT]
    [FONT=Courier New]ui_beep()[/FONT]
    [FONT=Courier New]msgbox("Title","Click_Event")[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function dblclick as v ()[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function keydown as v (KeyCode as N,Shift as N)[/FONT]
    [FONT=Courier New]msgbox("Title","Keydown_event")[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function keypress as v (KeyAscii as N)[/FONT]
    [FONT=Courier New]msgbox("Title","Keypress_Event")[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function keyup as v (KeyCode as N,Shift as N)[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function mousedown as v (Button as N,Shift as N,X as N,Y as N)[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function mousemove as v (Button as N,Shift as N,X as N,Y as N)[/FONT]
    [FONT=Courier New]'ui_beep()[/FONT]
    [FONT=Courier New]end function[/FONT]
     
    [FONT=Courier New]function mouseup as v (Button as N,Shift as N,X as N,Y as N)[/FONT]
    end function
    [/FONT]
    Register the ActiveX
    I made an example in Alpha Five version 8. To use this control just register it with the regsvr32.exe command: regsvr32 Gauge.ocx

    You can put the control in the c:\windows\system32 folder and register it there or keep it in the same folder where you put the Alpha Five example. If the system can't find regsvr32.exe put the full path before the command. In my case it is C:\WINDOWS\system32\regsvr32.exe

    Use the start, run command or a dos box to register the ocx.
    You can inactivate the control by unregister the control with the /u switch: regsvr32 /u Gauge.ocx

    Do not delete the Gauge.ocx before you have unregister it from the system or you'll have to delete the control manually from the registry.

    When it is registered you can place the control on your form. Look for the id "gauge.ucclock" when you use the ActiveX control tool in Alpha Five Form design mode. Don't forget to refresh the ActiceX list.

    Gauge.ucclock Properties
    Use the next color numbers:
    Number Color
    0 Black
    1 Blue
    2 Green
    3 Cyan
    4 Red
    5 Magenta
    6 Yellow
    7 White
    8 Gray
    9 Light Blue
    10 Light Green
    11 Light Cyan
    12 Light Red
    13 Light Magenta
    14 Light Yellow
    15 Bright White

    This sets the color of the background of the control.
    topparent:ACTIVEX1.activex.backcolor = 0

    Sets the backstyle
    transparent = 0
    opaque = 1
    topparent:ACTIVEX1.activex.backstyle = 1.0

    Sets the borderstyle
    none = 0
    fixed single = 1
    topparent:ACTIVEX1.activex.borderstyle = 1.0

    Sets the color of the numbers, see color table.
    topparent:ACTIVEX1.activex.colorcifra = 10

    Sets the color of the dial.
    topparent:ACTIVEX1.activex.colordial = 10

    Sets the color of the hour hand
    topparent:ACTIVEX1.activex.colorhandhr = 14

    Sets the color of the minutes hand
    topparent:ACTIVEX1.activex.colorhandmin = 14

    Sets the color of the seconds hand
    topparent:ACTIVEX1.activex.colorhandsec = 14

    Sets the font size.
    topparent:ACTIVEX1.activex.fontsize = 12

    You'll see more properties in the ActiveX control properties window in Alpha Five. Only the above mentioned properties are mapped to the control.

    This all is tested with with Alpha Five version 8 under Windows XP SP3. I'm curious how this controls behaves in Alpha Five 9 under vista?

    Use this control at your own risk.

    My discovery continues, more to come.

    Marcel Kollenaar
    Marcel

    I hear and I forget. I see and I remember. I do and I understand.
    ---- Confusius ----

    #2
    Re: ActiveX is Dead! Long live ActiveX!

    Thanks Marcel. Using version 8 on XP-SP2 and works fine.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: ActiveX is Dead! Long live ActiveX!

      Windows XP pro SP 3 here, I have the debugger pop up on error (something Selwyn taught me!) and Version 9 Platinum. I got a 'property not found error' in the oninit code on your clock form in line 10 so changed it from
      Code:
      [COLOR=Red]:[/COLOR]Clock:ACTIVEX1.activex.colordial = 10
      to
      Code:
      [COLOR=Black]Clock:ACTIVEX1.activex.colordial = 10[/COLOR]
      and it worked.

      Keep up the good work!

      Comment


        #4
        Re: ActiveX is Dead! Long live ActiveX!

        Originally posted by Lance Gurd View Post
        I have the debugger pop up on error (something Selwyn taught me!)
        Wow, sounds like sharing time to me.....
        Al Buchholz
        Bookwood Systems, LTD
        Weekly QReportBuilder Webinars Thursday 1 pm CST

        Occam's Razor - KISS
        Normalize till it hurts - De-normalize till it works.
        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
        When we triage a problem it is much easier to read sample systems than to read a mind.
        "Make it as simple as possible, but not simpler."
        Albert Einstein

        http://www.iadn.com/images/media/iadn_member.png

        Comment


          #5
          Re: ActiveX is Dead! Long live ActiveX!

          Open the debugger, debug menu, settings, then under error trapping, click the trap unhandled errors radio. any code with an error, the debugger pops up (pretty sure that is it was about a year ago when he showed me). Can be annoying but sure helps iron out the bugs!

          Comment


            #6
            Re: ActiveX is Dead! Long live ActiveX!

            Originally posted by Lance Gurd View Post
            Windows XP pro SP 3 here, I have the debugger pop up on error (something Selwyn taught me!) and Version 9 Platinum. I got a 'property not found error' in the oninit code on your clock form in line 10 so changed it from
            Code:
            [COLOR=red]:[/COLOR]Clock:ACTIVEX1.activex.colordial = 10
            to
            Code:
            [COLOR=black]Clock:ACTIVEX1.activex.colordial = 10[/COLOR]
            and it worked.

            Keep up the good work!
            Lance,

            Strange, when I run the example in A5V8 in its original state I don't get an error. But when I run it with the debugger I got an error on the topparent part.

            I changed it in the following code. I deleted the :clock: and topparent:. However A5v8 created the properties code example with the :clock.ACTIVEX1.activex.colordial = 10. Is there a slight change in code interpretation or generation?


            Code:
            debug(1)
            ACTIVEX1.activex.backcolor = 0
            ACTIVEX1.activex.backstyle = 1.0
            ACTIVEX1.activex.borderstyle = 1.0
            ACTIVEX1.activex.colorcifra = 10
            ACTIVEX1.activex.colordial = 10
            ACTIVEX1.activex.colorhandhr = 14
            ACTIVEX1.activex.colorhandmin = 14
            ACTIVEX1.activex.colorhandsec = 14
            'topparent:ACTIVEX1.activex.enabled = .F.
            'topparent:ACTIVEX1.activex.font.bold = .F.
            'topparent:ACTIVEX1.activex.font.charset = 0.000000
            ACTIVEX1.activex.font.italic = .F.
            ACTIVEX1.activex.font.name = "MS Shell Dlg"
            'topparent:ACTIVEX1.activex.font.size = 12.0
            ACTIVEX1.activex.font.strikethrough = .F.
            ACTIVEX1.activex.font.underline = .F.
            ACTIVEX1.activex.font.weight = 400.000000
            ACTIVEX1.activex.fontsize = 12.0
            Marcel

            I hear and I forget. I see and I remember. I do and I understand.
            ---- Confusius ----

            Comment


              #7
              Re: ActiveX is Dead! Long live ActiveX!

              Hi Marcel,

              Not sure if/what has been changed, but know they prefer incomplete addressing (without the starting colon)

              Comment


                #8
                Re: ActiveX is Dead! Long live ActiveX!

                Originally posted by Lance Gurd View Post
                Open the debugger, debug menu, settings, then under error trapping, click the trap unhandled errors radio. any code with an error, the debugger pops up (pretty sure that is it was about a year ago when he showed me). Can be annoying but sure helps iron out the bugs!
                That's interesting. I looked at mine and that radio button was already checked. So, to do some testing....

                - I checked "Do Not Trap Errors".
                - Changed View/Settings/System/Preferences/Script Errors/Launch Debugger to "No". (In case that would affect the "Do Not Trap Errors" setting.)
                - Shut down A5.
                - Restarted A5.

                And, the debugger was set back to "Trap Unhandled Errors". That seems to be the default from what I can see. (The "settings" remained at "No".)

                I actually ran a few other tests and it always came back to "Trap Unhandled Errors" every time I shut down and restarted A5.

                There are a few things like this where they "exist" but it's very hard to fully understand how/why/when they work. Oh well, my debugger seems to open when I want it to so I guess I'll just accept it.

                Comment


                  #9
                  Re: ActiveX is Dead! Long live ActiveX!

                  Sorry, obviously my memory is not what it should be so did some searching and
                  Script Debugger Starting the Debugger Automatically
                  To use this method:
                  1. Click View > Settings... > Preferences > Script Errors.
                  2. Select "Yes" in the Value list box.

                  Comment


                    #10
                    Re: ActiveX is Dead! Long live ActiveX!

                    Don't worry, be happy. Your "memory is not what it should be" taught me something new. I had never even noticed that there were "settings" in the debugger before - and I use it a lot.

                    Comment

                    Working...
                    X