How to build workspace from DDK examples? - windows

I am new to win32 programming and also to driver programming. I have installed Windows DDK on my system and have got some examples with the DDK but those examples don't have dsw file.
I wanted to know how can I create .dsw file so that I can open that workspace in VC6.

Most people who build DDK/WDK projects in Visual Studio do so using a 'makefile' project that invokes the DDK's build.exe utility. This works quite well- you get the code navigation capabilities of Visual Studio while building your DDK project using the standard, supported DDK tools.
Note that the DDK comes with it's own set of compilers, and those compilers should be used to build DDK projects.
OSR has a little set of cmd scripts that is supposed to make this easier (it's been years since I've done anything with those; I really can't remember how well they work):
http://www.osronline.com/article.cfm?article=43
Another similar tool is available from Hollis Technology:
http://www.hollistech.com/Resources/ddkbuild/ddkbuild.htm
As far as debugging goes, unfortuantely the VS debugger won't work for kernel mode driver debugging. For that, get the Debugging Tools for Windows package which has a great set of debuggers. The GUI debugger, WinDbg, is quite nice even if it's not quite up to the usability of Visual Studio's. And the documentation with the Debugging Tools is outstanding - you can learn a lot about Windows internals just by reading the WinDbg docs.

The last time I looked (which was years ago), you don't build device drivers using the Visual Studio IDE: the DDK has its own build.exe utility (similar idea but not the same as makefiles); and apparently this is still true as of early 2008, see for http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/4382c9b66f8611e9?pli=1
I expect that "how to build" is described in the DDK documentation.

I think better you integrate with Visual Studio 2005, 2008 or 2010 with this tool:
http://visualddk.sysprogs.org/versions/1.5.6

ChrisW is correct, you can't use Visual Studio (unless there is a way to set it).
Anyway, for start debugging you can use DebugView to print simple messages with DbgPrint.

VC6 is very old these days, can't you use a newer version? Anyway, as I recall, you can just open the project file as a workspace, the IDE will create the .dsw file for you.

Related

Using Visual Studio with TWL/Nitro SDK

Is there any way I can use Nintendo TWL or Nitro SDK on Visual Studio, along with their IS-NITRO-DEBUGGER? I know there're some workaround, since I heard people using Visual Studio to work on DS/DSi games. I don't want to use CodeWarrior for this.
PS: I have Visual Studio 2010 and 2012 express edition.
It should be pretty easy, I wrote a little wizard that creates projects for use on the devkitPro toolchain (supports the DS among others) that could probably be modified for use with the official devkit. VS 10 is a bit more friendly with this sort of setup but it works on VS12 as well.
http://pern.drunkencoders.com/
The wizard is here and you will have to install it then open and edit the javascript files...no access to the official devkit so can't comment on how much of an undertaking this might be.
You may simply be able to edit the libnds template makefiles to point at the official toolchain and the wizard will just work as is (other than having to create a debug association).
There are also some good debugging tools if the toolchain that is based on gcc that will let you debug directly in visual studio with memory watches and custom viewers.

IDE for Windows Driver Development

I am planning to write a Windows(XP, Vista and 7) Virtual printer driver using C/C++. So I wanted to know which is the best IDE out there which I can use for this. From what I have read Windows Driver Kit 8(WDK-8) is much more integrated with the new Visual Studio 2012 but drivers for windows XP are not supported with WDK-8. So I was hoping if somebody could suggest me about which version would work out best for me.
Since Visual Studio is pretty expensive, so I don't want to buy it unless it has some advantages over using Eclipse in my case.
Also, if I need to use Visual Studio, then which version of visual studio would suffice for a single developer like me: Professional, Premium or Ultimate ?
before VS 2012, the Visual Studio has no advantages than Eclipse. Almost all driver is built in command line mode, and use the windbg as debugger, so the VS is just an editor.
in the VS 2012, it build a template to WDF driver, it is easy to create a driver from template. But I don't think it is a reason to by the expensive VS.
Take a look at DDKBuild.
http://www.hollistech.com/Resources/ddkbuild/ddkbuild.htm
I use Visual Studio 2012 in combination with DDKBuild to compile drivers - when errors show up I can see them in the Error List window and can get taken straight to the right line in the driver source...saves a bunch of time!
I've set up various SolutionConfigurations for different driver options that I want e.g. running a PreFast pass, compiling as 32bit, 64bit, for different OS targets, etc - makes it super easy to switch between Release and Debug, or the static analysis tools.
Basically you create a new Visual Studio Makefile Project in Visual studio, then set the NMAKE|Build Command Line to something like this:
ddkbuild -WIN7 -prefast checked . -cZ
or
ddkbuild -WIN7XP checked . -cZ
or
ddkbuild -WIN7XP free . -cZ
etc
I haven't used it myself, but for a more powerful way to leverage Visual Studio to do driver development, take a look at VisualDDK
http://visualddk.sysprogs.org/
Visual Studio 2013 Community Edition is free and can be used as an IDE for the drivers

Options for Development of Win32/MFC Applications

I'm still using Visual C++ 2003 to maintain and enhance a PC-based program. It is written in C & C++ and just runs on the PC -- not on the web, a phone, in the cloud, or whatever -- and I have no idea what this .NET framework is all about and probably don't need to care at this time.
Anyway, now that I've upgraded my development PC to Windows 7 it's getting more inconvenient to run the old development environments. I think that the latest full version of Visual Studio 2010 would still work to build my project, but the cost is really off-putting. At least in 2003 they offered Visual C++ by itself for around $100, but the freebie Visual C++ .NET 2010 would do me no good at all.
So are there any alternatives to Visual Studio Pro out there these days? I'd even be willing to rewrite the stuff that actually depends on MFC if I can find something to replace it (and still have access to all the Win32 and early C library support).
Why not pick up a second hand copy of Visual Studio 2005 or 2008 on e-bay?
PS: I always considered VS2003 a really bad IDE when compared to VS2005 and VS2008.
Code::Blocks
Eclipse
Dev-C++
You could use Visual Studio 2010 Express if you would replace all MFC-stuff with pure Win32-calls or with another windowing library like Qt, Fox, eGUI, Tk ...
How much GUI is your application? If it's mostly a algorithms and data classes, rewriting the GUI in C++ might make sense. If it's mostly dialogs and lists, rewriting it on the .net-platform would be much faster.
If you are willing to rewrite the stuff that depends on MFC, then you have many options, but I will suggest these two:
Gtk+ - if you want to develop everything using C. If you like c++ then you have c++ bindings gtkmm
Qt - this is a c++ framework which comes with complete development tools too.
I think the free version of Visual Studio Express can still compile plain old C++ without the .NET. The only problems are that it doesn't include MFC or a resource editor. You might be able to use the MFC include files and libraries from your Visual Studio 2003, but I don't know what you would do for resource editing.
wxWidgets is similar enough to MFC that you might pick it up very quickly. The biggest difference is how you lay out dialogs.

How to debug with Visual C++ 6 on Windows 7 x64?

Surely the answer will be "you can't" or "use XP mode", but I'd like to know if it it possible.
The issue I have is that whenever I debug some application and hit a breakpoint, when I stop the debugger the debuggee remains stuck. It can't be killed, I can't attach another debugger (it says it is already being debugged). It won't go away until I close Visual C++.
This is hapenning on a Windows 7 64 bits install. VC has SP 6 installed.
My previous fix was horrible.
Finally, I developped a new fix, working perfectly with the english version of Visual Studio 6. (SP6 I think)
You need to check the version of the file DM.dll located into "Common/MSDev98/Bin"
The correct version is 6.0.9782.0.
link: http://www.dr-hoiby.com/TLLOC.dll (28KB)
how to install: replace "Common/MSDev98/Bin/TLLOC.dll" by the version downloaded.
Best regards.
Comment reposted:
You can try using Visual Studio 2008 with VC6 compiler. I recently blogged about this.
I developped a little fix for that.
You just have to copy the file "ShiftF5Fix.dll" into "Common/MSDev98/AddIns/" et load it from Visual.
It's an hugly fix.
If you modify your source file during debugging you have you answer "NO" to the poup displayed after you press "SHIFT+F5" to stop the process.
link : http://www.dr-hoiby.com/ShiftF5Fix.dll
Best regards
Another option would be to install daffodil.
This is an open source project to compile all versions of visual studio in VS2010.
Once this is configured you can use visual studio 2010 debugger to debug VC6 projects.
On the heels of Dr Holby, I implemented a leaner variant, with source code:
http://www.algonet.se/~tamlin/TLLOC_fixer.zip
The code currently only understands sp4 (?) and SP6, but I think it'll cover most cases.
You only need to compile the source (1.cpp, 1.rc), rename your existing TLLOC.DLL (which btw stands for Transport Layer Local - as opposed to remote debugging) to TLLOC.old.dll, and drop in the one you compiled (~4KB). Should work like a charm for all 32-bit debugging needs, from Windows 95 to Windows 7 (and later).

Ironruby IDE

Which IDE if any, are people using to develop Ironruby in?
If you are looking for an integrated Visual Studio editor, with intellisense etc, Microsoft has nothing in plan yet (according to this article with John Lam -> http://www.infoq.com/articles/state-of-ironruby). But there is an integrated editor which works pretty good - SappireSteel - at http://www.sapphiresteel.com/Ruby-In-Steel-For-IronRuby.
If you just want to edit in VS and don't care about intellisense and such, you could try and set up an external tool from within VS and call the ir.exe (http://msdn.microsoft.com/en-us/library/68c8335t%28VS.80%29.aspx)
There are numerous editors with support for ruby highlightning which you can try out as well, but there is no one (I think) with intellisense-like support for the .NET framework. Scite (http://www.scintilla.org/SciTE.html) is pretty popular, Scott Hanselman blogged about Ruby support/highlightning in Notepad2 (http://www.hanselman.com/blog/NewNotepad2WithRubySyntaxHighlighting.aspx). On Codeplex you can find a tool called IronEdit (http://www.codeplex.com/IronEditor) which I've not tried myself yet.
I ran RubyMine (http://www.jetbrains.com/ruby/index.html) for a while, which seems to be a really good Ruby IDE (costs money), but doesn't have any specific support for IronRuby. I hope the JetBrains will release something which plugs into Visual Studio eventually...
Personally I think Sapphire will come up with something really good eventually. I hope this helps.
I use Vim as my IDE with some custom settings that I blogged about some time ago.
Visual Studio?
According to the IronRuby website Visual Studio C# Express can be used (and in turn, any commercial version of Visual Studio 2005+ I'll assume).
From the IronyRuby.net home page:
Today, you must check the source code out of the IronRuby Subversion repository on Rubyforge. You will need a Subversion client: we recommend TortoiseSVN. To build the sources from the command line, you must also have Ruby installed on your computer already: we recommend the Ruby one-click installer. You can also build the sources using Visual Studio; if you don't already own a copy, you can download a free copy of Visual C# Express 2008.
Ruby in Steel from Sapphire Steel is build on the Visual Studio Shell (integrated mode) that will merge with Visual Studio 2008 if you already have it installed or simply be a standalone installation if you don't have Visual Studio already installed.
Also, no use to you, but Microsoft are going to be releasing IronRuby Studio (and IronPython Studio) at some point in the future. I couldn't find much about these on the web though - they were mentioned by a speaker at Teched Europe a few weeks ago.
You might interested in IronEditor. which similar to SciTE. get it at http://www.codeplex.com/IronEditor
Sapphire has a version now specifically targeted at IronRuby. Furthermore, not only is the alpha free now but they claim production will be free as well.
edit:forgot to include linkage
IronRuby integration in VS2010 can be found here: http://ironruby.net/tools/
The IronRuby tools are a good place to start but I think the best IDE for doing Ruby or in more detail Rails is VIM. by using a plugin such as rails.vim you can keep all your shortcuts and scripts across the boundaries such as Windows / Linux or IronRubyOnRails / RubyOnRails ...
JetBrains is offering a great IDE with RubyMine. I can remember that I've read an article about how to configure RubyMine to support IronRuby.
But as already mentioned IronRuby Tools for VS2010 are a good place to start.
The current version(s) of IronRuby now contain Ruby Tools for Visual Studio, which install along with IR itself. This is true for versions 1.1 and later.

Resources