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. .NET guidance

.NET guidance

Scheduled Pinned Locked Moved The Lounge
csharpc++questiondatabasecom
20 Posts 8 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.
  • L Lost User

    Work is taking a turn for the better (assuming marketing make a decision) in that I will be working one a pretty comprehensive test system. Since I will be using some peripherals that have .NET 2.0 support I'm thinking it's time to look at C#/C++ .NET and have some questions: 1. What is a good general book covering using DLLs, use interfaces etc.? I won't be doing any significant database work. 2. Compared with MFC (stop sniggering at the back!) how good is support for the likes of DirectShow? 3. Any particular pros or cons for C++ or C#? Thanks in advance. Elaine (slightly adventerous fluffy tigress)

    Visit http://www.notreadytogiveup.com/[^] and do something special today.

    M Offline
    M Offline
    martin_hughes
    wrote on last edited by
    #2

    Is it .Net 2.0/C#2 you'll be doing? If so you really need to read Andrew Troelsen's Pro C# 2005 and the .Net 2.0 Platform. It covers a lot of stuff, but enough of it is in-depth enough or relevant enough to be a good starter. I also have the 2008 version of the book which I want to hang on to, so if you want my 2005 copy send me an email and I'll send it to you.

    print "http://www.codeproject.com".toURL().text Ain't that Groovy?

    L 2 Replies Last reply
    0
    • M martin_hughes

      Is it .Net 2.0/C#2 you'll be doing? If so you really need to read Andrew Troelsen's Pro C# 2005 and the .Net 2.0 Platform. It covers a lot of stuff, but enough of it is in-depth enough or relevant enough to be a good starter. I also have the 2008 version of the book which I want to hang on to, so if you want my 2005 copy send me an email and I'll send it to you.

      print "http://www.codeproject.com".toURL().text Ain't that Groovy?

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

      Thanks Martin, soon as a decision is made I'll drop you a message. Elaine :rose:

      Visit http://www.notreadytogiveup.com/[^] and do something special today.

      1 Reply Last reply
      0
      • L Lost User

        Work is taking a turn for the better (assuming marketing make a decision) in that I will be working one a pretty comprehensive test system. Since I will be using some peripherals that have .NET 2.0 support I'm thinking it's time to look at C#/C++ .NET and have some questions: 1. What is a good general book covering using DLLs, use interfaces etc.? I won't be doing any significant database work. 2. Compared with MFC (stop sniggering at the back!) how good is support for the likes of DirectShow? 3. Any particular pros or cons for C++ or C#? Thanks in advance. Elaine (slightly adventerous fluffy tigress)

        Visit http://www.notreadytogiveup.com/[^] and do something special today.

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #4

        Before I venture to suggest books, it would be useful to know if you will be using WinForms or Web or whatever. With DirectX 9.0c (I think that is the most recent) the SDK installs libraries for C#, or at least it used to, so DirectShow is there, although most DirectX functionality is now available through the XNA Libraries. One advantage that you should have is that it should be reasonably easy for you to follow C# sample code and work out what it is doing, with the syntax at least looking similar.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        C L E 3 Replies Last reply
        0
        • L Lost User

          Work is taking a turn for the better (assuming marketing make a decision) in that I will be working one a pretty comprehensive test system. Since I will be using some peripherals that have .NET 2.0 support I'm thinking it's time to look at C#/C++ .NET and have some questions: 1. What is a good general book covering using DLLs, use interfaces etc.? I won't be doing any significant database work. 2. Compared with MFC (stop sniggering at the back!) how good is support for the likes of DirectShow? 3. Any particular pros or cons for C++ or C#? Thanks in advance. Elaine (slightly adventerous fluffy tigress)

          Visit http://www.notreadytogiveup.com/[^] and do something special today.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #5

          Trollslayer wrote:

          What is a good general book covering using DLLs, use interfaces etc.? I won't be doing any significant database work.

          Using dlls in C# is trivial. You import them and use them as if they were part of your project.

          Trollslayer wrote:

          Compared with MFC (stop sniggering at the back!) how good is support for the likes of DirectShow?

          The built in support sucks, but there are some good interop assemblies. The thing to remember, anything that you can do in C++, you can use COM interop or p/invoke to do in C#. You can do anything with DX that you can in C++.

          Trollslayer wrote:

          Any particular pros or cons for C++ or C#?

          The big one is, don't be fooled. C# looks like C++, but it behaves very differently.

          Christian Graus Driven to the arms of OSX by Vista.

          1 Reply Last reply
          0
          • H Henry Minute

            Before I venture to suggest books, it would be useful to know if you will be using WinForms or Web or whatever. With DirectX 9.0c (I think that is the most recent) the SDK installs libraries for C#, or at least it used to, so DirectShow is there, although most DirectX functionality is now available through the XNA Libraries. One advantage that you should have is that it should be reasonably easy for you to follow C# sample code and work out what it is doing, with the syntax at least looking similar.

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #6

            The C# directshow functionality is incomplete and incredibly buggy.

            Christian Graus Driven to the arms of OSX by Vista.

            H L 2 Replies Last reply
            0
            • C Christian Graus

              The C# directshow functionality is incomplete and incredibly buggy.

              Christian Graus Driven to the arms of OSX by Vista.

              H Offline
              H Offline
              Henry Minute
              wrote on last edited by
              #7

              Thanks for that. :) I hadn't tried it, just knew it was there.

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

              1 Reply Last reply
              0
              • C Christian Graus

                The C# directshow functionality is incomplete and incredibly buggy.

                Christian Graus Driven to the arms of OSX by Vista.

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

                I looks like I will only need audio input for this so paws crossed!

                Visit http://www.notreadytogiveup.com/[^] and do something special today.

                1 Reply Last reply
                0
                • H Henry Minute

                  Before I venture to suggest books, it would be useful to know if you will be using WinForms or Web or whatever. With DirectX 9.0c (I think that is the most recent) the SDK installs libraries for C#, or at least it used to, so DirectShow is there, although most DirectX functionality is now available through the XNA Libraries. One advantage that you should have is that it should be reasonably easy for you to follow C# sample code and work out what it is doing, with the syntax at least looking similar.

                  Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

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

                  It won't be web so Winforms sounds likely.

                  Visit http://www.notreadytogiveup.com/[^] and do something special today.

                  H 2 Replies Last reply
                  0
                  • L Lost User

                    It won't be web so Winforms sounds likely.

                    Visit http://www.notreadytogiveup.com/[^] and do something special today.

                    H Offline
                    H Offline
                    Henry Minute
                    wrote on last edited by
                    #10

                    In that event, I have found Windows Forms 2.0 Programming[^] useful. You might also consider Programming MicroSoft Windows With C#[^]. Good old Charles Petzold. He has also got a free E-Book[^], although some on CP, Pete o'Hanlon for one, do not think much of it. There are a gazillion of them out there. With your experience, making the change should not be difficult, finding a book with a style you get on with, might be more difficult. :)

                    Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                    1 Reply Last reply
                    0
                    • L Lost User

                      It won't be web so Winforms sounds likely.

                      Visit http://www.notreadytogiveup.com/[^] and do something special today.

                      H Offline
                      H Offline
                      Henry Minute
                      wrote on last edited by
                      #11

                      I've just googled 'c++ to c#', which gave some potentially useful hits. Some of them are MS and so are a bit "ain't c# wonderful", but the info is in there. A well known phrase containing the words Grandmother, suck, eggs and teach, springs to mind. Sorry, I'll stop bothering you now. :-D

                      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                      1 Reply Last reply
                      0
                      • L Lost User

                        Work is taking a turn for the better (assuming marketing make a decision) in that I will be working one a pretty comprehensive test system. Since I will be using some peripherals that have .NET 2.0 support I'm thinking it's time to look at C#/C++ .NET and have some questions: 1. What is a good general book covering using DLLs, use interfaces etc.? I won't be doing any significant database work. 2. Compared with MFC (stop sniggering at the back!) how good is support for the likes of DirectShow? 3. Any particular pros or cons for C++ or C#? Thanks in advance. Elaine (slightly adventerous fluffy tigress)

                        Visit http://www.notreadytogiveup.com/[^] and do something special today.

                        D Offline
                        D Offline
                        David Knechtges
                        wrote on last edited by
                        #12

                        I've done native C/C++ (3 years), managed C++ (2 years), and C# (3 years) for a while now - along with embedded stuff for a long time before that. (God I feel old now!) Anyway, my recommendation to you would be to figure out what you are going to be doing and interfacing with first before making the choice. Native C/C++ is best for speed and memory usage. Managed C++ is really good for mixed projects where you want to call native APIs or your own native libraries without using PInvoke while at the same time using the .NET framework, although some people (my old boss) don't like the managed syntax. C# is good for strict .NET programming. As was said earlier, COM objects and DLLs can be directly imported into C# and .NET projects (it creates wrapper DLLs for COM objects). Then you just instantiate them and call them like any other object and method. What is not real easy is PInvoke - especially when you are trying to convert native structures into their managed equivalents. Funny how Microsoft hasn't included a tool to do this directly in Visual Studio, but they haven't. There are free third party tools out there that help you convert an unmanaged signature into a managed one, but they aren't all that easy to use and you have to be careful with what you are doing. If you want to see an example, go to www.pinvoke.net, and look through the WLANAPI. I wrote those calls and signatures because they were about impossible to figure out and there was no managed equivalent for them. David

                        R L 2 Replies Last reply
                        0
                        • H Henry Minute

                          Before I venture to suggest books, it would be useful to know if you will be using WinForms or Web or whatever. With DirectX 9.0c (I think that is the most recent) the SDK installs libraries for C#, or at least it used to, so DirectShow is there, although most DirectX functionality is now available through the XNA Libraries. One advantage that you should have is that it should be reasonably easy for you to follow C# sample code and work out what it is doing, with the syntax at least looking similar.

                          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                          E Offline
                          E Offline
                          ely_bob
                          wrote on last edited by
                          #13

                          Some of the XNA functions are written wrong see Matrix.CreateWorld(), and the audio i'm told (seen posts) can have issues when windows media player is on in the background.

                          H 1 Reply Last reply
                          0
                          • E ely_bob

                            Some of the XNA functions are written wrong see Matrix.CreateWorld(), and the audio i'm told (seen posts) can have issues when windows media player is on in the background.

                            H Offline
                            H Offline
                            Henry Minute
                            wrote on last edited by
                            #14

                            Once again, thanks for the heads-up. :) This is such a good place for finding stuff out. Cheers!

                            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                            1 Reply Last reply
                            0
                            • D David Knechtges

                              I've done native C/C++ (3 years), managed C++ (2 years), and C# (3 years) for a while now - along with embedded stuff for a long time before that. (God I feel old now!) Anyway, my recommendation to you would be to figure out what you are going to be doing and interfacing with first before making the choice. Native C/C++ is best for speed and memory usage. Managed C++ is really good for mixed projects where you want to call native APIs or your own native libraries without using PInvoke while at the same time using the .NET framework, although some people (my old boss) don't like the managed syntax. C# is good for strict .NET programming. As was said earlier, COM objects and DLLs can be directly imported into C# and .NET projects (it creates wrapper DLLs for COM objects). Then you just instantiate them and call them like any other object and method. What is not real easy is PInvoke - especially when you are trying to convert native structures into their managed equivalents. Funny how Microsoft hasn't included a tool to do this directly in Visual Studio, but they haven't. There are free third party tools out there that help you convert an unmanaged signature into a managed one, but they aren't all that easy to use and you have to be careful with what you are doing. If you want to see an example, go to www.pinvoke.net, and look through the WLANAPI. I wrote those calls and signatures because they were about impossible to figure out and there was no managed equivalent for them. David

                              R Offline
                              R Offline
                              rayrad
                              wrote on last edited by
                              #15

                              If you find yourself in need of doing PInvoke calls, it would probably help to know about the PInvoke Wiki http://www.pinvoke.net/[^]. Dave Parker IT DevWorks http://www.itdevworks.com[^]

                              1 Reply Last reply
                              0
                              • D David Knechtges

                                I've done native C/C++ (3 years), managed C++ (2 years), and C# (3 years) for a while now - along with embedded stuff for a long time before that. (God I feel old now!) Anyway, my recommendation to you would be to figure out what you are going to be doing and interfacing with first before making the choice. Native C/C++ is best for speed and memory usage. Managed C++ is really good for mixed projects where you want to call native APIs or your own native libraries without using PInvoke while at the same time using the .NET framework, although some people (my old boss) don't like the managed syntax. C# is good for strict .NET programming. As was said earlier, COM objects and DLLs can be directly imported into C# and .NET projects (it creates wrapper DLLs for COM objects). Then you just instantiate them and call them like any other object and method. What is not real easy is PInvoke - especially when you are trying to convert native structures into their managed equivalents. Funny how Microsoft hasn't included a tool to do this directly in Visual Studio, but they haven't. There are free third party tools out there that help you convert an unmanaged signature into a managed one, but they aren't all that easy to use and you have to be careful with what you are doing. If you want to see an example, go to www.pinvoke.net, and look through the WLANAPI. I wrote those calls and signatures because they were about impossible to figure out and there was no managed equivalent for them. David

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

                                Thanks David, it looks like managed C++ is my best option. [Added] Phillipe's comments about C# for the UI work is interesting though. Elaine :rose:

                                Visit http://www.notreadytogiveup.com/[^] and do something special today.

                                modified on Saturday, March 21, 2009 10:20 AM

                                1 Reply Last reply
                                0
                                • L Lost User

                                  Work is taking a turn for the better (assuming marketing make a decision) in that I will be working one a pretty comprehensive test system. Since I will be using some peripherals that have .NET 2.0 support I'm thinking it's time to look at C#/C++ .NET and have some questions: 1. What is a good general book covering using DLLs, use interfaces etc.? I won't be doing any significant database work. 2. Compared with MFC (stop sniggering at the back!) how good is support for the likes of DirectShow? 3. Any particular pros or cons for C++ or C#? Thanks in advance. Elaine (slightly adventerous fluffy tigress)

                                  Visit http://www.notreadytogiveup.com/[^] and do something special today.

                                  P Offline
                                  P Offline
                                  Philippe Mori
                                  wrote on last edited by
                                  #17

                                  Many things like Windows Forms and database development are better supported in C#... So mixed-language is probably the best option if you want to reuse lot of C++ code or if you need C++ for some part and you do have a complex UI. In my project, I uses both C++ (some algorithm that uses STL and to uses some C++ libraries) and C# (Windows Forms, Database...). At first I would have used C++ a lot more but I have found that they are more problems with auto-generated code, intellisense, compile-time and general ease of use so finally I do all database design in C# and almost all the UI. I hope that Visual Studio 2010 will fix many of these problems so that it would be easier to have larger protion of code in C++ without having the drawbacks. In my case, if C++ support would be better, I would need less DLL since some C# code would be done in C++ (well, it would be nice if it would be possible to have both C++ and C# code in the same DLL project)

                                  Philippe Mori

                                  L 1 Reply Last reply
                                  0
                                  • P Philippe Mori

                                    Many things like Windows Forms and database development are better supported in C#... So mixed-language is probably the best option if you want to reuse lot of C++ code or if you need C++ for some part and you do have a complex UI. In my project, I uses both C++ (some algorithm that uses STL and to uses some C++ libraries) and C# (Windows Forms, Database...). At first I would have used C++ a lot more but I have found that they are more problems with auto-generated code, intellisense, compile-time and general ease of use so finally I do all database design in C# and almost all the UI. I hope that Visual Studio 2010 will fix many of these problems so that it would be easier to have larger protion of code in C++ without having the drawbacks. In my case, if C++ support would be better, I would need less DLL since some C# code would be done in C++ (well, it would be nice if it would be possible to have both C++ and C# code in the same DLL project)

                                    Philippe Mori

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

                                    Thanks Phillipe, that is very useful. I haven't been in a situation where mixed language has been pratical so it's worth thinking about. Elaine :rose:

                                    Visit http://www.notreadytogiveup.com/[^] and do something special today.

                                    1 Reply Last reply
                                    0
                                    • M martin_hughes

                                      Is it .Net 2.0/C#2 you'll be doing? If so you really need to read Andrew Troelsen's Pro C# 2005 and the .Net 2.0 Platform. It covers a lot of stuff, but enough of it is in-depth enough or relevant enough to be a good starter. I also have the 2008 version of the book which I want to hang on to, so if you want my 2005 copy send me an email and I'll send it to you.

                                      print "http://www.codeproject.com".toURL().text Ain't that Groovy?

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

                                      Martin, I'm going with C++ in VS2005 but I really appreciate the book offer. Thanks. Elaine :rose:

                                      Visit http://www.notreadytogiveup.com/[^] and do something special today.

                                      M 1 Reply Last reply
                                      0
                                      • L Lost User

                                        Martin, I'm going with C++ in VS2005 but I really appreciate the book offer. Thanks. Elaine :rose:

                                        Visit http://www.notreadytogiveup.com/[^] and do something special today.

                                        M Offline
                                        M Offline
                                        martin_hughes
                                        wrote on last edited by
                                        #20

                                        Not a problem.

                                        print "http://www.codeproject.com".toURL().text Ain't that Groovy?

                                        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