Announcement

Collapse
No announcement yet.

Creating New Threads For ActiveX Controls At Runtime

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

  • Creating New Threads For ActiveX Controls At Runtime

    The primary reason we purchased PB/DLL 6.0 some months ago was to overcome the horrible limitation Visual Basic 6.0 imposes on threads. We have been working for months on a solution using various workarounds within VB itself, however we've had no success due to the complex nature of our program.

    Our program is very advanced in that we're actually loading ActiveX controls dynamically at runtime. What we need is a PB dll that allows our main program to pass it ActiveX components so they're loaded into a new thread. We understand that thus far this isn't possible because apparently there's no support for this in PB.

    Is there any way at all to do this, or have we wasted our time? We absolutely need the GUI features of VB, which makes 'simply' converting all of our ActiveX controls over to PB dlls impossible.

    We've reached the point where we're going to have to dump PB and VB altogether, so any help is greatly appreciated.

    Thanks in advance,


    Paul Valliere.

    [This message has been edited by Paul Valliere (edited September 02, 2001).]

  • #2
    Paul,

    Be very careful, threads in VB can be very tricky. For example
    if you call your DLL with and the DLL file creates a Thread and
    then it calls back into VB, VB will crash.

    If you need to make a call back to VB you have to make that call
    on the same thread.

    Lance knows more on this subject.

    As far as ACTIVEX, you can use third part tools to use ActiveX
    controls with PB


    ------------------
    -Greg
    -Greg
    [email protected]
    MCP,MCSA,MCSE,MCSD

    Comment


    • #3
      Hi Paul,

      Are you aware of Philippe Monteil's tools which allow PowerBASIC to use COM ? His web site,
      JazzAge Software, is at http://www.jazzagesoft.com .

      Another approach that occurs to me is to use ActiveX exe's ('worker' exe's) to effectively
      simulate multiple threads. I wrote a database server some years ago in VB5 that does just this -
      the worker exe's are out-of-process, but programatically, they are just objects. This may or
      may not be useful in your context.

      Regards,

      Paul


      ------------------
      http://www.zippety.net
      mailto[email protected][email protected]</A>
      Zippety Software, Home of the Lynx Project Explorer
      http://www.zippety.net
      My e-mail

      Comment


      • #4
        Paul,

        <<
        Is there any way at all to do this, or have we wasted our time? We absolutely need the GUI features of VB, which makes 'simply' converting all of our ActiveX controls over the PB dlls impossible.
        >>
        I would suggest to take a look at our JA COM/PB 2.0: it will add
        full support for COM components and for ActiveX controls to PB/DLL.

        A 30 days, full featured Evaluation Version is available
        from our web site.

        Philippe Monteil
        JAZZAge Software
        www.jazzagesoft.com



        ------------------

        Comment


        • #5
          Paul,
          You might want to check out http://www.vbaccelerator.com. They are doing some
          very advanced programming in VB6 including Free-Threaded ActiveX controls. They give
          you the full source code to all controls. Also, check out the book Advanced Visual Basic
          6.0 (http://www.bookpool.com/.x/m6g23ijnp6/ss/1?qs=curland) by Matt Curland. The author was
          on the VB5 development team and shows you exactly how to do all of the things that seem impossible
          using VB6. Like you, I use Powerbasic to do things like Windows Services, etc. that I can't
          do in VB. I have looked at http://www.jazzagesoft.com and I would recommend that you use his stuff
          prior to going to a different language. However, if you set on changing to another language,
          I would suggest you look at VB.Net first. It gives the VB developer all the power of C++ with
          the ease of VB (like the fact that I can use free-threading in a little as three lines of code).
          I'm currently using the Beta 2 to do some very exciting things that I could
          not do with VB6 (or was very difficult).

          HTH,
          Chris Roebuck
          MCSD,MCT

          ------------------

          Comment


          • #6
            As near I can tell, VB.NET is not a BASIC, so much as C++ with some statements renamed with a BASIC style. If you really need to move away from PowerBASIC and Visual Basic altogether, I'd suggest Delphi instead. The syntax and visual design are likely to be more familiar, and you won't be locked into the uncertain future of the unreleased .NET framework.

            You can certainly get there with PowerBASIC, though.

            ------------------
            Tom Hanlin
            PowerBASIC Staff

            Comment


            • #7
              If you go the Delphi route, I'd check out the VB to Delphi converter
              at www.deluxsoftware.com.

              Rich


              ------------------
              _____________________________________________________________________________________
              It's hard when you're up to your armpits in alligators to remember you came here to drain the swamp.
              President Reagan
              February 10, 1982

              Comment


              • #8

                <<and you won't be locked
                <<into the uncertain future of the unreleased .NET framework.
                .NET's future is as 'uncertain' as MS's as a company is, that
                is it is hardly questionable IMO. .NET migth very well become
                the best available development plateform in a near future. Many
                independent articles will explain it better than I will.

                PB has wasted major business oportunities because it has refused
                to take a close and non-biaised look at COM years ago. It was the
                only company in the world capable of releasing a product able to
                get the VB community rid of some of the most severe limitations
                imposed by VB's COM support. VB was not able to produce multi-
                threaded COM components for example, and this was a real problem
                for creating highly-scalable, critical business applications.

                I hope that PB will not use the 'bloatware' excuse once more
                to repeat the same mistake with .NET. The .NET runtime will be
                quickly be integrated in the Windows OSs, the question of its size
                will therefore quickly become irrelevant.

                If VB.NET is not a 'real' Basic anymore, why not release a PB.NET
                compiler and make it become the only 'real' one available?

                Philippe Monteil
                JAZZAge Software




                ------------------

                Comment


                • #9
                  Hmm? When Microsoft Bob went down the tubes, I don't think the company even noticed. I imagine the failure of .NET, should it happen, will cause a bit more ripple; but there's no reason to think that it won't fail just because Microsoft made it. .NET and VB.NET seem completely off-target to me but, that's just my opinion.

                  Of course, Microsoft's failures are often PowerBASIC's gains. No reason to complain about that! And sure, if .NET actually gets off the ground, there is likely to be one or more PowerBASIC compilers for it.

                  Likewise, it seems that PowerBASIC's lack of COM support has been a business opportunity for you as well, with JA/Com. I'd think you'd find no reason to complain about that!

                  There's a wonderful lot of room in the world for new computing solutions. Fortunately for all of us, no one company owns the whole market, nor is it ever likely to do so.

                  ------------------
                  Tom Hanlin
                  PowerBASIC Staff

                  Comment


                  • #10
                    My view: .NET is about ten years too early. It - or something like it - could be pretty well deployed in the 2011-2016 time frame.

                    Of course, I am not betting the farm against Microsoft: anyone with that much cash to spend cannot be ignored.

                    Just as an adjunct: it's so much fun with my new MDSN disk to have to have all the .NET (vulgar euphemism) clutter up my API reference lookups. I guess the Boys From Redmond want me to get in the habit early.

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

                    Comment


                    • #11
                      Under MSDN's View menu, Define Subset will help.

                      ------------------
                      Tom Hanlin
                      PowerBASIC Staff

                      Comment


                      • #12
                        Under MSDN's View menu, Define Subset will help
                        Sometimes it helps, but since you can only select one group at a time, I find it easier to just use Index/Contents/Platform Sdk/etc for "standard" lookups. And it seems I can never get to some of the pages through search, especially the "overviews" of the controls.

                        Oh, well, as long as I can actually locate the API reference and the "see also" links, I guess I should be happy....


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

                        Comment


                        • #13
                          Tom:
                          It seems odd to me that you would recommend Delphi to a VB
                          programmer. First of all, you are turning a programmer away from
                          Basic (and Powerbasic) to Pascal. Secondly, your own company is
                          working on a Linux compiler which Borland already has in its Kylix product.
                          At least if a programmer stays with VB, they could augment the
                          shortcomings with Powerbasic.

                          Also, it is very obvious to me that you have not looked at VB.Net or you
                          would not have made the statement, "VB.Net is not a Basic, so much
                          as C++ with some statements renamed with a Basic style." Yes, VB.Net
                          is different from VB6 in the same way that MFC programming is different
                          from calling API's directly using C++. The C++ language constructs are
                          the same, however the syntax and style is very different. VB.Net
                          is just VB6 with a new MFC library (or in this case the CLR - Common
                          Language Runtime). Now, don't let the word Runtime mislead you, VB.Net
                          is a fully compiled language (compiled to native code). However,
                          in the case of any .Net language, the compiler is actually the CLR.
                          The CLR compiles either at execution time (known as JIT) or at setup
                          time, which is selectable by the programmer. Now, given that the
                          CLR provides native compilation, any platform that has a CLR can be
                          targeted by a .Net application. I think that you will see Microsoft
                          release a CLR for a wide range of platforms. This will provide them
                          with a way of getting extra revenue from their existing products
                          (like Office) without having to rewrite a platform specific version
                          of the product (like Office for the Mac). Microsoft can write an
                          application once which is .Net enabled, and then sell that program
                          to anyone that has the CLR running on their OS. I would not be
                          surprised to see Windows itself ported to the CLR so that it could
                          set on top of any OS and provide a common User Interface. In this
                          way, Microsoft has made the DOJ's case disappear because the computing
                          public can choose any OS and still run their Office applications.
                          Of course, I'm sure Microsoft will charge for the CLR on a different
                          platform (Windows will come with its CLR). In this way, it doesn't
                          matter which OS you have on your computer.

                          Chris Roebuck
                          MCSD, MCT
                          Senior Software Architect

                          ------------------

                          Comment


                          • #14
                            Chris, before jumping up and down, you may wish to review the thread discussion again, especially Tom's response in relation to the previous replies...

                            Thanks!

                            PS: If you think that PowerBASIC has not taken a good look at .NET, well...

                            Anyway, this is getting off topic for this forum...

                            ------------------
                            Lance
                            PowerBASIC Support
                            mailto:[email protected][email protected]</A>
                            Lance
                            mailto:[email protected]

                            Comment


                            • #15
                              All those acronyms dizzy me

                              ------------------
                              Kev G Peel
                              KGP Software, Bridgwater, UK.
                              mailto:[email protected][email protected]</A>
                              kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                              Comment


                              • #16
                                <<PS: If you think that PowerBASIC has not taken a good look at .NET, well...
                                And what does PB think of .NET?

                                Philippe



                                ------------------

                                Comment


                                • #17
                                  It would be inappropriate for Tech Support to offer any comment...

                                  ------------------
                                  Lance
                                  PowerBASIC Support
                                  mailto:[email protected][email protected]</A>
                                  Lance
                                  mailto:[email protected]

                                  Comment

                                  Working...
                                  X