Re: C vs C++ Device Driver Question



IMHO, C++ can be used to good effect in KM but I advise against it for a
variety of reasons. Most importantly, C++ can hide the meaning of code and
the consequences of a seemingly trivial line of code can be disastrous. C
has the advantage that, with the exception of macros, all code executes as
it appears in source.



BTW: I also advise against C++ in UM for the same reason. And if you want
OO programming, then use .NET or Java. I regularly write and maintain code
in C, C++, VB.NET, C#, & Java and the most difficult to work on by far is
C++ because of the non-obvious nature of some constructs.



This is just my opinion and, as has been stated already, C++ can readily be
used in KM.



"decoder" <rcg_golf@xxxxxxxxxxx> wrote in message
news:e%23ZCmPneIHA.4696@xxxxxxxxxxxxxxxxxxxxxxx
On the MS website: http://www.microsoft.com/whdc/driver/kernel/KMcode.mspx
it points out the many pitfalls of developing a kernel mode driver using
C++ (classes, inheritance etc.).

If it presents so many problems to use C++, why do the AVStream samples
use C++ classes?
For example in C:\WINDDK\3790.1830\src\wdm\avstream or
C:\WINDDK\6000\src\AVStream, the sample
files provided by MS contain C++ classes, and use inheritance!!

Since especially the avshws sample is targeted for eventual use with
hardware( it is pin-centric, shows how to
do DMA etc.), why is it not written in C, like the bulkusb sample for
example?

What does the community think about using C++ in kernel mode drivers?

Thanks
-decoder



.



Relevant Pages

  • Re: HardBound and SoftBound
    ... and neither C# nor Java come close to C/C++. ... from time to time when changes are required or for speed reasons. ... speeds comparable with the C++ C# compiler from MS. ... In practice RISC wasn't such a big change, ...
    (comp.arch)
  • Re: Java and .NET (no Flames Pls)
    ... I like .NET over Java for a couple of reasons. ... ingrained concept in some developers mind that all MS products suck (not ... Visual Studio has superior support for Web Services. ...
    (microsoft.public.dotnet.framework)
  • Re: (1/2 OT) Reasons to begin with .Net
    ... If you aren't familiar with .NET (or Java or C++ etc) then I honestly would be very suspicious of any controls you attempt to market. ... The market for VB6 controls is effectively dead today.NET is continuing going from strength to strength. ... But if you are looking at the booming market sectors, then .Net and Java are still the two leaders. ... I want to clarify to myself the reasons to write programs in .Net and the reasons not to do it. ...
    (microsoft.public.vb.general.discussion)
  • Re: Book question on threads
    ... > Reading a Java certification book, ... > "Which of these are plausible reasons why a thread might be alive, ... Sun Certified Programmer for the Java 2 Platform ... Sun Certified Developer for the Java 2 Platform ...
    (comp.lang.java.programmer)
  • Re: Multi-monitor test-and-feedback app for Windows
    ... and one of the reasons I wrote this test program. ... My own setup doesn't use transparent spanning, just Vista's run-of-the-mill virtual screen, although both monitors are connected to the same graphic card. ... I don't code any Java at this time, and in fact I've been wondering how all the other guys handle the multi-monitor problems. ...
    (comp.graphics.api.opengl)