Announcement

Collapse
No announcement yet.

Interactive animated tutorial for uCalc with entertaining cartoon character

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

  • Interactive animated tutorial for uCalc with entertaining cartoon character

    I have created an interactive animated tutorial for uCalc. It is designed to entertain, just as much as it instructs. The tutorial comes with the next version of the end-user uCalc Graphing Calculator application. However, it demonstrates features of the underlying uCalc Fast Math Parser / Language Builder for programmers as well.

    Please give it a try and give me some feedback. The link is:

    http://www.ucalc.com/beta821.zip (< 250K)

    For now, it does not come with an install program. But since people here are programmers, it shouldn't be a problem. Just unzip it, and run uCalc.Exe, and click on the Tutorial button. If by chance the runtime and control files aren't already on your system, then visit www.ucalc.com/download.html and install the old 4.0 version, which will add all the necessary runtimes to your system.

    I particularly need help with Vista (which I don't currently have access to). Several non-programmers couldn't get it to work on Vista. Does it needs to be run in Compatibility mode? Does the user need to run (or log on) as Administrator?
    Daniel Corbier
    uCalc Fast Math Parser
    uCalc Language Builder
    sigpic

  • #2
    Run-time error: '339'
    Component 'comdlg32.ocx' not correctly registered. file missing or invalid.
    I dont know why it says that, i think it is correctly registered.

    Comment


    • #3
      Thanks for the feedback.

      I have no idea why you're getting that error either. What version of Windows are you using? And what is the version or file date of your comdlg32.ocx file (the file date on mine is 9/10/2003)?

      In any event, I have created a new version of the beta that comes with an install program. It will copy the comdl32.ocx and grid32.ocx to the uCalc application directory instead of the System32 directory, so you don't have to worry about it overwriting whatever version is on your system.

      Also I made a mistake in saying that installing the old uCalc 4.0 would take care of installing the runtime files. That one is more than 10 years old and was compiled with VB 4. This one is compiled with VB 5 (but the main DLL for the underlying math parser is done is PB).

      The link is http://www.ucalc.com/beta821f.zip (around 2.5 Meg)
      (the difference in the file name is the "f" at the end).
      Daniel Corbier
      uCalc Fast Math Parser
      uCalc Language Builder
      sigpic

      Comment


      • #4
        Re thread title:

        "Interactive" was OK.

        "Animated" induced skepticism.

        "Entertaining" was definitely a turn-off.

        "Cartoon" was the killer.
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          now: 'agentctl.dll'

          Comment


          • #6
            Michael, thanks for the feedback,

            I actually have a tutorial for uCalc Language Builder, which does not involve any animated cartoon characters. It is plain text under a console environment. Also, last month, I released a beta for uCalc Fast Math Parser, in which I've added a number of help file examples specifically for PowerBASIC (the previous non-beta centered around VB examples). Hopefully, between static PB examples, the console tutorial, and the animated tutorial, one of those might float your boat. If you can think of an even better approach, please let me know.

            Meanwhile, what is so wrong with a tutorial that's "entertaining" or involves animation? I tried the non-nonsense plain text approach, but people thought I needed something more visually engaging.

            Anyway, MM, I would particularly be interested in your feedback on uCalc after you've tried it. Tell me that the PB examples aren't adequate, or that the animation was lame. But please do actually try some of it and let me know what you think. I need specifics to help me improve uCalc.

            The link for uCalc Language Builder with the console tutorial can be found at:
            http://www.ucalc.com/newbeta.html

            The link for the latest uCalc FMP beta with PB examples, is:
            http://www.ucalc.com/beta/fmp296b.zip
            Daniel Corbier
            uCalc Fast Math Parser
            uCalc Language Builder
            sigpic

            Comment


            • #7
              Elias, agentctl.dll belongs to Microsoft Agent, which is what provides the animated character. As far as I can gather, it comes installed with Windows, under versions as far back as Win Me, and also MS Office as far back as Office 2000 (which apparently was released in the late 1990s). I figured that it would already be on most systems (I would need a special license to include that DLL in my zip file).

              Anyway, use this link to get MS Agent directly from Microsoft:
              http://www.microsoft.com/msagent/
              Daniel Corbier
              uCalc Fast Math Parser
              uCalc Language Builder
              sigpic

              Comment


              • #8
                I have updated the beta. The tutorial (and calculator) is smoother. There is no longer a problem if you close the application while the tutorial is still going. And you have control over resizing and positioning windows, etc.

                In order for the tutorial to work under Vista, simply go to the control panel, and turn User Account Control off. The calculator itself should run fine under Vista regardless of the User Account setting.

                I look forward to getting more feedback on this. Thanks.

                The new links are:

                http://www.ucalc.com/beta825.zip
                (this is for those who already have the comdlg32.ocx, Grid32.ocx, and the VB5 runtime)

                http://www.ucalc.com/beta825f.zip
                (this has a Setup program, which installs uCalc with the required .ocx and runtime files)
                Daniel Corbier
                uCalc Fast Math Parser
                uCalc Language Builder
                sigpic

                Comment


                • #9
                  Hi Daniel,

                  The tutorial (Merlin) seems to turn off the Num Lock key. Was that by design?
                  It had me confused for a while trying to enter numbers on the numeric keyboard .

                  Kind regards
                  Eddy

                  Comment


                  • #10
                    Thanks for the feedback Eddy.

                    This is not at all intentional. Now that you've mentioned it, I noticed that on one computer the Num Lock light flickers, but doesn't turn off. On another computer, Num Lock is turned off completely, and the tutorial doesn't run. (My Num Lock key is always off, so I never noticed this before).

                    The culprit is the VB SendKeys statement that I use. SendKeys also happens to be what causes Vista to block the tutorial from running properly (unless you turn off UAC). SendKeys sends keystrokes to the active window. I use this to simulate someone typing in text into the calculator, or pressing things like the Tab, Alt, or arrow keys, etc. Doing a search it seems like this is a well-known bug. There's even a Microsoft knowledgebase article about it at: http://support.microsoft.com/kb/179987

                    SendKeys is very convenient, but it seems to have multiple problems. I'll probably have to find another solution. Meanwhile, until I figure out a work-around, you may want to leave Num Lock off so that you can run the tutorial. I look forward to hearing additional feedback. Thanks.
                    Daniel Corbier
                    uCalc Fast Math Parser
                    uCalc Language Builder
                    sigpic

                    Comment


                    • #11
                      Originally posted by Daniel Corbier View Post
                      SendKeys .... seems to have multiple problems. I'll probably have to find another solution.
                      Daniel,
                      Have you considered William Burns 'SendKeys.inc' ?
                      To use from VB, you could use SendKeys.inc to build a dll from which you call SendKey functions from VB:
                      http://www.powerbasic.com/support/pb...ad.php?t=24488

                      The problem you mentioned with VB's SendKeys is also mentioned here:
                      http://www.powerbasic.com/support/pb...ad.php?t=22499

                      As another alternative, you could look into AutoIt. It comes with a dll that you can call from PB/VB to control Buttons and send text to controls.

                      Kind regards
                      Eddy

                      Comment


                      • #12
                        Thanks for the links. Burns' code looks nice. And I like the additional features, such as {PAUSE}, etc. One problem though is that his version of SendKeys relies on keybd_event, and according to the current MSDN keybd_event has been superseded by SendInput. Does keybd_event still work under Vista? And even if it worked now, since MS says to use SendInput I don't know if it would work in versions subsequent to Vista.

                        Also, I had actually found a VB 5 replacement for SendKeys, which uses the newer SendInput. With that (it comes as source code), I wouldn't need a DLL wrapper. However, I'm not sure I want to rely on that either. I'll probably use a different alternative. In most cases, I can enter text in the controls using the .Text property. I'm finding out how to simulate the Alt key (to invoke the menu), using SendMessage.

                        As for AutoIt, I've looked at it, and its scripting capability is interesting. However, the whole point of the uCalc tutorial is not only to demonstrate the calculator's features, but also to give programmers an idea of uCalc's scripting capabilities as well. The tutorial itself is written in a kind of script. You'll see the code for it in Tutorial.uc

                        SendKeys wasn't meant to be a major feature. But once I have a better understanding of SendMessage, it shouldn't be hard for me to create a version of SendKeys for the uCalc calculator.
                        Daniel Corbier
                        uCalc Fast Math Parser
                        uCalc Language Builder
                        sigpic

                        Comment


                        • #13
                          I have used SendInput with success. Its advantage over keybd_event is that SendInput can send multiple keystrokes with one call, while keybd_event sends only one keystroke with every call. This avoids that other keyboard or mouse events become mixed with the keystrokes that you sent.

                          Sending messages directly to the controls seems even more reliable to me, if that is acceptable for your scripting purposes.

                          Kind regards
                          Eddy

                          Comment


                          • #14
                            The graphing calculator is an end-user application. I don't need it to handle any windows that do not belong to it. I can see how sending keystrokes to another running application can be a security risk.

                            So far, using SendMessage I have figured out how to simulate pushing a command button, pressing arrow keys, enter, normal characters, etc, using a combination of WM_KEYDOWN, WM_KEYUP, WM_CHAR, etc. I was even able to open up the drop-down list of a combo-box (using CB_SHOWDROPDOWN), something I couldn't do with SendKeys. For strings of text, I use the .Text property of a control.

                            Unfortunately, there's one thing I haven't been able to simulate so far with SendMessage, and that's opening the menu. I'm trying to do it by sending Alt followed by an access key (Alt-u for instance), or arrows. No matter what I try, I can't get it to work. The farthest I've gotten is activating the menu with Alt by itself, using WM_SYSKEYDOWN and WM_SYSKEYUP, and VK_MENU. But beyond that I can't navigate through the menu, or make it drop down.

                            I eventually decided I'd just go ahead and use keybd_event for now until I could figure it out. But to my surprise, it triggered my firewall (ZoneAlarm), which blocked it, even on my XP system.

                            Does anyone know how to drop down a menu using SendMessage (or maybe PostMessage)? I haven't tried SendInput, but I assume that it might create the same security risk as keybd_event and SendKeys. Has anyone tried it under Vista?
                            Daniel Corbier
                            uCalc Fast Math Parser
                            uCalc Language Builder
                            sigpic

                            Comment


                            • #15
                              Problem solved

                              I was able to create my own little version of SendKeys. For now, I've mainly restricted it to the keystrokes that are relevant to my tutorial. Adding the rest should be pretty straightforward when I get the time.

                              One of the changes involved relying mainly on PostMessage, instead of SendMessage. Unlike other keystrokes, Alt (or VK_MENU) requires WM_SYSKEYDOWN, and WM_SYSKEYUP instead of WM_KEYDOWN and WM_KEYUP. And instead of a value of 0 for lParam, I used &H20380001 (for down), and &HC0380001 (for up) for Alt. Also, I noticed that if I pressed something like Alt-u, and then the Down key, it went to the Window menu, instead of my submenu. So I use the Right key, and then Down to access my menu. And something subtle that is worth noting is that if a child window is maximized, then the MDI parent form has an extra menu entry at the left (for the window). The {Enter} key uses WM_KEYDOWN and WM_KEYUP for the MDI parent form, but WM_CHAR for child forms. I use DoEvents, just before and after a group of keystrokes are sent. I have a separate routine that I named SetInput, which sends text verbatim to the text property of a form object.

                              Would anyone be interested in me posting a PostMessage-based SendKeys routine in the PB Source Code forum? (It's currently done in VB, and would require some time to translate).

                              Anyway, my own SendKey using PostMessage now works correctly under Vista (you don't have to change any settings in the control panel). It posts keystrokes only to windows that belong to my own application, and does not modify the NumLock setting. So it does not trigger an Access Denied security error message.

                              By the way, placing comdlg32.ocx and grid32.ocx in the uCalc application directory didn't solve anything. So I let the installer put it back in the default system directory (I forgot to mention that in the last beta).

                              Stay tuned for the updated beta, which I plan to announce later.
                              Daniel Corbier
                              uCalc Fast Math Parser
                              uCalc Language Builder
                              sigpic

                              Comment


                              • #16
                                Originally posted by Daniel Corbier View Post
                                Would anyone be interested in me posting a PostMessage-based SendKeys routine in the PB Source Code forum?
                                ---- Yes, I would ..

                                Anyway, my own SendKey using PostMessage ..
                                --- I assume this means that, to call your SendKey function, it needs the controls handle to which the keystrokes must be sent ? This in contrast to the 'other' SendKeys implementations that generally send the keystrokes to whatever control that has focus (even if that control belongs to another application).

                                Kind regards
                                Eddy

                                Comment


                                • #17
                                  Does anyone know how to drop down a menu using SendMessage (or maybe PostMessage)?
                                  If your program can find the window of the "send to" program, you could use TrackPopupMenu() from the "send keys (FROM)" program to show a menu in the correct place, even though the menu will not be owned by the target window.

                                  No reason the user has to know "who owns the menu" as long as it shows up where expected and something happens when he clicks an option, right?

                                  (It's a thought).

                                  If the target (sending TO) program is a cooperating program, you could use TrackPopupMenu() from within that program in response to any SendMessage or other trigger (eg a named event).

                                  However, I have no clue if ANY of this stuff is going to work with a 'Brand M' BASIC program.

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

                                  Comment


                                  • #18
                                    Eddy, yes, you'd need the handle for the control. This is specifically the way I want it in the context of my calculator, for which I already have access to the handles of the controls. (My actual routine currently takes a control name as input, which is easer for the end-user, and the program associates the name with a handle). I haven't tried it, but I assume that using the GetFocus() API or by some other means to get an item's hWnd handle, you'd be able to use an adapted version of the routine to send keystrokes to other applications as well.

                                    Michael, thanks for the tip. As I posted not long before you hit reply, I found a solution. Nonetheless I still looked into TrackPopupMenu just now. The method I used is designed to work with my pre-existing standard menu across the top of the application. Looking at the MSDN I got the impression that I'd need to create a popup menu (with CreatePopupMenu) first before I could use TrackPopupMenu. Is that the case, or does it work with any hMenu handle?
                                    Last edited by Daniel Corbier; 4 Sep 2008, 08:52 AM. Reason: typo
                                    Daniel Corbier
                                    uCalc Fast Math Parser
                                    uCalc Language Builder
                                    sigpic

                                    Comment


                                    • #19
                                      New beta released

                                      A new beta was released. Although there is more work to be done, it is solid enough that I have posted an announcement for it on my own site last night. Here's the download page:

                                      http://www.ucalc.com/download.html

                                      As usual, I hope to get some feedback. The tutorial is meant to demonstrate not just the end-user calculator, but the underlying uCalc Fast Math Parser / Language Builder as well.
                                      Daniel Corbier
                                      uCalc Fast Math Parser
                                      uCalc Language Builder
                                      sigpic

                                      Comment


                                      • #20
                                        Un-install before re-installing

                                        If you have tried an earlier beta prior to the one announced last week (9-3-08), then you may want to either un-install the previous beta before installing the new one, or you can install the new beta in a separate directory. If you try to install the new beta in the same directory as the old one, you may end up with a mix of old and new files, which may cause the tutorial to malfunction in certain places.
                                        Daniel Corbier
                                        uCalc Fast Math Parser
                                        uCalc Language Builder
                                        sigpic

                                        Comment

                                        Working...
                                        X