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. The Lounge
  3. OK, C# can be a PITA

OK, C# can be a PITA

Scheduled Pinned Locked Moved The Lounge
csharpc++comhelpcode-review
25 Posts 17 Posters 0 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.
  • M Offline
    M Offline
    Marc Clifton
    wrote on last edited by
    #1

    I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

    Thyme In The Country

    People are just notoriously impossible. --DavidCrow
    There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
    People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

    L D D W M 13 Replies Last reply
    0
    • M Marc Clifton

      I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

      Thyme In The Country

      People are just notoriously impossible. --DavidCrow
      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

      Marc Clifton wrote:

      In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes.

      So does C++ when you mess with pointers, too short buffers, or all sort of inline assembly, if you're not aware what you're actually programming there. Neither language is perfect, and none is more dangerous than another one. regards

      M 1 Reply Last reply
      0
      • M Marc Clifton

        I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

        Thyme In The Country

        People are just notoriously impossible. --DavidCrow
        There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
        People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

        D Offline
        D Offline
        daniilzol
        wrote on last edited by
        #3

        Subtle bugs material?

        1 Reply Last reply
        0
        • M Marc Clifton

          I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

          Thyme In The Country

          People are just notoriously impossible. --DavidCrow
          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

          D Offline
          D Offline
          Dan Neely
          wrote on last edited by
          #4

          So you're interfacing with native code and in doing so have brought all the associated warts of it into the interface. Doesn't seem particularly newsworthy to me, except perhaps as an answer to the people wondering why MS doesn't just take the contents of pinvoke.net and provide .net wrappers for 100% of win32.

          -- Rules of thumb should not be taken for the whole hand.

          M 1 Reply Last reply
          0
          • M Marc Clifton

            I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

            Thyme In The Country

            People are just notoriously impossible. --DavidCrow
            There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
            People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

            W Offline
            W Offline
            wout de zeeuw
            wrote on last edited by
            #5

            No one should be using P-Invoke if not understanding .NET memory management. Though tricky I find P-Invoke good fun, playing around with GCHandle, using delegates for function pointers (don't forget keeping them from being garbage collected!), so you can have callbacks from native to managed. Also don't forget about using InAttribute, OutAttribute and SuppressUnmanagedCodeSecurityAttribute to get the performance up. And yes, pinvoke.net is unreliable, just about any nitwit can put what they think is the right signature on there.

            Wout

            1 Reply Last reply
            0
            • D Dan Neely

              So you're interfacing with native code and in doing so have brought all the associated warts of it into the interface. Doesn't seem particularly newsworthy to me, except perhaps as an answer to the people wondering why MS doesn't just take the contents of pinvoke.net and provide .net wrappers for 100% of win32.

              -- Rules of thumb should not be taken for the whole hand.

              M Offline
              M Offline
              Marc Clifton
              wrote on last edited by
              #6

              dan neely wrote:

              Doesn't seem particularly newsworthy to me

              What's newsworthy, IMO, is that because it is so easy to do, and there's a lot of examples out there, it gives the illusion that everything is hunkydory. Which it isn't. I bet a lot of people don't realize the issues with PInvoke nor the misinformation thats' out there. Marc

              Thyme In The Country

              People are just notoriously impossible. --DavidCrow
              There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
              People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

              1 Reply Last reply
              0
              • L Lost User

                Marc Clifton wrote:

                In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes.

                So does C++ when you mess with pointers, too short buffers, or all sort of inline assembly, if you're not aware what you're actually programming there. Neither language is perfect, and none is more dangerous than another one. regards

                M Offline
                M Offline
                Marc Clifton
                wrote on last edited by
                #7

                Greeeg wrote:

                if you're not aware what you're actually programming there.

                Quite true. Except that with C++, it's the ethos that you need to be careful about those things. With C#, it looks very easy with PInvoke. There's a lot of blank space on that www.pinvoke.net site to use for a big warning message about structures, GC, and native code. While the language may not be more dangerous than another one, it is the sense of security that C# gives you that lulls you to sleep, thus, IMO, making it more dangerous. Marc

                Thyme In The Country

                People are just notoriously impossible. --DavidCrow
                There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                L P 2 Replies Last reply
                0
                • M Marc Clifton

                  I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                  Thyme In The Country

                  People are just notoriously impossible. --DavidCrow
                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                  M Offline
                  M Offline
                  Member 96
                  wrote on last edited by
                  #8

                  I honestly don't understand why people use p/invoke in c#. I've never had to use it and I've written a lot of code over the last few years in c# with the single exception of an article here for the .net platform on pocket pc. I must be missing something on this one, why did you need to use it and was there no other way to accomplish what you did without it?

                  M D 2 Replies Last reply
                  0
                  • M Marc Clifton

                    I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                    Thyme In The Country

                    People are just notoriously impossible. --DavidCrow
                    There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                    People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                    C Offline
                    C Offline
                    code frog 0
                    wrote on last edited by
                    #9

                    Marc Clifton wrote:

                    C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes

                    I think this is precisely why Microsoft doesn't recommend using P/Invoke. (I know you are aware of this I'm just blatantly pointing it out for the sake of ... hmmm ... dunno. Just thought it should be stated.) Your particular example is quite humorous from my end. Glad it was someone else rubbing their head for a change. But I can certainly see how that would be an issue.

                    1 Reply Last reply
                    0
                    • M Marc Clifton

                      Greeeg wrote:

                      if you're not aware what you're actually programming there.

                      Quite true. Except that with C++, it's the ethos that you need to be careful about those things. With C#, it looks very easy with PInvoke. There's a lot of blank space on that www.pinvoke.net site to use for a big warning message about structures, GC, and native code. While the language may not be more dangerous than another one, it is the sense of security that C# gives you that lulls you to sleep, thus, IMO, making it more dangerous. Marc

                      Thyme In The Country

                      People are just notoriously impossible. --DavidCrow
                      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

                      Marc Clifton wrote:

                      Quite true. Except that with C++, it's the ethos that you need to be careful about those things.

                      I believe hardly any programmers (except the more experienced) know that carelessly using strcpy or similiar functions can become a major pitfall. I'm talking about "plain" C(++) here, no libraries like STL involved. Too bad so many examples on pinvoke.net are erroneous, but so are many C++ tutorials you can find all around the web. regards

                      1 Reply Last reply
                      0
                      • M Member 96

                        I honestly don't understand why people use p/invoke in c#. I've never had to use it and I've written a lot of code over the last few years in c# with the single exception of an article here for the .net platform on pocket pc. I must be missing something on this one, why did you need to use it and was there no other way to accomplish what you did without it?

                        M Offline
                        M Offline
                        Marc Clifton
                        wrote on last edited by
                        #11

                        John Cardinal wrote:

                        why did you need to use it and was there no other way to accomplish what you did without it?

                        The routines in hid.dll aren't exposed in .NET, so there's no way to query the USB devices on the machine without p/invoke. Marc

                        Thyme In The Country

                        People are just notoriously impossible. --DavidCrow
                        There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                        People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                        1 Reply Last reply
                        0
                        • M Marc Clifton

                          I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                          Thyme In The Country

                          People are just notoriously impossible. --DavidCrow
                          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

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

                          So if your essential point is

                          Marc Clifton wrote:

                          P/Invoke is dangerous

                          why not have that as the title?

                          M R C 3 Replies Last reply
                          0
                          • P PIEBALDconsult

                            So if your essential point is

                            Marc Clifton wrote:

                            P/Invoke is dangerous

                            why not have that as the title?

                            M Offline
                            M Offline
                            Marc Clifton
                            wrote on last edited by
                            #13

                            PIEBALDconsult wrote:

                            why not have that as the title?

                            Oh, for Pete's sake. Because, among other things, the hoops you have to go through IN C# to fix/marshal the pointers and structures makes C# a PITA.

                            PIEBALDconsult wrote:

                            So if your essential point is

                            That was NOT my essential point. Like most posts I make, I have several essential points. I can think of another essential point right now. Marc

                            Thyme In The Country

                            People are just notoriously impossible. --DavidCrow
                            There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                            People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                            1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              So if your essential point is

                              Marc Clifton wrote:

                              P/Invoke is dangerous

                              why not have that as the title?

                              R Offline
                              R Offline
                              Rocky Moore
                              wrote on last edited by
                              #14

                              Yeah, can be the same problem in any .NET langauge ...

                              Rocky <>< Latest Code Blog Post: Vista for Web Development, Read this first! Latest Tech Blog Post: USA City Burnt To Death...

                              1 Reply Last reply
                              0
                              • M Marc Clifton

                                I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                                Thyme In The Country

                                People are just notoriously impossible. --DavidCrow
                                There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                C Offline
                                C Offline
                                Chris Maunder
                                wrote on last edited by
                                #15

                                Marc Clifton wrote:

                                In other words, C# can be as, if not more, dangerous than C++

                                Excellent. I feel all bad-ass again now. Now where are some scissors so I can go running?

                                cheers, Chris Maunder

                                CodeProject.com : C++ MVP

                                1 Reply Last reply
                                0
                                • M Marc Clifton

                                  I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                                  Thyme In The Country

                                  People are just notoriously impossible. --DavidCrow
                                  There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                  People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                  J Offline
                                  J Offline
                                  J Dunlap
                                  wrote on last edited by
                                  #16

                                  Maybe I'll have to write some articles on this when I get a chance! :-) Any suggestions on where to start?

                                  M 1 Reply Last reply
                                  0
                                  • M Marc Clifton

                                    I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                                    Thyme In The Country

                                    People are just notoriously impossible. --DavidCrow
                                    There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                    People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                    L Offline
                                    L Offline
                                    leppie
                                    wrote on last edited by
                                    #17

                                    Marc Clifton wrote:

                                    it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around!

                                    I would normally just alloc the 'unmanaged' memory :)

                                    **

                                    xacc.ide-0.2.0.57 - now with C# 2.0 parser and seamless VS2005 solution support!

                                    **

                                    1 Reply Last reply
                                    0
                                    • M Marc Clifton

                                      I just spend most of today trying to figure out why changing movie channels on the kiosk would crash the kiosk application. It didn't do this before, and the change I made was to replace the USB I/O code, that was in C++, with a major rewrite of the USBSharp code. I should have stuck with the C++ code, because it turns out that garbage collection was happening, and my read/write buffers and overlapped structures were moving around! Fixed now (pun intended). And the app is working just fine now. This should be a lesson to everyone. P/Invoke is dangerous because things can look like they're working fine for quite a while. The code examples on the www.pinvoke.net site are wrong. Most of those structs need to be converted to a fixed pointer, especially if you're calling them in a thread and/or asynchronously. Third party libraries that you think have been tested is a bad assumption. In other words, C# can be as, if not more, dangerous than C++ because the interaction between the GC and unsafe P/Invokes can result in non-deterministic crashes. Marc

                                      Thyme In The Country

                                      People are just notoriously impossible. --DavidCrow
                                      There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                      People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                      D Offline
                                      D Offline
                                      Dario Solera
                                      wrote on last edited by
                                      #18

                                      Just a hint: in .NET you can pin objects so the GC doesn't move them in memory.

                                      ________________________________________________ Personal Blog [ITA] - Tech Blog [ENG] Developing ScrewTurn Wiki 2.0 (2.0 Alpha is out)

                                      1 Reply Last reply
                                      0
                                      • M Member 96

                                        I honestly don't understand why people use p/invoke in c#. I've never had to use it and I've written a lot of code over the last few years in c# with the single exception of an article here for the .net platform on pocket pc. I must be missing something on this one, why did you need to use it and was there no other way to accomplish what you did without it?

                                        D Offline
                                        D Offline
                                        Dan Neely
                                        wrote on last edited by
                                        #19

                                        Monitoring for changes to files on a SAMBA share. The modern API wrapped by FileSystemWatcher isn't supported by Samba, and based on a message I managed to excavate from a mailing list archive won't be in the future because implementing it with acceptable performance would require large chucks of kernal level code. I've done several other minor things but that was the biggie.

                                        -- Rules of thumb should not be taken for the whole hand.

                                        1 Reply Last reply
                                        0
                                        • J J Dunlap

                                          Maybe I'll have to write some articles on this when I get a chance! :-) Any suggestions on where to start?

                                          M Offline
                                          M Offline
                                          Marc Clifton
                                          wrote on last edited by
                                          #20

                                          J. Dunlap wrote:

                                          Any suggestions on where to start?

                                          With USB, or working with unsafe code? Marc

                                          Thyme In The Country

                                          People are just notoriously impossible. --DavidCrow
                                          There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer
                                          People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith

                                          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