Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Expletive Deleted

Expletive Deleted

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
37 Posts 15 Posters 27 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A AspDotNetDev

    :laugh: Perhaps they had to run lengthy jobs while they slept, and had it beep to wake them up in case anything went wrong?

    Thou mewling ill-breeding pignut!

    P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #9

    I've done that.

    1 Reply Last reply
    0
    • A AspDotNetDev

      :laugh: Perhaps they had to run lengthy jobs while they slept, and had it beep to wake them up in case anything went wrong?

      Thou mewling ill-breeding pignut!

      R Offline
      R Offline
      Rob Grainger
      wrote on last edited by
      #10

      I always thought that was what the keyboard auto-repeat beeps were for - to notify you that you've nodded off at your keyboard.

      "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

      1 Reply Last reply
      0
      • R Rob Grainger

        Yet another delight from the VB6 rewrite...

        ' Read a setting from XXXX.ini
        Function GetINI(heading As String, setting As String, iniPath As String)
        Dim temp As String * 120
        Dim ret As Long

        If iniPath = "Default" Then
            iniPath = gl\_DatabaseDir & "\\XXXX.ini"
        End If
        
        ret = GetPrivateProfileString(heading, setting, iniPath, temp, Len(temp), iniPath)
        
        If ret = 0 Then
            Beep            ' Really ?
        Else
            GetINI = Trim(temp)
        End If
        

        End Function

        I think this is like pre-watershed television, where expletives are covered by a beep. It's also worth considering that none of our PC's have a speaker ;-)

        "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

        C Offline
        C Offline
        Corporal Agarn
        wrote on last edited by
        #11

        Back in the day a beep was a good thing to have. So what did you replace it with when you rewrote the vb6 code? :-D

        R 1 Reply Last reply
        0
        • A AspDotNetDev

          :laugh: Perhaps they had to run lengthy jobs while they slept, and had it beep to wake them up in case anything went wrong?

          Thou mewling ill-breeding pignut!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #12

          A beep wouldn't wake you up unless you're a mosquito :-)

          R A 2 Replies Last reply
          0
          • L Lost User

            A beep wouldn't wake you up unless you're a mosquito :-)

            R Offline
            R Offline
            Rob Grainger
            wrote on last edited by
            #13

            Especially not here, where PC speakers are disconnected by company policy.

            "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

            1 Reply Last reply
            0
            • C Corporal Agarn

              Back in the day a beep was a good thing to have. So what did you replace it with when you rewrote the vb6 code? :-D

              R Offline
              R Offline
              Rob Grainger
              wrote on last edited by
              #14

              There are two parts: 1. We now use a .config file to store these settings. Reading these is done during app startup. If errors occur, either (a) a message is shown to the user if the settings is required, or (b) an entry is made in a log if the entry is non-critical. 2. The original coding loaded the settings within a VB Form. I've migrated this to app startup code, so the errors (a) raise an exception so they can be reported back to the user in a more managed way. The old app has the business logic entirely in VB forms, in the new version almost all business logic is in C# classes, the (WPF) forms have minimal code to set the data context for the form to an appropriate view model object.

              "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

              1 Reply Last reply
              0
              • L Lost User

                A beep wouldn't wake you up unless you're a mosquito :-)

                A Offline
                A Offline
                AspDotNetDev
                wrote on last edited by
                #15

                I'd wake up if an ant farted.

                Thou mewling ill-breeding pignut!

                I 1 Reply Last reply
                0
                • R Rob Grainger

                  Yet another delight from the VB6 rewrite...

                  ' Read a setting from XXXX.ini
                  Function GetINI(heading As String, setting As String, iniPath As String)
                  Dim temp As String * 120
                  Dim ret As Long

                  If iniPath = "Default" Then
                      iniPath = gl\_DatabaseDir & "\\XXXX.ini"
                  End If
                  
                  ret = GetPrivateProfileString(heading, setting, iniPath, temp, Len(temp), iniPath)
                  
                  If ret = 0 Then
                      Beep            ' Really ?
                  Else
                      GetINI = Trim(temp)
                  End If
                  

                  End Function

                  I think this is like pre-watershed television, where expletives are covered by a beep. It's also worth considering that none of our PC's have a speaker ;-)

                  "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                  E Offline
                  E Offline
                  ExcellentOrg
                  wrote on last edited by
                  #16

                  Don't underestimate "beeps". I know one wizard of Oz who writes batch mode applications (each averages 30 mins of run time) and over years, he has evolved this beeps thingy into the state of art. Most days, his daily task comprises of starting the comps, setting batch jobs, set them running and then loiter around in office all day. He can be at other end of room and just by hearing meaningless (to me) sequence of beeps, he can tell which batch job which started finished. For those not directly involved with his work, it is a sight to see whenever his batch jobs fail and he gets desk-bound for hours. Guess where the beeps are coming from in those days? His mouth!! (And it ain't pre-watershed telly!!!)

                  1 Reply Last reply
                  0
                  • R Rob Grainger

                    Yet another delight from the VB6 rewrite...

                    ' Read a setting from XXXX.ini
                    Function GetINI(heading As String, setting As String, iniPath As String)
                    Dim temp As String * 120
                    Dim ret As Long

                    If iniPath = "Default" Then
                        iniPath = gl\_DatabaseDir & "\\XXXX.ini"
                    End If
                    
                    ret = GetPrivateProfileString(heading, setting, iniPath, temp, Len(temp), iniPath)
                    
                    If ret = 0 Then
                        Beep            ' Really ?
                    Else
                        GetINI = Trim(temp)
                    End If
                    

                    End Function

                    I think this is like pre-watershed television, where expletives are covered by a beep. It's also worth considering that none of our PC's have a speaker ;-)

                    "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                    L Offline
                    L Offline
                    Lee Chetwynd
                    wrote on last edited by
                    #17

                    Rob Grainger wrote:

                    It's also worth considering that none of our PC's have a speaker ;-)

                    Surprisingly, someone asked me for an internal speaker beep to be added to a VB6 application recently, for users without speakers. I had a look into it and, ignoring the fact that there would probably not be an internal speaker, a modern Windows O/S will divert the beep to the soundcard if there is one (even if its integrated) which needs speakers. So unless you have a machine with an internal speaker running Windows 98 or something, it just won’t do anything. For some reason that made me feel sad and I briefly missed not being able to make things beep in such a simple manner!

                    1 Reply Last reply
                    0
                    • V vonb

                      If this function is called many times from different threads and by some reason the XXXX.ini cannot be found, the result will be: beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep;beep; ctrl+Alt+Delete --> Task Manager --> End Process Imagine if it's a night over batch...

                      The signature is in building process.. Please wait...

                      L Offline
                      L Offline
                      Le Poete
                      wrote on last edited by
                      #18

                      vonb wrote:

                      If this function is called many times from different threads

                      VB6, threads! That made my day :-)

                      M 1 Reply Last reply
                      0
                      • R Rob Grainger

                        Yet another delight from the VB6 rewrite...

                        ' Read a setting from XXXX.ini
                        Function GetINI(heading As String, setting As String, iniPath As String)
                        Dim temp As String * 120
                        Dim ret As Long

                        If iniPath = "Default" Then
                            iniPath = gl\_DatabaseDir & "\\XXXX.ini"
                        End If
                        
                        ret = GetPrivateProfileString(heading, setting, iniPath, temp, Len(temp), iniPath)
                        
                        If ret = 0 Then
                            Beep            ' Really ?
                        Else
                            GetINI = Trim(temp)
                        End If
                        

                        End Function

                        I think this is like pre-watershed television, where expletives are covered by a beep. It's also worth considering that none of our PC's have a speaker ;-)

                        "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                        D Offline
                        D Offline
                        donbsc
                        wrote on last edited by
                        #19

                        There must be a lot of VB6 code in those darn smoke detectors!

                        1 Reply Last reply
                        0
                        • R Rob Grainger

                          Yet another delight from the VB6 rewrite...

                          ' Read a setting from XXXX.ini
                          Function GetINI(heading As String, setting As String, iniPath As String)
                          Dim temp As String * 120
                          Dim ret As Long

                          If iniPath = "Default" Then
                              iniPath = gl\_DatabaseDir & "\\XXXX.ini"
                          End If
                          
                          ret = GetPrivateProfileString(heading, setting, iniPath, temp, Len(temp), iniPath)
                          
                          If ret = 0 Then
                              Beep            ' Really ?
                          Else
                              GetINI = Trim(temp)
                          End If
                          

                          End Function

                          I think this is like pre-watershed television, where expletives are covered by a beep. It's also worth considering that none of our PC's have a speaker ;-)

                          "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                          R Offline
                          R Offline
                          RafagaX
                          wrote on last edited by
                          #20

                          The developer who made this, should be forced to wear headphones and make his/her program fail constantly for 24 hours... ;P Seriously, there was a time when computers had an internal speaker, given that this is VB6, i'm not really surprised.

                          CEO at: - Rafaga Systems - Para Facturas - Modern Components for the moment...

                          R 1 Reply Last reply
                          0
                          • L Le Poete

                            vonb wrote:

                            If this function is called many times from different threads

                            VB6, threads! That made my day :-)

                            M Offline
                            M Offline
                            MSBassSinger
                            wrote on last edited by
                            #21

                            Back in my VB6 days, I wrote multithreaded VB6 apps. The proper use of APIs lets VB6 do a whole lot more than most developers realize. That said, I like .NET much better, which is why I shifted my primary development language from VB6 to VB.NET and C#. It is a better framework for multithreaded apps and although VB6 was OO, .NET finishes the OOA that VB6 started (not saying there was no OO before VB4/6 - obviously - just in that line of succession of VB -> .NET).

                            A B 2 Replies Last reply
                            0
                            • M MSBassSinger

                              Back in my VB6 days, I wrote multithreaded VB6 apps. The proper use of APIs lets VB6 do a whole lot more than most developers realize. That said, I like .NET much better, which is why I shifted my primary development language from VB6 to VB.NET and C#. It is a better framework for multithreaded apps and although VB6 was OO, .NET finishes the OOA that VB6 started (not saying there was no OO before VB4/6 - obviously - just in that line of succession of VB -> .NET).

                              A Offline
                              A Offline
                              AspDotNetDev
                              wrote on last edited by
                              #22

                              MSBassSinger wrote:

                              VB6 was OO

                              Barely. It didn't even have class inheritance or interfaces. X|

                              MSBassSinger wrote:

                              NET finishes the OOA that VB6 started

                              Do you mean OOP?

                              Thou mewling ill-breeding pignut!

                              M D 2 Replies Last reply
                              0
                              • A AspDotNetDev

                                MSBassSinger wrote:

                                VB6 was OO

                                Barely. It didn't even have class inheritance or interfaces. X|

                                MSBassSinger wrote:

                                NET finishes the OOA that VB6 started

                                Do you mean OOP?

                                Thou mewling ill-breeding pignut!

                                M Offline
                                M Offline
                                MSBassSinger
                                wrote on last edited by
                                #23

                                VB6 had class inheritance (interface inheritance), just not binary inheritance. Binary inheritance had to be accomplished by some minimal coding, but it was doable. Oddly enough, as I found out when writing C# "OCXs" for use in legacy VB6 code, VB6 did have interfaces. If the class was named "Dog", the class interface was "_Dog" and the events interface was "__Dog". VB6 did all that for you "under the covers", which was both a blessing and a curse. COMInterop, in C#, with VB6 code, is a trip. A few "gotchas" not found when doing the same in VB.NET. I meant architecture, in the context of the going from the limited OO in VB6's architecture to the essentially complete OO in .NET's architecture.

                                B 1 Reply Last reply
                                0
                                • A AspDotNetDev

                                  I'd wake up if an ant farted.

                                  Thou mewling ill-breeding pignut!

                                  I Offline
                                  I Offline
                                  Ingo
                                  wrote on last edited by
                                  #24

                                  AspDotNetDev wrote:

                                  I'd wake up if an ant farted.

                                  Because of the sound or because of the smell? :)

                                  Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.

                                  1 Reply Last reply
                                  0
                                  • M MSBassSinger

                                    Back in my VB6 days, I wrote multithreaded VB6 apps. The proper use of APIs lets VB6 do a whole lot more than most developers realize. That said, I like .NET much better, which is why I shifted my primary development language from VB6 to VB.NET and C#. It is a better framework for multithreaded apps and although VB6 was OO, .NET finishes the OOA that VB6 started (not saying there was no OO before VB4/6 - obviously - just in that line of succession of VB -> .NET).

                                    B Offline
                                    B Offline
                                    BC_programming
                                    wrote on last edited by
                                    #25

                                    I worked in VB6 for years. I was firmly entrenched that I didn't need any other languages, because I could use all the APIs and add functionality if needed. Using CreateThread() from VB6 was generally a very bad idea. You couldn't access anything from the VB runtime, since that was not re-entrant. The best you could get was an Out-Of-Process component as a "multiple thread" but I'm not sure if we can count that. Now that I can look back on VB6, I can say that Classes and Object-Oriented support in VB6 was barely workable. When I think back to the things that took the most effort in VB6, I realize that almost all of that effort is either a result of features the language didn't have (such as emulating implementation inheritance by delegating to an aggregate and using implementation inheritance), or working around it's myriad fiobles (have fun implementing IEnumVariant!). Compared to VB6, C# is (for me) like the difference between having to manually slaughter, gut, and butcher a Animal compared to simply having to cook a steak.

                                    M 1 Reply Last reply
                                    0
                                    • M MSBassSinger

                                      VB6 had class inheritance (interface inheritance), just not binary inheritance. Binary inheritance had to be accomplished by some minimal coding, but it was doable. Oddly enough, as I found out when writing C# "OCXs" for use in legacy VB6 code, VB6 did have interfaces. If the class was named "Dog", the class interface was "_Dog" and the events interface was "__Dog". VB6 did all that for you "under the covers", which was both a blessing and a curse. COMInterop, in C#, with VB6 code, is a trip. A few "gotchas" not found when doing the same in VB.NET. I meant architecture, in the context of the going from the limited OO in VB6's architecture to the essentially complete OO in .NET's architecture.

                                      B Offline
                                      B Offline
                                      BC_programming
                                      wrote on last edited by
                                      #26

                                      VB6 didn't have implementation inheritance. This is a rather massive omission. I wouldn't say it required "minimal coding" since you had to manually write a new implementation that delegated to an instance of the inherited type. I recall there are some add-ins that can actually do this for you. It also lacks Generics, but I think we can give it a pass on that since generics wasn't in many languages for some time after VB6's release. (Even though the lack of generics is the thing I find most infuriating as I frequently re-implement type-safe collection classes...). the "interface" classes you see are the interfaces created by the VB compiler. Basically the interface was generated automatically and your actual concrete class would implement that interface. This get's even more interesting when you use Binary Compatibility and add new methods or Properties to a class- those methods and properties get added to a new interface (I forget the naming scheme) and your concrete class implements both that new interface as well as the old one. Pretty nifty, though sadly it didn't always work particularly well. Forms had similar magic; the Form was simply a class that actually inherited from the Form class, but when you create a Form, VB6 would also magically create a Global instance of that Form with the same name. I mean I have fond memories of VB6 but I also use my benefit of Hindsight to realize that it was full of problems.

                                      M 1 Reply Last reply
                                      0
                                      • B BC_programming

                                        VB6 didn't have implementation inheritance. This is a rather massive omission. I wouldn't say it required "minimal coding" since you had to manually write a new implementation that delegated to an instance of the inherited type. I recall there are some add-ins that can actually do this for you. It also lacks Generics, but I think we can give it a pass on that since generics wasn't in many languages for some time after VB6's release. (Even though the lack of generics is the thing I find most infuriating as I frequently re-implement type-safe collection classes...). the "interface" classes you see are the interfaces created by the VB compiler. Basically the interface was generated automatically and your actual concrete class would implement that interface. This get's even more interesting when you use Binary Compatibility and add new methods or Properties to a class- those methods and properties get added to a new interface (I forget the naming scheme) and your concrete class implements both that new interface as well as the old one. Pretty nifty, though sadly it didn't always work particularly well. Forms had similar magic; the Form was simply a class that actually inherited from the Form class, but when you create a Form, VB6 would also magically create a Global instance of that Form with the same name. I mean I have fond memories of VB6 but I also use my benefit of Hindsight to realize that it was full of problems.

                                        M Offline
                                        M Offline
                                        MSBassSinger
                                        wrote on last edited by
                                        #27

                                        I agree with you for the most part. I always got tired of programming snobs who derided VB6 without really knowing what it was or how it worked. VB6 was safely usable for much more than it was given credit for. When .NET first went into beta, I started working with it, and have been a .NET fan ever since. I like it much more than Java for rapid application development and for performance, and more than VB6 for sheer programming flexibility. What you are describing with binary compatibility is that the VB6 compiler creates interface index numbers, using the most recent interface as the default interface. If you look at the type library definition for a VB6 DLL or OCX, you can see this, or you can look at the entries in the registry. VB6 was not full of problems, but compared to .NET, it was lacking. VB6's biggest drawback is that it was designed for two very different audiences - the non-programmer who needed a good prototyping language with good performance, and the programmer. Unfortunately, too many lazy programmers wrote bad code, did not learn VB6 thoroughly, and blamed VB6, not themselves (not meaning you, of course). I still have to maintain old legacy VB6 code, but I have not chosen to write new code in VB6 in a very long time.

                                        B 1 Reply Last reply
                                        0
                                        • B BC_programming

                                          I worked in VB6 for years. I was firmly entrenched that I didn't need any other languages, because I could use all the APIs and add functionality if needed. Using CreateThread() from VB6 was generally a very bad idea. You couldn't access anything from the VB runtime, since that was not re-entrant. The best you could get was an Out-Of-Process component as a "multiple thread" but I'm not sure if we can count that. Now that I can look back on VB6, I can say that Classes and Object-Oriented support in VB6 was barely workable. When I think back to the things that took the most effort in VB6, I realize that almost all of that effort is either a result of features the language didn't have (such as emulating implementation inheritance by delegating to an aggregate and using implementation inheritance), or working around it's myriad fiobles (have fun implementing IEnumVariant!). Compared to VB6, C# is (for me) like the difference between having to manually slaughter, gut, and butcher a Animal compared to simply having to cook a steak.

                                          M Offline
                                          M Offline
                                          MSBassSinger
                                          wrote on last edited by
                                          #28

                                          I agree that C#, and VB.NET, are much better than VB6. That is why I have not written new code in VB6 for years. My approach, back in my VB6 days, was that if I had a performance bottleneck in my VB6 code that was not resource-related (disk I/O, RAM, etc.), then that code would get moved to C++ (or even C in some cases) to improve performance. But for Windows programming, VB6 was pretty much all that was needed. I wrote Windows services, COM+ servers, other middleware, as well as UI code with VB6. All worked well. Classes and OOP in VB6 was easily doable, for its day, so long as I took the time to know how things worked. I find OOP in C# and VB.NET is not only easier today, but has the additional functionality not available in VB6. Plus, I can write 64 bits apps, which I cannot in VB6. Using CreateThread() in VB6 is not a bad idea, just one that requires a little knowledge. For example, I used a TLB for the thread API to bypass the runtime and go to OLE directly. The code I wrote for multithreaded VB6 apps was always stable and worked well. My code was adapted from some work Srideep Prasad did and posted on Planet Source Code back in the day. VB6 was excellent for its day, did not deserve the reputation it had, and was the best Windows development language available then. But that was 12 years ago when .NET took its place.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups