Announcement

Collapse
No announcement yet.

Which To Purchase

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

  • Which To Purchase

    This is my first post here. I've been a member for a while, but never have written anything. I've been writing programs of various types since 1988, and have used quite a few languages and platforms.

    Quite a few years ago, more than I want to count, I purchased PB-DOS 3.2. I still have all the materials and media.

    I've mostly used Microsoft products as this is what I learned with in college. I used VB6 the most. I have issues with their .Net family. They seem to be "interpreted". What I mean is, every line of code that executes requires a jumping-out to .Net Framework. In simpler terms, the more code you have, the slower an app will run, regardless of efficiency.

    Data types also have been an issue for me. Historically, if you wanted to work with very large numbers, the "Double" data type was all you had. There were no large integer types. .Net has UInt64 and ULong, unsigned 64-bit integers. If memory serves, PB has/had a "Quad" type. It was also 64-bit, but signed. Why all the commentary about type sizes? One of my programming hobbies is prime numbers. Sometimes, very large.

    Currently, PB has two flavors, console and Windows. Console requires setting aside everyone one knows about form applications and falling back on the DOS Basic style of writing. One thing I like about VB is how the form designer is fully integrated into the coding area. Click on an object in the form view, and the code dialog appears for the object. I do not know if PB Windows does this or not. I never had to learn how to write code to create a form, and am not about to start now.

    The bottom line, I am not happy with Microsoft's current offerings and am looking for alternatives. If PB Windows can do the things I have described then I will look at it very hard. A demo would be nice, but I know that is not an option here.

    Thank you.


  • #2
    PB 9 with PBForms and a moneyback guarantee - you can't go wrong. Not to mention the support from this board (second to none) and the continual development behind the scenes. Go for it!

    Iain Johnstone
    “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

    Comment


    • #3
      One thing I like about VB is how the form designer is fully integrated into the coding area. Click on an object in the form view, and the code dialog appears for the object.
      You may want to experiment with the FireFly Visual Designer at http://www.planetsquires.com

      Oh, and Version 3 is finally almost ready to be released as well.

      Paul Squires
      FireFly Visual Designer (for PowerBASIC Windows 10+)
      Version 3 now available.
      http://www.planetsquires.com

      Comment


      • #4
        FireFly sounds like what you want. It makes the migration easy and painless for VBers. Paul, the guy behind FireFly, is just as top-notch as his product.

        Comment


        • #5
          Don't knock PBCC either...

          Even though I have both, and have used VB, VC, Delphi, Borland C++Builder, etc for years I find that my current programmings is mostly PBCC and php.

          with PBWin taking a distant 3rd (though I've got a win project starting soon).

          JS
          John,
          --------------------------------
          John Strasser
          Phone: 480 - 273 - 8798

          Comment


          • #6
            >One thing I like about VB is how the form designer
            > is fully integrated into the coding area.

            PB/Windows does not include an integral form designer, so you will have to forget all your VB stuff anyway. PB/Forms (licensed separately) produces code which does the VERY basic screen and control creation, but you have to code all the actions (eg "on_click") yourself anyway. (And you don't use "on_click", you use WM_COMMAND message processing).


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

            Comment


            • #7
              PB for Windows has DDT, a non-visual framework which lets you create a form with a single line of code and add controls with a single line each. Of course it's not really quite that simple, but almost.

              I also have little GUI programming experience and I know little about Windows programming. I only do lightweight playing around with programming since I retired so I'm not motivated to learn a lot about it.

              I've tried PB for Windows by itself and I've bought most of the visual designers for PB and tried them. For simple stuff, which is all I do, I find PB by itself to be the easy way to do things. If I was going to do something larger I'd probably get serious about learning Firefly or EZGUI, both of which I have and both of which seem like excellent tools. But they make simple programming more complicated. I think they need complex problems to solve before they show their worth.

              I also tried some of the competitor's Basics, most of which do have built-in form designers, and I found it easier to use them without their form designers, again, just for simple programs.

              Barry

              Comment


              • #8
                In addition:
                PB9 creates DLL's that can be called from VB6.
                CMD shortcut to open any location:
                %windir%\system32\cmd.exe /k " cd\ & x: & cd x:\xxxx
                Change to run as administrator
                How long is an idea? Write it down.

                Comment


                • #9
                  If you’re coming from PBDOS, QuickBasic or other DOS compiler, buy either PBCC or PBWin, depending how big a jump you want to make, smaller or huge.

                  If you’re coming from Visual Basic, buy PBWin.

                  Almost all the difference between DOS and Windows compilers is in how you code input/output. Computation instructions in Windows compilers are either the same as in DOS compilers, the same with enhanced features, or almost the same. And even with input/output they are frequently nearly the same, but different enough that there is much to learn – in programming it’s always “close but no cigar.”

                  Two things VB does very nicely:
                  1. The code for form layout (buttons, sizes, position, etc) – usually fixed when the program runs – is automatically separate from the “working code” behind it. VB automatically places the “form code” in a separate file and you can just ignore it, even as you view the form. (You can add such “form layout” code to the “working code” so you do have total contral at run time as well if you want it.)
                  2. You code for different events simply by naming subroutines. For example: Sub ButtonName_Click, Sub Form_KeyPress. The first subroutine gets called when ButtonName is clicked, the second when a key is pressed when Form has the focus.

                  What about PBWin? Though expert in VB and PBCC (except the Internet stuff) I haven’t used PBWin. As far as I can tell PBWin doesn’t do either of the above. You can simulate the separation mentioned in (1) by judicious use of include files, though it’s not automatic. (2) is out entirely, you must write a “message” handler. (On the other hand I gather that gives you finer control over handling events.) I’m sure it’s not hard, but it’s different.

                  Another difference between VB and at least PBCC is the way you specify the scope of variables. In VB if you place Dim outside the subroutines, that makes it global, if you place it inside a subroutine it is local, and this whether it’s a simple variable or an array). In PBCC (at least) you must use the keyword Global instead of Dim for globals, and for arrays you must in addition put a Dim for it in a subroutine, doesn’t matter which.

                  Maybe one day PowerBasic, Inc will offer a more or less VB knockoff, with the famous faster/smaller executable (not to mention that you can’t decompile so easily). Seems I remember reading some people tried to write a sort of shell program that looks like VB while using PBCC as the “engine”, but it didn’t work out.
                  Last edited by Mark Hunter; 3 Oct 2009, 04:18 PM.
                  Politically incorrect signatures about immigration patriots are forbidden. Searching “immigration patriots” is forbidden. Thinking about searching ... well, don’t even think about it.

                  Comment


                  • #10
                    >Maybe one day PowerBasic, Inc will offer a more or less VB knockoff

                    Say What?

                    While I have had a few differences of opinion about what their products 'should' be in the nearly twenty years I have been a PowerBASIC customer, those products have never been a 'knockoff' of anything; and as best I can determine from out here in the Cheese Capital of the World, they never will be..... for which I am both grateful and appreciative.

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

                    Comment


                    • #11
                      Dwayne, I had a brief experience with VB (far too confining), a fling with C (too obscure), a brush with Assembly (tedious) and fairly long experience with various DOS Basics (no Windows capability).

                      What it boils down to for me is PBWin gives the maximum amount of control over what's happening with the most flexibility with the least amount of confusion in a Windows world. There is, however, a learning curve but for someone with decent programming experience in various languages, it should be very short. The biggest hurdle, imo, is just how much freedom and latitude PBWin affords and it takes a bit to get used to.

                      There are several Form creation programs available for PBWin that are very good to help get started if one is so inclined but I like to freedom to Roll MY Own (I found them to be confining as well).

                      In any case the best thing about PBWin are these Forums. Lots of help here for any skill level. (Though I have long wished there was a DDT only Forum where newbies especially could post without the cryptic API guys sticking their beaks in, confusing things even more for beginners.)

                      ===================================
                      Speech is human,
                      silence is divine,
                      yet also brutish and dead:
                      therefore we must learn both arts.
                      Thomas Carlyle
                      ===================================
                      It's a pretty day. I hope you enjoy it.

                      Gösta

                      JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                      LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                      Comment


                      • #12
                        without the cryptic API guys sticking their beaks in.


                        Paul Squires
                        FireFly Visual Designer (for PowerBASIC Windows 10+)
                        Version 3 now available.
                        http://www.planetsquires.com

                        Comment


                        • #13
                          Maybe one day PowerBasic, Inc will offer a more or less VB knockoff
                          Please don't speak such blasphemy against Bob.

                          Comment


                          • #14
                            Very poor choice of words, “knockoff”!

                            I do like – and obviously a lot of people like – the way VB works as far as the basics (I mentioned two things in my last post). The fact that there was an effort, even though unsuccessful, to make a “better VB” by wrapping a sort of meta-compiler around PBCC (or was it PBWin?) shows that VB’s methods are still popular – and that PB’s executables are better than VB’s. I’m sure anything PowerBasic, Inc might do in this line would be superior to VB, not a “knockoff”.

                            I work with engineers and VB 6 is still a mainstay. They use it for computations, working with simple sequential files, graphics. Not the internet or database features.

                            Microsoft abandoned QuickBasic and left the market to other products, PBDOS being the best. Microsoft abandoned VisualBasic and – unless you consider NET is VB 7 (rather a stretch) – left the market to PBWin. But PBWin is not as much to VB as BPDOS is to QB.

                            It’s not all or nothing. The two VB features I mentioned in my last post might be incorporated in PBWin. To repeat, at this point I haven’t used it (I bought a copy during the recent sale). Maybe I’ll change my tune when I become expert. I plan to do my next major application in PBWin – even though I have VB 6.
                            Last edited by Mark Hunter; 4 Oct 2009, 01:19 AM.
                            Politically incorrect signatures about immigration patriots are forbidden. Searching “immigration patriots” is forbidden. Thinking about searching ... well, don’t even think about it.

                            Comment


                            • #15
                              I thread, subclass and transfer over the internet by calling a PB/DLL
                              from VB6. This also gives the ability to use COM. Write the code
                              once, put it into the DLL and move on. No continual recompiling the
                              same code or having to distribute it many times.
                              CMD shortcut to open any location:
                              %windir%\system32\cmd.exe /k " cd\ & x: & cd x:\xxxx
                              Change to run as administrator
                              How long is an idea? Write it down.

                              Comment


                              • #16
                                Dwayne,

                                You really can't go wrong with PB no matter which version you choose. I have both PBWin and PBCC so I'm covered no matter which way I decide to program, and BTW, PB products are reasonably priced.

                                If you want demos look at the forums, there is a lot to choose from, and if you don't understand a Windows concept, just post your question here and you will be surprised how soon you will receive an answer. There is a large knowledgeable group of people who participate regularly in these forums, a great resource. Another source of demos is POFFS.

                                I have used AutoCAD, Excel and MOSS(a 3D surface modeling program) under a VB6 umbrella for civil engineering calculations and plan preparation using VB6's capability to access objects. Now that PB supports classes makes it just that much easier to incorporate and use objects from other softwares at PB speed of execution. As easy as it was to interface with the three applications I mentioned earlier using VB6, I was disappointed with the overall performance of VB, it tended to be very slow. That being said I was able to calculate and generate between 60%-70% of my project plan sheets in about 20 minutes using VB. I would estimate I could cut that time between 25% - 50% using PB.

                                I can say that if you do want to emulate the VB object/event model one way to do it is through the combination of PB objects and subclassing PB controls. While there are inevitable differences between VB and PB they are not insurmountable and whatever you can do with VB you can do with PB.
                                Later...

                                JR

                                "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                                Comment


                                • #17
                                  Here's what would be nice: A VB6 clone, that was free/opensource, which would excite/draw all VB6 programmers from around the world (there are millions of them) who would then have a REASON to buy PBWIN!!!!!!!!!

                                  Just my 2c worth -- go ahead and flame if you must.

                                  Jim

                                  ---snip---
                                  Originally posted by Michael Mattias View Post
                                  >Maybe one day PowerBasic, Inc will offer a more or less VB knockoff

                                  Say What?

                                  While I have had a few differences of opinion about what their products 'should' be in the nearly twenty years I have been a PowerBASIC customer, those products have never been a 'knockoff' of anything; and as best I can determine from out here in the Cheese Capital of the World, they never will be..... for which I am both grateful and appreciative.

                                  MCM
                                  3.14159265358979323846264338327950
                                  "Ok, yes... I like pie... um, I meant, pi."

                                  Comment


                                  • #18
                                    Mike,

                                    Would you ever consider sharing a source-code example of your PBWIN DLL and VB6 programs??

                                    Thx! : )
                                    Jim

                                    Originally posted by Mike Doty View Post
                                    I thread, subclass and transfer over the internet by calling a PB/DLL
                                    from VB6. This also gives the ability to use COM. Write the code
                                    once, put it into the DLL and move on. No continual recompiling the
                                    same code or having to distribute it many times.
                                    3.14159265358979323846264338327950
                                    "Ok, yes... I like pie... um, I meant, pi."

                                    Comment


                                    • #19
                                      Not until after lunch.
                                      CMD shortcut to open any location:
                                      %windir%\system32\cmd.exe /k " cd\ & x: & cd x:\xxxx
                                      Change to run as administrator
                                      How long is an idea? Write it down.

                                      Comment


                                      • #20
                                        Not sure if I posted a demo for this. I will checkout this afternoon.

                                        Code:
                                        '-------  VB CODE ----------------------------------------------------------
                                        Public Const GWL_WNDPROC = (-4) ' This we recognize as the constant for accessing the callback address
                                        Public lngOldProc As Long ' This is for preserving the old address of the callback
                                         
                                         
                                         
                                         
                                         
                                         
                                        Public g As Globals
                                        'Public gSystemMilliseconds As Long
                                        Public gAction As Long    'trying to do things in background.dll
                                        'SetTimer is paused by SLEEP and TCP CONNECT
                                        'To overcome this, writing TIMER as a THREAD
                                        Declare Sub background Lib "background.dll" Alias "BACKGROUND" (sQuestion As String, sAnswer As String)
                                        Declare Sub BACKGROUND2 Lib "background.dll" (sQuestion As String, sAnswer As String)
                                        Declare Sub DTIMER Lib "background.dll" (Action As Long)
                                        Declare Sub SLEEPER Lib "background.dll" (Milliseconds As Long)
                                        Declare Sub TESTSENDMESSAGE Lib "background.dll" (hControl As Long)
                                        Declare Sub TESTCALLBACK Lib "background.dll" ()
                                        Declare Sub STARTSUBCLASS Lib "background.dll" (hControl As Long)
                                        Declare Function ENDSUBCLASS Lib "background.dll" () As Long
                                        Declare Function GETTHREADCOUNT Lib "background.dll" () As Long
                                         
                                         
                                         
                                         
                                         
                                         
                                         
                                         
                                         
                                        Private Sub Form_Load()
                                          ChDir App.Path
                                          Command1.Caption = "Test"
                                          STARTSUBCLASS List1.hWnd
                                        End Sub
                                        Private Sub Form_QueryUnload(CANCEL As Integer, UnloadMode As Integer)
                                          ENDSUBCLASS 'required if subclassing
                                        End Sub
                                        Sub DisplayThreadCount()
                                          Dim count As Long
                                          count = GETTHREADCOUNT - 1
                                          If count Then
                                            Me.Label1.Caption = "Extra threads" + Str$(GETTHREADCOUNT - 1)
                                          Else
                                            Me.Label1.Caption = "No extra threads"
                                          End If
                                        End Sub
                                        Sub DisplayThreadCount()
                                          Dim count As Long
                                          count = GETTHREADCOUNT - 1
                                          If count Then
                                            Me.Label1.Caption = "Extra threads" + Str$(GETTHREADCOUNT - 1)
                                          Else
                                            Me.Label1.Caption = "No extra threads"
                                          End If
                                        End Sub
                                         
                                        '----------------------------   End of VB code ----------------------------------
                                         
                                        '------------------------------  PB  CODE  --------------------------------------
                                        'This all compiles into background.dll
                                        Type Globals
                                          SplashTimeOut As Long
                                          SystemMilliseconds As Long
                                          Connected     As Long
                                          ServerName    As String
                                          PortNumber    As Long
                                          Busy          As Long
                                        End Type
                                        #COMPILE DLL "background.dll"  'Test while working in PB
                                        #COMPILE EXE "background.exe"  'test your code while using PB
                                        #INCLUDE "win32api.inc"
                                        '------------------------------------------------------------------------------------
                                        REM Remark line below to test this code as an EXE
                                        'DECLARE SUB BACKGROUND LIB "background.dll"(sQuestion AS STRING, sAnswer AS STRING)
                                        '-----------------------------------------------------------------------------------
                                        %CallBack = &H300
                                        GLOBAL gControl    AS LONG
                                        GLOBAL gPrevWndProc AS LONG
                                        GLOBAL gCS AS CRITICAL_SECTION
                                        GLOBAL g_Question$, g_Answer$,gCounter AS DWORD
                                        GLOBAL gBeep AS LONG, gAction AS LONG
                                        '--------------------------------------------------------------
                                        SUB Background(sQuestion AS STRING, sAnswer AS STRING) EXPORT
                                          LOCAL hThread, Result AS DWORD
                                          EnterCritical
                                          INCR gCounter               'lets be sure they are coming back correctly
                                          g_Question = sQuestion
                                          LeaveCritical
                                          THREAD CREATE BackGroundThread(hThread) TO hThread
                                          IF hThread = 0 THEN ? "Unable to create thread":EXIT SUB
                                          SLEEP 50
                                          DO
                                            DIALOG DOEVENTS 0                'allow others time
                                            THREAD STATUS hThread TO Result  'get thread status
                                          LOOP WHILE Result = &H103          'loop while running
                                          THREAD CLOSE hThread TO Result     'close thread handle
                                          IF Result = 0 THEN ? "Error closing thread"
                                          EnterCritical
                                          sAnswer = g_Answer                 'return answer from background thread
                                          LeaveCritical
                                        END SUB
                                        SUB Background2(sQuestion AS STRING, sAnswer AS STRING) EXPORT
                                          'NO SLEEP or WAIT in this function (this in first thrread)
                                          LOCAL hThread, Result AS DWORD
                                          EnterCritical
                                          INCR gCounter               'lets be sure they are coming back correctly
                                          g_Question = sQuestion
                                          LeaveCritical
                                          THREAD CREATE BackGroundThread2(hThread) TO hThread
                                          IF hThread = 0 THEN ? "Unable to create thread":EXIT SUB
                                          SLEEP 50  'put back, later
                                          DO
                                            DIALOG DOEVENTS 0                'allow others time
                                            THREAD STATUS hThread TO Result  'get thread status
                                          LOOP WHILE Result = &H103          'loop while running
                                          THREAD CLOSE hThread TO Result     'close thread handle
                                          IF Result = 0 THEN ? "Error closing thread"
                                          EnterCritical
                                          sAnswer = g_Answer                 'return answer from background thread
                                          LeaveCritical
                                        END SUB
                                        '--------------------------------------------------------------
                                        THREAD FUNCTION BackGroundThread(BYVAL dummy AS DWORD) AS DWORD
                                          LOCAL sQuestion AS STRING
                                          LOCAL sAnswer   AS STRING
                                        EnterCritical
                                          sQuestion = g_Question
                                          SELECT CASE sQuestion
                                            CASE ""
                                              sAnswer = "No question, gCounter" + STR$(gCounter)
                                            CASE ELSE
                                              sAnswer = TIME$ + " " + sQuestion + " gcounter" + STR$(gCounter)
                                           END SELECT
                                          g_Answer = sAnswer
                                        LeaveCritical
                                          'MSGBOX "Stuck here in BackgroundThread 1"
                                        END FUNCTION
                                        '--------------------------------------------------------------
                                        THREAD FUNCTION BackGroundThread2(BYVAL dummy AS DWORD) AS DWORD
                                          LOCAL sQuestion AS STRING
                                          LOCAL sAnswer   AS STRING
                                        EnterCritical
                                          sQuestion = g_Question
                                          SELECT CASE sQuestion
                                            CASE ""
                                              sAnswer = "No question, gCounter" + STR$(gCounter)
                                            CASE ELSE
                                              sAnswer = TIME$ + " " + sQuestion + " gcounter" + STR$(gCounter)
                                           END SELECT
                                          g_Answer = sAnswer
                                        LeaveCritical
                                          'MSGBOX "Stuck here in BackgroundThread 2"
                                        END FUNCTION
                                        '--------------------------------------------------------------
                                        FUNCTION GetThreadCount EXPORT AS LONG 'VB uses to not end until threadcount = 1
                                          FUNCTION = THREADCOUNT
                                        END FUNCTION
                                        '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                        SUB EnterCritical
                                           EnterCriticalSection gCS
                                        END SUB
                                        '--------------------------------------------------------------
                                        SUB LeaveCritical
                                           LeaveCriticalSection gCS
                                        END SUB
                                         
                                        FUNCTION LIBMAIN(BYVAL hInstance AS DWORD, _
                                                         BYVAL lReason AS LONG,    _
                                                         BYVAL lReserved AS LONG) AS LONG
                                          SELECT CASE AS LONG lReason
                                            CASE %DLL_PROCESS_ATTACH
                                              '? "DLL attached"
                                              InitializeCriticalSection gCS
                                              LIBMAIN = 1
                                              EXIT FUNCTION
                                            CASE %DLL_PROCESS_DETACH
                                              '? "This DLL is about to be unloaded
                                               DeleteCriticalSection gCS
                                                  EXIT FUNCTION
                                            CASE %DLL_THREAD_ATTACH
                                              '? "A [New] thread is starting (see THREADID)
                                              EXIT FUNCTION
                                            CASE %DLL_THREAD_DETACH
                                              '? "This thread is closing (see THREADID)
                                              EXIT FUNCTION
                                          END SELECT
                                          LIBMAIN = 0
                                          ? "Failure to initialize the DLL!
                                        END FUNCTION
                                         
                                        SUB DTimer(Action AS LONG) EXPORT    'Integer corresponds to boolean in VB6
                                          EnterCritical
                                          gAction = Action
                                         
                                          LOCAL hThread AS LONG
                                          SELECT CASE Action
                                            CASE 0
                                                gBeep = 0       'threads will finish
                                            CASE 1,3
                                              gBeep = 1
                                              gAction = Action
                                              THREAD CREATE dTimerThread(hThread) TO hThread
                                              IF hThread = 0 THEN ? "Unable to create thread":EXIT SUB
                                              THREAD CLOSE hThread TO hThread
                                              SLEEP 50
                                              REM ? "ThreadCount" + STR$(ThreadCount)
                                            CASE 1000,2000,3000
                                              sleeper Action
                                            CASE ELSE
                                              gAction = Action
                                          END SELECT
                                          LeaveCritical
                                        END SUB
                                         
                                        THREAD FUNCTION DTimerThread(BYVAL y AS DWORD) AS DWORD
                                          'Called while within a critical section
                                          DIM Action AS LONG
                                          Action = gAction       'assign global action savely to action
                                          gAction = 0            'unassign action quickly
                                          DO
                                            SELECT CASE Action   'use action to do whatever
                                              CASE 3
                                                 EXIT LOOP
                                            END SELECT
                                            SLEEP 100
                                          LOOP WHILE gBeep
                                          IF Action = 3 THEN
                                            ? "CASE 3. Click to end this extra thread",%MB_SYSTEMMODAL
                                          END IF
                                        END FUNCTION
                                         
                                        FUNCTION Sleeper (milliseconds AS DWORD) EXPORT AS LONG   'runs in another thread
                                          LOCAL hThread AS DWORD
                                          LOCAL result  AS DWORD
                                          LOCAL ExitCode AS DWORD
                                          'IF LEN(COMMAND$) THEN                'override passed value
                                          '  milliseconds = ABS(VAL(COMMAND$))  'use value in COMMAND$
                                          'END IF
                                          THREAD CREATE TimedMessageBoxThread(milliseconds) TO hThread
                                          IF hThread THEN
                                            SLEEP 50
                                            'WaitForSingleObject hThread, milliseconds
                                            'THREAD SUSPEND hThread TO lResult&         'stops in tracks, not good
                                            REM result = TerminateThread(hThread, exitCode) 'never, ever use this
                                            THREAD CLOSE hThread TO Result
                                          END IF
                                         END FUNCTION
                                        THREAD FUNCTION TimedMessageBoxThread(BYVAL milliseconds AS DWORD) AS LONG
                                           BEEP
                                           SLEEP milliseconds
                                           BEEP
                                        '#IF %DEF(%PB_CC32)
                                        '  ? "Press ENTER to continue or WAIT" + STR$(milliseconds) + " milliseconds"
                                        '  WAITKEY$
                                        '#ELSE
                                        '  ? "Click OK to continue or WAIT" + STR$(milliseconds) + " milliseconds"
                                        '#ENDIF
                                        END FUNCTION
                                        SUB CallVb EXPORT
                                          STATIC counter AS LONG
                                          LOCAL s AS STRING        'use STRPTR with dynamic strings
                                          LOCAL lResult   AS LONG
                                          LOCAL dwHandle  AS DWORD
                                          LOCAL dwMsg     AS DWORD
                                          LOCAL dwParam   AS DWORD
                                          LOCAL lParam    AS LONG
                                          dwHandle = gControl        'listbox
                                          'dwMsg    = &H300
                                          '%LB_ADDSTRING          = &H180
                                          '%LB_INSERTSTRING       = &H181
                                          dwMsg = %LB_ADDSTRING   'listbox addstring
                                          INCR counter
                                          s = "TEST COMPLETE" + STR$(counter)
                                          dwParam = LEN(s)      'length
                                          lParam = STRPTR(s)    'address
                                          lResult = SendMessage(dwHandle,dwMsg,dwParam,lParam)
                                          'msgbox s + " " + str$(dwHandle)
                                        END SUB
                                         
                                        FUNCTION Peeker(Address AS DWORD, Characters AS LONG) EXPORT AS STRING
                                          FUNCTION  = PEEK$(address???, characters)
                                        END FUNCTION
                                        SUB StartSubClass(h AS LONG) EXPORT
                                          gControl = h
                                          gPrevWndProc = SetWindowLong(h, %GWL_WNDPROC, CODEPTR (pMyWindowProc))
                                        END SUB
                                        SUB EndSubClass() EXPORT
                                          'Form1.List1.Clear
                                          'Form1.List1.AddItem "SetWindowLong using glPrevWndProc" + Str$(glPrevWndProc)
                                          CALL SetWindowLong(gControl, %GWL_WNDPROC, gPrevWndProc)  'restore old address
                                          gControl = 0
                                        END SUB
                                        FUNCTION pMyWindowProc(BYVAL gControl AS LONG, BYVAL uMsg AS LONG, _
                                            BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
                                          IF uMsg = &H300 THEN
                                            DIM s AS STRING
                                            s = PEEKER(lParam, wParam)
                                            EXIT FUNCTION
                                          END IF
                                        pMyWindowProc = CallWindowProc(gPrevWndProc, gControl, uMsg, wParam, lParam)
                                        END FUNCTION
                                        SUB TestCallBack EXPORT
                                          IF gControl = 0 THEN ? "Subclass is not on":EXIT SUB
                                          STATIC Counter AS LONG
                                          LOCAL s       AS STRING
                                          LOCAL wParam  AS DWORD
                                          LOCAL lParam  AS LONG
                                          INCR Counter
                                          s = "Callback string" + STR$(Counter)
                                          wParam = LEN(s)
                                          lParam = STRPTR(s)
                                          SendMessage gControl,%Callback,wParam,lParam 'let callback handle it
                                        END SUB
                                        SUB TestSendMessage(hControl AS LONG) EXPORT
                                          IF hControl = 0 THEN ? "Need handle":EXIT SUB
                                          STATIC Counter AS LONG
                                          LOCAL s AS STRING
                                          INCR Counter
                                          s = "SendMessage direct to control" + STR$(counter)
                                          SendMessage(hControl,%LB_ADDSTRING,%NULL,STRPTR(s))
                                        END SUB
                                        Last edited by Mike Doty; 8 Oct 2009, 04:07 PM.
                                        CMD shortcut to open any location:
                                        %windir%\system32\cmd.exe /k " cd\ & x: & cd x:\xxxx
                                        Change to run as administrator
                                        How long is an idea? Write it down.

                                        Comment

                                        Working...
                                        X