Can't figure out Shaders for DirectX11? - c++

So, I have no idea how to use shaders. Coding them is easy, but not actually using them. MSDN is really useless to me, meaning they have the worst tutorials out there. I am currently reading Frank Luna's Direct3d 11 book, and I am finally to the part where I actually get to draw stuff. Exciting, except for the fact that it doesn't work. His BoxDemo - I'm sure worked 3 years ago when the book was made, but now with all of the new DirectX stuff - omitting the DirectX SDK and now using "Windows SDK", FX being deprecated, no more D3DX libraries... So frustrating. I went ahead and downgraded to the DirectX 2010 SDK - just so I can actually use a tutorial. Almost every D3D tutorial out there uses the D3DX libraries.
Anyway... now to my question. Visual Studio has an option to make .hlsl files. But, it also has the ability make .fx files (if you just type .fx at the end of the file name it creates .fx file).
So, I could use the deprecated .fx way and learn how to use it easily with all of the tutorials teaching it - OR I can learn the new HLSL way, and have the hardest, most frustrating time trying to learn it with no tutorials.
I know they both use the HLSL language. But they both are used in the program differently. (CreateEffectFromMemory, CompileFromFile, etc).
I kind of hope to learn the new way, but if I don't that is fine. Although, I pretty much have an entire program using an .fx file. I'm sure it will work, but I just need help building and utilizing "Effects11.lib".
Sorry for the dragging on post - in fact, I am sure I will not get any replies for a while - if I do get any - due to the length. I am pretty frustrated because learning DirectX has put my programming career on a massive hiatus for the past month, 2 months. Please and thank you for any help

The file extension .hlsl vs. .fx is arbitrary. It's like the difference between .cpp and cxx. Historically .fx is used for HLSL shaders that included vertex shaders, pixel shaders, and the Effects (FX) techniques/passes, and .hlsl is a file that didn't include the Effects (FX) techniques/passes, but is just a convention. There's plenty of both used out there.
What matters is how the file is compiled. If you use fx_5_0, then it requires the Effects 11 runtime to actually use them. This itself is really nothing special. It effectively just invoke the same compiler for each combination of compile statements you provided for the Effects (FX) techniques/passes and bundles it up with some meta-data. In fact, you can often invoke the FXC compiler on a .fx file containing techniques/and passes using something like vs_5_0 or ps_4_0 and it will compile the appropriate stage-specific shader if you get the parameters just right.
RE: Effects11
The main issue with Effects 11 is that it requires the D3DCompile DLL at runtime because it uses that to extract the metadata required to wire up the state and shaders. This D3DCompile DLL is not usable with Windows Store apps in Windows 8.0 and Windows phone 8.0 when you actually deployed the app, only when you were developing the app. Thus, Effects 11 wasn't usable for those platforms.
This is no longer a technical issue for Windows Store apps for Windows 8.1 or Windows phone 8.1, but the compiler support for fx_5_0 is still deprecated. It has a few issues that are fixed for the other profiles vs_5_0, etc. A such, it's up to you if you want to use it or not as long as you understand it's limitations.
The latest version of Effects 11 is on CodePlex and I address the limitations there. There are some simple tutorials that use it, as well as a few samples. This version of Effects 11 actually doesn't need the legacy DirectX SDK at all.
In short, YMMV w.r.t. to Effects 11 but you can still use it for Win32 desktop apps, Windows Store apps for Windows 8.1, Windows phone 8.1 apps, and in theory with Xbox One apps too.
RE: D3DX
I can understand the frustration, but it's a common issue with the book publishing industry and technical books being way behind the ball in terms of changes. DirectX 11 was introduced back in 2008. The transition to the Windows 8 SDK came in 2012 and most developers much less book publishers completed missed it. I have some notes on that book on my blog.
For a complete list of 'modern' alternatives, see Living without D3DX.
For Win32 desktop apps, you can continue to use the legacy DirectX SDK. The main thing to note is that with the Windows 8.x SDK that comes with VS 2012 and VS 2013, the include and lib path orders are reversed than they were with VS 2010. See MSDN for details.
RE: Learning Direct3D 11
Have you looked at the DirectX Tool Kit?
Getting Started with Direct3D 11
Direct3D Feature Levels
HLSL, FXC, and D3DCompile
As for tutorials and samples, try DirectX SDK Samples Catalog.

Related

"D3DX11CreateShaderResourceViewFromFile" Getting it to work or finding an alterative

I'm pretty new to DirectX, I'm trying to get some sample code I found online to work. Apparently it needs D3DX11tex.h and D3DX11.lib, but it always says it can't open the header. I've tried using CreateWICTextureFromFile, but I don't really know what I'm doing, any help would be appreciated. I'm using Visual Studio 2017 on Windows 10 if it helps.
All of D3DX9, D3DX10, and D3DX11 are deprecated, along with a few other aspects of the legacy DirectX SDK. You can continue to use them in classic Win32 desktop apps with VS 2012 or later / Windows 8.x SDK / Windows 10 SDK but you must add the DirectX SDK include/libs appropriately and use them with care. This is covered in detail on MSDN. See also this blog post.
There are a number of options for Living without D3DX, and it's recommended that new applications minimize or avoid use of the legacy DirectX SDK as much as possible. The only cases that make sense to needing the legacy DirectX SDK are covered in detail in The Zombie DirectX SDK--other than someone learning from all the various outdated books and online tutorials for DirectX 11.
The CreateWICTextureFromFile function in the DirectX Tool Kit is a good solution that doesn't require the legacy Directx SDK at all, and is documented here. It's also covered in this tutorial series.
Keep in mind that the D3DX11 texture loaders were also "everything and the kitchen sink" implementations. The DirectXTex library supports all kinds of legacy loaders, format conversion, resizing, etc. that was supported by D3DX11. For runtime use, however, DirectX Tool Kit is a much faster, leaner, more elegant solution assuming you can do any required legacy conversions at build-time. See this post.

Updating From Old DirectX 7 C++ Code... [dx7vb.dll]

Quick background: This is a large and old software project involving C# UI code and some underlying C++ code. This question pertains to the C++ code.
The C++ is responsible for creating an "efficient" (for the time) scrolling effect on a square region of the screen that displays fast moving waveforms and rapidly changing data. Apparently the "scrolling" that was built-in to our charting software [TeeChart, which we still use] just didn't cut it. (Perhaps TeeChart 2013 does have sufficient scrolling now? Not sure...)
Now apparently the assembly for DirectX 7 in C++ that is being used is "dx7vb.dll". This is a bit confusing to me, as "dx7vb.dll" implies Visual Basic.
I want to replace this DLL with some modern DirectX or OpenGL calls (or TeeChart calls if possible?). The problem is, I have no idea where to find reference on DirectX 7 so I can reverse engineer the DX7 calls and determine a suitable replacement. (I do, however, understand what needs to happen and I have a solid understanding of OpenGL, so that could perhaps be an option as well..)
So my questions are:
Where to find some sort of explanation for this "dx7vb.dll"? Is it somehow related to Visual Basic?
What is a '.TLB' file in C++? Just another type of assembly?
The core object that is used is IDirectX7Ptr which has 2 google results... Does anyone have information on this object so I can understand what the calls are accomplishing?
Do the modern TeeChart .NET libraries support REALTIME displays better than they did ~15+ years ago?
Thanks a ton for your time.
EDIT: To be clear, yes I have all of the source. I obviously do not have source for 'dx7vb.dll'.
EDIT2: After some looking around in the registry I found that it is actually registerd as "DIRECT.DirectX6.0" and most of the COM objects that are being registerd reference "DirectX 6". So in classic Microsoft fashion, 'dx7vb.dll' seems to hold information for DirectX 6 objects...
I'm having a tough time finding anything specific to DirectX 7.0, but I have found old reference material for DirectDraw, if that's the DX component you're using. You can check it out here. I'll continue digging.
Furthermore, you can check out this article that has some legacy (Windows 2000) era DirectX documentation. Under "Direct3D DDI" there's a section for DirectX 7.0 Release Notes, which makes me think there might be useful information here.
dx7vb.dll and dx8vb.dll were Visual Basic 6.0 assemblies for using DirectX 7 (1999) and DirectX 8 (2000) respectively. They are not part of DirectX any longer, and are not available for any version of Windows newer than Windows XP. This predates the legacy Managed DirectX 1.1 assemblies which were written for .NET (2002).
For .NET/C# code, the modern equivalent for accessing DirectX is SharpDX or SlimDX.
See DirectX and .NET

Is Embarcadero C++ Builder a good choice as an IDE? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
As we are (me and people I work with) more and more frustrated while working with C++ projects 250 000+ LOC in VS2010 sp1 (the slowness of this IDE is just unbelievable), in my company we were talking about migrating our code to some different IDE. We did some research, and a strong candidate seems to be Embarcadero C++ builder 2011 XE. Any thoughts on it? Is it any good? How does it compares to VS2010 ultimate?
I've been using C++ Builder since 1.0 and I hate it with a passion. You would think after all these years, simple little annoyances would be fixed by now but they are not. Here is a list of issues I have with C++ Builder IDE.
Your layout or personality never is maintained. You create one, save it and it only applies to certain things. For example the debugger window will not maintain its position nor will the message window. If you detach the project explorer it will sometimes dissappear. Most of the time reloading your personality doesn't fix this either. You are stuck dragging your windows back into place.
The debugger will sometimes work and sometimes not work. In a debug build if you set a break point and begin stepping through code, you can hover over a variable to inspect it. Sometimes this works and sometimes it doesn't work on the exact same variable. Crazy!
Eclipse looks for code mistakes like if you forget to put a semi-colon at the end of your statement, it puts a little ? mark in the margin. C++ Builder doesn't do anything like this. It gives you a cryptic compile time error message.
Recent versions of C++ Builder use a makefile similar to VS; it's an XML mess. Eclipse works with CMake and Makefiles. I've read in places that the CMake maintainers are looking for a C++Builder generator but last I checked this doesn't exist. I do embedded and cross compiling so sometimes my C++ Builder code is copied to my embedded development environment or shared with it and I wind up maintaining two build environments.
Not really an IDE but C++Builder does not take advantage of multiple CPUs to compile code. There is, however, a 3rd party tool you can spend more money on to get this. It's called TwineCompile (http://www.jomitech.com/twine.php). With Eclipse, they call out to whatever compiler you're using (gcc, etc...) and those compilers and make support -j option.
C++Builder comes with a limited version of AQTime which is a dynamic code profiler. Spend more and you get the more advanced version. Eclipse supports many dynamic and static code analysis (which also cost $$) but at least the plugins are there. We use Klockworx.
C++ Builder has no support, that I'm aware of, for external source control like GIT. Eclipse does. C++ Builder comes with subversion, I think, built-in. If it supports GIT, I could never get it to work. It tells me it doesn't understand the URL scheme when I give it a git path.
Certain template code I write causes the compiler to segfault and have to completely restart the IDE. This is nuts to me. You have a compiler that is 10+ years old and it's still segfaulting. I have a piece of C++ template code that when I take it to my work computer running exact same version of C++ Builder, it compiles OK, but on my home machine it segfaults. I'm absolutely sure there are no adverse factors at play like viruses, etc...
While compiling a large project that may take a long time, you are unable to browse code with the IDE. Sometimes you may see a compiler warning scroll by and you have to either wait for the compile job to complete to inspect the mentioned line or use an alternate means to open the file.
C++ Builder IDE has a concept of a Project Group with sub projects that are more/less self contained. The Project Group has no concept of a project group include/link path like the sub-projects have. Sub-projects have a base, debug, release paths where debug and release can inherit or block from the base but you don't have this at the project group level. The IDE has global settings which can be inherited but it's for everything you do in the IDE. So there is no way to modify for a given project group, just the include/linker paths for a set of sub-projects. I just think they could have done a better job with this.
C++ Builder's Build output is not color coded to, for example, show errors in red and warnings in some other color. Everything is black and white. VC and Eclipse color code and give option to change colors for various warnings and errors. The output tab in C++ Builder is same way. On big projects, it's very difficult to investigate compiler warnings with the other noise. In C++ Builder's IDE you can select level of warnings but this only affects output in the Output tab and you still get other stupid noise like letting me know its deleting linker state files "CleanLinkerStateFiles."
Unless you're doing Windows desktop GUI development, stay away from Embarcadero/C++ Builder. I started using C++ Builder version 1 back in the Borland days and have a few large projects that are heavily invested in the VCL so I'm stuck with it for those projects but all my new projects, I've been using Eclipse.
On a positive note about C++ Builder, the VCL is quite nice. It's not multi-threaded but it's nice for creating a desktop GUI app really quick. I think it's much faster to get a C++ based GUI app up in CBuilder than it is in VS. And there appears to be a ton of free and paid GUI components for CBuilder; again with a C++ focus. I know C# + VS has a wealth of GUI controls.
UPDATE:
I just ran into a problem today that is same as the one mentioned in this forum:
http://qc.embarcadero.com/wc/qcmain.aspx?d=57631
[ILINK32 Warning] Warning: Error detected (ILI4536)
Make up your mind. Is it a warning or a god dam error?
Scroll all the way to the end where you find individuals modifying ILINK32.EXE to get it working again. As of this morning, our builds stop working. We're dead in the water as we scramble to understand and find out what to do about this.
Is this the kind of compiler/IDE you want to depend on? Again, this product has been around for more than a decade and it still has issues like this. I find this completely unacceptable. Crap product from a company that doesn't give a shit.
Not actually an answer, but I'll just leave it here:
It costs money (yes, VS too, but you already own that, don't you?)
It will be not too easy to migrate a big enough project to new IDE (and compiler), not to say about the people you work with and their habits (I would just quit probably).
There's a new compiler too, with its brand bugs and caveats to learn about. And it's much less widely used than VC++. However, it's based on Clang, which should support standards better than VC++, and be easier to port existing C++ code to.
The difficulty of migrating hugely depends on the nature of your project (is it GUI based, how deeply does it rely on MS VC++ being the compiler?)
There is nothing positive about Embarcadero XE, neither their aging IDE neither their aging compiler. Only use it if you're bound to it (legacy software) or if you want to do Delphi.
For C++, do yourself a favor and join 21st century : stick with something more powerful, versatile and modern such as VC++ or Qt.
This question is really a matter of personal opinion.
I personally HATE Visual Studio with a passion, I avoid it like the plague. My exposure to Eclipse has been limited to Java, but even then I've had a hard time working with it.
I have been using C++Builder for 15 years, since v3.0 all the way up to the latest XE6. Yes, it has quirks and limitations, but I still find it the easiest IDE for me to work with and be productive with, once you know how to work with (or around) them. Maybe my experience with it is hindering my ability to work with other IDEs, but so be it. I still prefer C++Builder over any other. But I only use it for Windows development (the VCL is very mature and robust), I don't do cross-platform development with it yet (FireMonkey still has a ways to go to evolve and mature). And I do use plenty of open-source projects with it. Yes, sometimes I have to tweak their projects and/or code to make them compile, but that it usually a one-time deal and then they work fine.
I'd suggest Eclipse.
As an IDE, it takes a little while to get used too, but it is well
worth the effort.
It's available for Mac OS, Linux and Windows.
You need to have Java installed on your computer, but that's
really a non - issue.
It supports Cygwin, MinGW, and the MicrosoftVisual C++ toolchains. The build in CDT Builder is pretty good too.
You can use it to develop for languages other than C++ (Java , JavaScript, PHP ..)
You can extend it's functionality by installing plugins
IT'S FREE!
Did I mention that it has a built in Web Browser ? Really useful for referring to online documentation, while coding.
1.
We have a solution over 1M LOC and VS2010 handles it ok. We especially like /MP switch for compiling on all available CPU cores.
You did not specify your hardware. If you don't yet run on at least i7-2600 + fast SSD, I suggest trying hardware upgrade first.
2.
I used to use Borland tools a lot in the past. Delphi was rather stable; C++ Builder was much more buggy. Couple of years ago I helped to upgrade old Delphi projects to newer Delphi IDE with some service packs installed. And it had bugs even in the basic File IO APIs which have worked since Turbo Pascal. We had to downgrade to a previous version. I expect that quality of C++ Builder won't be much better than of VS2010.
3.
You did not specify what exactly is slow. You may want to convert some projects into components compiled separately. Also make sure you use PCH.
Also it worth investigating if you abuse C++ inclusion model by including a lot of unneeded header files in each and every unit. If, after preprocessing, Intellisense and compiler have to deal with huge amount of code, no IDE can help.
I have not used Visual Studio 2010 Ultimate for C++, rather C# and C# web services development. That being said, as a test between VS 2010 Ultimate and C++Builder XE, I have created a simple VS C++ Windows Forms application to click a button and show "Hello World" through an event handler. Getting the button onto the VS Window Designer is okay, as long as you remember to access View | Toolbox. If not, it will take some time to track down where the visual components are hanging out.
For reasons that do not make any language sense, the button click event handler has a signature that looks like:
System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
}
and it goes to the header file as one would expect. The ^ symbol makes little sense. Does using it tie into the CLI/CLR better? I expected a * to indicate a pointer.
After using the default Form1 (only header file created) and subsequently adding a new windows form, I finally obtained the respective cpp file. Maybe the C++ Windows Form Wizard has a bug. Who knows? Anyhow, when adding the button click event by double clicking the button in the designer, the cpp does not obtain the method in either cpp form I tested. Maybe this is normal, I do not know. The end result of this is that after trying to use the MessageBox function within the cpp, it only caused compilation errors. I am sure there is yet another header file that has to be in the include path. I spent no time tracking this down. Trying to set a label component text property caused compilation errors too. About 20 minutes later, I went to C++Builder XE3 in frustration.
In C++Builder, I have tested VCL Forms, FireMonkey Desktop, and FireMonkey Metropolis application creation from the project wizard. Sure enough, I have three different applications saying, "Hello World," in about three minutes total, all calling C++Builder's built in global shortcut function called ShowMessage("insert message here"). The timing could have been slightly different as I did not time it with a stop watch. It took longer to save files with meaningful names than the code itself: one line of typing in the respective click event body in each cpp (not the header).
The other main daily use gotcha with VS, for those of us who love the Brief key map, is that VS is highly challenging to configure into Brief. When doing heavy development in C#, I use C++Builder's editor in Brief mode, saving files as often as I want. VS does correctly detect file updates as you click back to the VS IDE.
On the slowness mentioned by the OP above, I suggest also looking very closely at the hardware platform relative to running Visual Studio. I have noticed that if the .Net framework is out of date, VS will be slow within the IDE. It does not seem to matter which language the project is in either. I use Visual Studio 2010 Ultimate on Parallels with Windows XP Pro, with 2 virtual cores. Generally, VS responds normally within the IDE. While using it, I am NOT thinking, "VS is soooo slow."
Regarding migrating a quarter million lines to C++Builder from VS, I am not sure whether VS event handlers will convert by some wizard or other migration tool. The ^ symbol, if consistently used in all event handlers, may not be a big deal for a regular expression conversion that is custom written. If the project is very thin on the user interface layer and heavy in business rules and data, converting to C++Builder should be relatively easy. I would expect some new coding for the new user interface click events passing the user interaction into the other layers. For prototyping, using data aware components are likely your best bet. In normal application running, expect to have the business rules layer use the STL and built in C++Builder data structures (even the AnsiString c_str() method) to interact with non data aware components. The performance and user experience will likely improve.
Start Edit
A big knock on C++Builder XE3 (note this is two releases behind the current one of five) is that the 64-bit Windows support is only for console applications. The knock is more from not being frequently broadcast on how to use the Add Platform sub-menu that appears when right clicking the mouse over the Target Platforms choice in the Project tree view. This quick method to add more platforms to a project after it may first be targeting 32-bit Windows is virtually painless. A new sub-dialog appears after clicking the sole sub-menu choice and a drop down box appears to select the new operating system and respective 32-bit or 64-bit versions. In my opinion, Embarcadero is not demonstrating often enough how simple it is to add other target platforms. So, to ease all developer's pain if this is not known in advance, I have found three web pages on the Embarcadero site. The first one has pretty pictures of creating a FireMonkey desktop application. Step 5 has the screen capture of the Target Platforms | Add Platform sub-menu choice for adding the Mac OS X platform. It is here titled Creating Your First FireMonkey Application for Desktop Platforms (C++): http://docwiki.embarcadero.com/RADStudio/XE2/en/Creating_Your_First_FireMonkey_Application_for_Desktop_Platforms_%28C%2B%2B%29
The more terse and no picture procedure is here titled Steps in Creating Cross-Platform Applications:
http://docwiki.embarcadero.com/RADStudio/XE2/en/Steps_in_Creating_Cross-Platform_Applications
The Windows centric procedure and a small screen capture is here titled 64-bit Cross-Platform Application Development for Windows:
http://docwiki.embarcadero.com/RADStudio/XE3/en/64-bit_Cross-Platform_Application_Development_for_Windows
I have found on an Embarcadero forum post that an upgrade to the Update 1 XE3 release from the original XE3 release has a Target Platform selection issue. There can be an internal path setting or two that is incorrect, and possibly having to change an original XE3 project file (.cbproj) to enable Win64. Apparently the original release project file has this set to false.
XE5 (note version five as of December 2013) is supposed to have 64-bit Windows support for both console and forms applications (e.g. VCL, FireMonkey Desktop, FireMonkey Metropolis), OS X, iOS (Android coming sometime soon). For the complete list, review the C++Builder feature matrix pdf for all of the XE5 details:
http://www.embarcadero.com/products/cbuilder/cbuilder-feature-matrix.pdf
Since the XE3 Update 1 has been shown to resolve Target Platform selection issues, when compared to the original XE3, there should not be any weird behaviors. I have also come across an Embarcadero post that states from a TeamB member that for mobile applications, the Target Platform choices are filtered such that mixing a desktop platform project with a mobile one is not allowed. So, if one wanted to try creating a desktop application and then with a mouse click force it into an iPhone, some other development tool will have to be used. C++Builder and/or Delphi will not attempt to squeeze desktop components onto a mobile device. You have to start with a mobile application project. Here is the forum link:
https://forums.embarcadero.com/thread.jspa?threadID=96371
(End Edit)
If curious about my overall background, I have used C++Builder since version one, Visual Studio .NET (C# 1.0) and Visual Studio 2010 Ultimate. It seems like Visual Studio concentrates on C# more than any other language. There are eighteen C# projects and fifteen C++ projects when selecting File | New Project. To reach the Visual Studio C++ project area, make sure to reach it by opening the "Other Languages" sub-tree.
In recent Internet posts between Visual Studio latest and greatest and C++Builder latest and greatest, purchase prices vary in the thousands of dollars. Even if never ever having an installation to upgrade either tool, C++Builder remains a bargain compared to Visual Studio. Please conduct thorough research before spending your hard earned cash. Hopefully both tools have 30-day trial installations to compare side by side, as your mileage may vary.

compatibility of native code C++ and openGL in Windows Phone 7

We have a windows mobile 6.5 gaming application which uses openGL . Now we planned to port it to WP7 (windows phone 7).
When I check the compatibility of native code C++ and openGL in WP7, they are telling that there is no support in the WP7. WP7 support only Silverlight, XNA and the .NET Framework.
So what we thought of use XNA.Is it is the right to use this?
Please let me know how to proceed with this. And which is the best way to go about it.
well I am doing exactly the same thing now.
I'm currently going through the painstaking process of just manually converting all the code to c#. there is no little saviour like the Android NDK here with winmo7, you HAVE to use c#
if I had my time I would and WILL definitely look into something that converts from c++ to c#, it is completely unrealistic to try and manage a multi platform project across multiple languages.
depending on your app: silverlight I believe is meant for the more 'Applicationy' type apps, where XNA is meant for games (or 3D apps), but I think both are coded in c#
EDIT: lol, sorry skipped over the part about how you were porting an openGL game, definitely use XNA, converting from openGL to XNA(directX like) will be the least of your worries, its fairly strait forward. its converting the code that's the pain. XNA is meant for n00bs writing stuff from scratch, and for them, it is awesome. to that end, it is good if you still have all your asset's source: hopefully still having your max or maya model files, and tga/bmp/png texture source files. if so, the content pipeline will automatically convert textures, and for models, converts .x or .fbx files exported from max or maya.

Getting back into Windows programming

I've been out of the Microsoft stack for a while now, been focused on Linux, open source stuff and web development in PHP. I used to do some desktop app development and some DirectX stuff on Windows in Dev Studio (all C and C++).
I'd like to brush up on the MS stuff just to keep up on what's going on. I've installed MSVC++ 2008 Express but I'm looking for a little side-project to play with. Given my background in C/C++ and familiarity with MFC and STL, what would be a good way to jump back in?
I've been developing on Microsoft stack since 1997, starting with C/C++/MFC/ATL, but all of the recent projects were on .NET platform (C#), so I would recommend learning .NET/C#. C/C++ still has its place, but it loses relevance rather rapidly. If not for legacy projects, we would not even bother with C/C++. Just my 2 cents.
If you want to get back into modern Windows programming you should learn C#/WPF.
If you're looking to get back into windows programming C# ASP.NET 3.5 is a fairly common and current language and framework to start with. This is the direction that the masses of C# .NET guys have been migrating as of late and you may be able to find a wealth of communities and bloggers contributing to that scene.
From the sounds of it, however, it looks like you were doing something along the lines of game development (DirectX and C++). Although more niche and slightly dated there are still a great deal of coders using the language. One of my favorite stops is GameDev.net because of the active community and active forums.
Good luck and have fun!
You could check out the VC++2010 beta, which comes with C++0x support and some MFC updates.
Since you're experienced with Linux, you might want to check out Qt for Windows too.
I fancy wxWidgets very much. It portable, effective and easy to learn especially if you've got some experience from MFC.