Dr. Dobb's TechNetcast


h o m e
s c h e d u l e
a r c h i v e s
f o r u m
c h a t
f a q
t o o l s
a b o u t

dr. dobbs journal


TechNetCast 1998-07-10

[PLAY THIS PROGRAM]


Visual C++ Microsoft Visual C++ 6.0

with Mike Blaszczak and Walter Sullivan, Microsoft Corp.

A preview of the upcoming MS Visual C++ 6.0 and a look at the latest developer strategies from Microsoft.

A few weeks ago MS announced that the next version of Visual C++, version 6.0 would be made available early September. We played around with a pre-relese version of the product this week at the high-tech, state of the art, multi-million dollar TechNetCast labs. The first observation is that the interface is nearly identical to the previous release, version 5.0. But dig deeper and you find significant and elegant changes that should make a difference for developers especially those that use COM and MFC. And this seems to be a common theme in this release --deceivingly simple enhancements that are well integrated into the tool. Some examples to illustrate this:

- Edit and Continue (this obviously requires a significant amount of background work to pull off, but it works smoothly)
- Automatic Statement Completion
- Load delay imports
- New watch window constants and qualifiers (ERR, WC, WS)
- New app wizard projects including one for creating a skeletal Win32 app

And we will explain exactly what these are during the program.

Every release of VC++ is an opportunity to gauge the priorities at Microsoft at the time, and where it is pushing developers, -not surprisingly COM, ATL and ADO are good -RDO is bad. Developers should take a close look at ATL for creating back-end COM objects. ATL is an elegant and lightweight solution that uses C++ templates to solve the problem of abstraction and code reuse. Its great to see generic programming used on this scale. And VC++ is the provides the best environment for creating ATL components.

Something else that struck me is how widespread COM objects have become and how easy the development environment has made it to integrate components into applications, especially MFC apps. Although there has been no progress in the direction of integration with other Visual Studio tools, this brings VC++ closer to a programming environments like VB - for better or for worse. Some examples of this VB likeness are the Edit and Continue feature, and also the new Insert Form option that generates MFC CFormView instances. CFormView is the hybrid modeless dialog box/CView window that ressembles VB forms. And adding controls to a form is simply a matter of drag and drop.

Finally, version 6.0 adds support for components that are exposed by Internet Explorer, including the IWebBrowser interface that is wrapped by an MFC class, CHtmlView, itself derived from CView which makes it easy to associate with a document type in the familiar document/view model.

All in all an intelligent, deceivingly simple but significant release of a mature and stable development tool.

On a side note, one unfortunate side-effect of the emphasis on high-level component and database integration, at least in the documentation for the product, is that there is hardly any mention of C++ language features. This may reflect the fact that C++ compilers are more mature and have become more stable. Or maybe there has been enhancements here but they are simply not documented. Some documentation mentions that two engineers were devoted to language compliance. In any case the adoption of the C++ standard a few months ago should provide a checkpoint for compiler language compliance. I'm sure our guests today can help shed some light on this.

--PL

Add your own comments about Visual C++ 6.0 to the TechNetCast Forum

Guests:
Mike Blaszczak is a development lead for the Microsoft Foundation Class team, and is responsible for setting the technical direction of the libraries while participating in their implementation. Mike is an occasional contributor to several technical journals and magazines. He is the author of "Windows programming with MFC" published by Wrox Press. A Microsoft employee for more than six years, Mike enjoys long-distance motorcycling, ice hockey, and writing.




Links
  • Microsoft's Visual C++ site
  • Microsoft's Visual C++ 6.0 "sneak preview" site Documentation and white papers on the upcoming product
  • TechNetCast Visual C++ 6.0 forum

Transcript

TNC: Welcome to the season finale of the Dr. Dobbs' TechNetCast... a media event that rivals in scale the last Seinfeld episode…

We're taking a two-week break and we'll be back with a C++ show to coincide with the appearance on the newsstands of the Dr. Dobbs annual C++ issue. Here it is... Just received it in the mail.

Our Web site, technetcast.ddj.com. Please call in and ask questions. Our chat site is irc.pseudo.com, port 6667, or you can use the Java chat on our Web site, a much easier solution.

[Commercial break}

TNC: Welcome back to the program. Our guests today are Mike Blaszczac and Walter Sullivan from Microsoft. Mike, Walter, welcome to the program.

MB/WS: Thank you.

MB/WS: Thank you.

Automatic Statement Completion

TNC: We posted on our website a short review of Visual C++ 6.0. What new features of would you like to emphasize?

MB/WS: I think there's a lot of interesting things with VC6. You mentioned most of them, I think. The statement completion work that we did, for example, which is a lot like Visual Basic, and we've added a few tricks that are unique to VC in it.

TNC: [Using statement completion,] you actually start typing a word and then you can right-click on it, for example. A drop-down list then appears and it contains function and variable names, symbols, that match the letters.

MB/WS: Well, it's just a little bit more advanced than that. It reads C++ syntax as you're typing. So if you have an instance of some variable, say you have a CString [variable] and you type [the variable name], as soon as you type the dot, we'll drop down a list of the member variables. And once you pick a member variable, you'll get parameter help for it. […] It's also context sensitive for dots and arrows and things like that.

TNC: It works on C++ keywords, function and variable names…

MB/WS: Any C++ class that you have included in your project.

MB/WS: Or struct.

TNC: Anything that belongs in the browser database? Is it the same database.

MB/WS: It's a little bit different database. But, yes, essentially. Anything you can see in (unintelligible) you can get statement completion on. And we also have statement completion on all of MFC and all of ATL and all of the WIN 32 API.

TNC: Now, is it possible to turn this off if I don't like it?

MB/WS: It is. On the tools options menu.

Edit and Continue

TNC: Okay. What other feature of the IDE, or the editor?

MB/WS: Probably the other major one is the edit and continue feature in the debugger.

TNC: How does this work?

MB/WS: You are debugging your application and you discover a problem with the code that you're stepping through, or maybe you're not stepping through it but just running. You can modify that code in the debugger and build, we will then patch the EXE image in memory and continue executing that application. It's an extremely fast way to fix bugs while you're in debugger.

TNC: And you just gave an indication of how this works. It works because you actually patch the code in memory.

MB/WS: The image is laid out in memory with a little bit of extra space in between each function.

TNC: So does that mean that I can only add a limited number of new instructions?

MB/WS: No, because we can take that space and jump out of there… It is less efficient run time -but who notices, [this is] just for debugging.

TNC: I tried this and it works nicely. When I restart the application, a new image is generated. It won't use the patched image.

MB/WS: Absolutely.

MB/WS: As you exit the debugger, all the OBJs that we built to patch the in-memory image are still on disk. So when you exit the debugger, we will relink the actual EXE.

A Not So Anonymous Call…

TNC: Mike, Walter, we have a caller. We'll be taking calls as this program goes through.

Caller, are you on the air?

"SCOTT": Yes.

TNC: What's your name?

"SCOTT": It's Scott.

TNC: Hi, Scott. You have a question for Mike or Walter?

"SCOTT": Yes. I was wondering if there's any companies out there that extend MFC at all.

TNC: Okay. Well, that's a pretty easy question. Do you want to take that?

MB/WS: Well, Scott, Dundas Software is one of our favorites... You should probably check to see that the caller is actually Scott Wingo…

TNC: From Stingray…

Actually, we had Scott on the program. We had him on the program a few months ago and we saw him at SD.

"SCOTT": I just wanted to say Visual C++ 6.0 is excellent. Good job, guys.

TNC: Thanks for the call, Scott.

MB/WS: Thanks, Scott. And Stingray is one of our favorites, as well…

TNC: Okay, what other features of the IDE would you like to stress, emphasize?

I noticed when you make changes to a class definition, the class view is automatically updated to to show new properties and new methods.

MB/WS: Yes. To do this statement completion work, we came up with kind of a simplified C++ (unintelligible) that runs all the time in the background so that we could always keep up to date with what you are typing in and the classes you were declaring.

And we found that we could actually use that also to update class view and create a very dynamic class view pane that -- in previous versions of VC we had, but you either had to save the project or build the project before you got everything updated.

TNC: Is there an overhead to all this new technology?

MB/WS: Certainly. But we spent a lot of time optimizing it and making sure that it was interfered very little with the work you were doing in the IDE. So we think definitely on any typical machine that we've tested on you see no performance degradation at all. And if you do, you can turn it off.

TNC: Now, just to get back to edit and continue, how solid is that? Is it possible to break it? The documentation mentions it is intended for "small code changes".

MB/WS: As Mike mentioned, the way Edit and Continue is done is by adding padding so that functions and data can grow. But once you exceed that padding, then we can't grow it any further and you would have to just stop the debugger and rebuild, like you would have had to in VC5 or VC4.

But we found that a lot of people can spend a very significant amount of their time actually just writing code in the debugger. In fact, the guy who wrote it continues spending a lot of time doing that, so it's pretty robust.

TNC: Let's continue with the debugger. One of the new features is a a new module list dialog box.

MB/WS: Yes. The idea is that any time you're broken, any time you're stopped, you can use the debugger and pop up a modules list. And that will enumerate the EXE that you have loaded, obviously, as well as all the DLL's that are attached to it.

And it's a pretty cool dialog because it shows you the load order for all those DLL's, it shows you the exact path that they came from, it shows you the library name, which could be different than the module name. And it's very, very handy for situations where you have many, many models in your app.

TNC: Does it show second level dependencies, for example, DLL's that were loaded by a DLL that was loaded by your application?

MB/WS: If they're loaded, yes, absolutely.

If the load has been deferred, you won't see it in the list. If the DLL has been initialized and attached to your process, you will see it.

Delay Load Imports

TNC: You mention deferred loads. The linker now supports delay load imports. This is a new feature. Usually when you statically link an import LIB into your application, the associated DLL gets loaded when the application starts, and all the entry points are fixed up at that point.

MB/WS: Right.

TNC: I guess the way "delay load imports" work is the DLL gets loaded and the entry points get fixed up only when an entry point in that DLL gets called --is that correct?

MB/WS: Exactly. The linker and the process loader have done a little work together to conspire and find a way to defer the loading of DLL, exactly like you mentioned. [When a DLL entry point is referenced] for the first time, the loader realizes, well, now it's time to bring this DLL into memory. It brings it into memory.

If the entry point can't be found in the DLL an exception is thrown. You can set up an exception handler for that and figure out what wasn't found and what library and pop up a message box that actually has English text in it that explains what's missing, instead of like some ordinal was not found in the system DLL or whatever the terrible messages you normally get are.

If you don't like exceptions, you can also set a hook for that exception handling. And the hook is sometimes more convenient, anyway, because it lets you set up (unintelligible) in a global scope.

TNC: Is it possible to resume after trapping the exception?

MB/WS: No, the game's over right there. Because we're expecting that you're going to enter the DLL, you're going to switch across the boundary and (unintelligible) to get out.

TNC: So there's no way, for example, to actually locate the DLL or a substitute DLL?

MB/WS: Unfortunately, not in this release, no.

TNC: What background technology is necessary to make this work? Doesn't it require a change to the operating system? The loader is part of the OS.

MB/WS: The process has something called the import address table that is a list of all the functions that you're importing from DLL. Once the EXE is loaded and all the DLL's get loaded, the loader then goes through that address table and fixes up the addresses so that when you call into a function you jump to the right address on the DLL.

TNC: But the loader is part of Kernel32 or some other system DLL. It is part of the OS.

MB/WS: One of those. The operating system, yes.

TNC: So how can you make this work without patching Kernel32?

MB/WS: We have some kind of pseudo import address table in the EXE header that we populate with all of the imports you're importing from a DLL. And once you are going to call into that DLL, the code that was generated directs that call into the pseudo import address table, at which point then we can load the DLL and fix the address up to the real address in the DLL.

TNC: So really you're fooling the operating system.

MB/WS: In a way.

TNC: Are there any drawbacks to delay load imports? Would you recommend every project use it?

MB/WS: There are two drawbacks. One is, like with any technology, there's some sharp edges. We don't want to see people running out and saying, "Well, gee, let me delay load Kernel32" because you need Kernel32 to run [the application…]

So if you start switching on delay loading for libraries that are necessary to help you initialize or necessary to help you run, you're actually wasting time instead of saving time. Because you're going to [attempt] to defer the load, but the load's going to happen right away, anyway. And there's no net gain, and probably a net loss if you start doing that.

The other down side is that you need to be careful with the error handling. So you should have an error handler hooked up unless you're absolutely positive you're going to find all the DLL's.

TNC: Okay, Mike, Walter, we have to take a quick break. We'll be back after these important messages here on the Dr. Dobbs TechNetCast.

[Commercial break]

TNC: Welcome back to the program. We're talking about Visual C++ 6.0 with Mike Blaszczak and Walter Sullivan from the VC++ development team. Our toll-free number is 1-877-PSEUDO-1. And our chat server is irc.pseudo.com and the room is #tech.technetcast.

Mike, Walter, welcome back.

MB/WS: Thanks. Hey, we heard that spot in the break there... We're wondering if Rosie Perez is going to be on the show with us later.

TNC: We can maybe try to work that out. I don't see her anywhere here… but I can pass her your phone number if you want…

MB/WS: That would be great. Because she doesn't respond to my letters.

IMPORT LIBRARY FORMAT

TNC: She's sort of busy…

We're talking about the linker. Just going down the feature list, the linker features a revised import library format.

MB/WS: Yup.

MB/WS: It's just a more compact library format.

TNC: Does this mean that import LIBS from previous versions of C++ will now be incompatible with the applications generated with the current version?

MB/WS: No, they are compatible.

MB/WS: We degrade the file format as we load, as we open the library.

TNC: So new applications will be able to read the old file format.

MB/WS: You got it.

MB/WS: Absolutely.

MFC

TNC: Let's talk about MFC. That's a big piece. What's new in MFC in VC++ 6.0?

MB/WS: Holy cow... So we took everything that we did in the technology preview and polished it up and made sure it worked and now it's really part of the product. So that, to recap, includes like all the new common controls, all the IE 4.0 compatibility stuff. During the intro you mentioned CHtmlView, which hosts the [web browser control].

TNC: In general, there's support for all these interfaces exposed by IE, controls and so forth.

MB/WS: Absolutely.

TNC: Either UI elements or non-UI elements.

MB/WS: Right.

TNC: And actually, this was already part of the technology preview, wasn't it?

MB/WS: Right. So certainly the technology preview went out as near Beta quality, but we've done a lot of work in the meantime to fix up bugs and continue tracking the platform API to make sure MCF is fully compatible with it.

Internet Client SDK

TNC: Since we're talking about IE, there seems to be some confusion as far as SDKs are concerned.

Now, some of the MFC classes actually bind to components that are available in the Internet Client SDK. What What is the relationship here? There's some confusion as far as SDKs are concerned.

MB/WS: The Internet client SDK is the SEK we release when we ship a new version of IE and its technologies. And so it would allow VC++ developers or any C developer to immediately start taking advantage of those new API and technology.

TNC: But it seems it's so huge and all-encompassing... Parts of it really belong in Win32. For example, the HTTP stuff…

MB/WS: The idea is that then in the next platform SEK release they pick up all the new stuff that might have been released in the interim Internet SEK release.

TNC: Actually, one thing I want to point out is that to install VC++ 6.0, you need the latest version of Internet Explorer, the 4.01 version.

MB/WS: Yes. And it comes with the distribution CD.

ATL and MFC

TNC: When I installed it, I had 4.0 and it wasn't good enough.

So what else in MFC? There's support for ATL. And it makes it much easier for ATL to work with MFC applications.

MB/WS: Absolutely. So we've polished off a few things in MFC and ATL to make sure that applications that use, either components using MFC or applications using ATL would be a little easier to write. We've had tons and tons of supporting calls and feedback about I get this mysterious linker error, or this symbol is not found, and it's very confusing for users.

So by eliminating some of the technical barriers we just made that whole process a lot smoother.

The work is sort of hard to describe. I mean, it touches a lot of classes here and there throughout both frameworks, but we've just enhanced the compatibility, is the whole upshot.

TNC: And actually a new wizard actually helps with this.

MB/WS: Yes. So the object wizard now features a check box that says -- actually, it's a (unintelligible) project wizard that has a check box that says include MFC support. Yes, so that helps a lot, as well.

MFC also adds support for active document containment. We've had active document servers in MFC probably since 4.2, right?

MB/WS: Yes.

MB/WS: We also did a lot of tuning for the libraries linking patterns. So customers will notice that statically linking to MFC will draw in a lot less spurious garbage into their statically linked apps.

Realistically, you'll see probably between a five and ten percent decrease in the size of an apparently that's linked that way. So if I link Wordpad out of the sample statically to MFC, it's about seven percent smaller than it used to be. For small utilitarian apps, or situations where ATL customers are using classes from MFC like C string and C (unintelligible) and those guys, the savings is a lot more substantial, on the order of 30 to 50 percent.

TNC: One thing I noticed in the documentation is that now you recommend statically linking MFC into applications rather than using the dynamic libraries. Why is that?

MB/WS: Mainly to take advantage of these improvements that we've done. Certainly the improvements affect the initialization pattern in the DLL and what pages get hit as the DLL comes into memory. But we think that for most applications that we hear about customers using in MFC, it turns out that static linking is just a little bit better story for them.

You know, we certainly won't quit supporting the DLL, but on the other hand we want to make sure that users don't think that dynamically linking MFC is the only possible way to use the library.

TNC: And also there's been a lot of problems with DLL releases and new versions being copied to the system folder and other applications not working anymore. So really, by statically linking the code into your application, you're making sure that you're not going to have these version control problems.

MB/WS: At the expense of some executable size, sure. Yes, that's true.

Data Access

TNC: What else? Going down the feature list in MFC...

MB/WS: So one of the other things that we did, and this is also part of the integration work we did, is we have now support for Universal Data Access in MFC, as well as ATL, and it's actually using the same implementation. It's a shared implementation of those template classes that wrap the OLE DB interfaces.

TNC: OLE DB, for those of our viewers who are not familiar with it, is the data access interface. It's what's actually below ADO and it abstracts the data source, providing a data source provider and consumer.

MB/WS: That's right. The provider is like the driver.

TNC: I mentioned in the intro that Microsoft does not recommend using RDO anymore but says move to ADO. RDO being the COM interface over ODBC.

MB/WS: Right. And so Microsoft's [data access strategy] centers around ADO and OLE DB.

We want to help people make a decision between all the different database API's they could use and try and recommend the ones that we think they'll get the most benefit from.

Binary Compatible MFC Versions

TNC: Somewhere else in the MFC documentation I read something I did not understand. It said that MFC was now "binary compatible". What do you mean by that?

MB/WS: We have the shared DLL that lives in the Windows system directory. MFC versions 4.2 and 5.0 use the same DLL name. All that really means is that we've taken steps to insure as best we can that any application that was built with VC4.2 or VC5.0 and is already installed on the system will continue to work without problems after you install VC6.

TNC: So VC6 installs those new DLL's, but those new DLL's have the same entry points as the old --

MB/WS: Right. So the entry points are all the same, exposed to the same ordinals. For situations where we've added new functionality, we've been, you know, it's all through an automated process. But we've been very careful to make sure that the new entry points start at previously unused ordinals. Therefore, the DLL ends up being compatible. We're careful not to change underlying functionality, we're careful not to change the size or shape of any of the objects.

TNC: Can't you just distribute an MFC DLL that only new applications will load and the old applications will continue to load MFC4.2.DLL?

MB/WS: That's the simple solution, but it's fraught with problems. You can imagine that, you know, taking up a megabyte at a time for each release in someone's systems folder is a little bit annoying. But on top of that, there is a lot of scenarios where MFC is integrated in versions, incompatible versions.

So say you write an application, you rebuild it for Visual C++ 6.0. And you would load that hypothetical MFC 60.DLL. Then that application turns around and creates a control. And that control is purchased from a vendor who hasn't updated the control yet. And the control is relying on MFC 42.DLL.

That means that you have two versions of MFC in memory and your application starts to become a little big piggish. Because you have so much of the same code redundantly in memory.

Comparing two versions that way seems like a pretty insignificant problem. I mean, you're doubling the working set, so maybe, you know, twice, one megabyte, twice 1.2 megabytes just for MFC. But what if we did that for every release? If we did that for every release, you can imagine that you'd have four or five releases of MFC in scope of that problem. So you're multiplying the working set by five or six times.

TNC: One common observation about MFC is that it's really grown to be huge. Are there any plans to make it more granular, to organize it differently?

And also how much bigger will it grow…

MB/WS: We'll continue to support all the platform API's that our customers are interested in us supporting. And we think it's an important role that we have for Microsoft.

We do have plans in future versions to componentize and help granulize that library so that you really are only using the pieces of it that you need.

MB/WS: That's the brunt of our philosophy, I guess, in the next few versions of MFC, is to make sure that it is more granular and that you only pay as you go as you use parts of the library.

On the other and, I have absolutely no intention of sacrificing any support for any API or any pre-built functionality that any user works. Since -- those two strategies enable each other. If I make some implementation that's very popular but extremely expensive, it really doesn't matter as long as you only pay that expense in size if you're using that feature. People who don't use that feature will be quite happy to have it in the library when they need it, as long as they're not carrying it around with them everywhere they go.

TNC: Let's move away from MFC. There's a big feature list to cover here.

I just want to go back to the debugger a bit, because there's some small but really nice changes in the debugger. Small, but they can really make a difference. And one of the things I like is in the watch window, you can now see the last Win32 error from the WIN 32 API. How does this work?

MB/WS: Well, it turns out that it's smoke and mirrors…

We found out that the WIN32 API implementation stores the last error for a process, actually for a thread, in a particular location in memory, and we can go spy on it any time we want to.

TNC: What location is that?

MB/WS: I don't know. It's some number between one and four billion, but I don't know it off the top of my head…

TNC: I'm just wondering because it's part of a structure somewhere that's used by the operating system. Other information would be there.

MB/WS: Probably lots of neat stuff. You'd probably have to go get an Andrew Schulman book, though, to find out exactly what's going on there.

TNC: But how does a user actually make it work from the watch window?

MB/WS: When you enter a watch variable in the watch window, you can qualify that variable with various formatting options, just by typing the variable name, comma, and then the one or two character designation for the formatting option.

And so, simply, if you have a variable that is containing an H result, you can type in the variable name with a comma, HR after it and we'll display the actual value.

TNC: Displays a string. It's very nice.

And actually, I just want to mention, we have to take a quick break here, but before we leave, that you can also display in the watch window, you can take a variable and qualify as a window class or a window style and it will print out the window class and window style associated with that value. Very convenient.

When we come back after these quick messages we'll be giving away two software packages here, courtesy of Microsoft. Two games: the Neverhood, by Dreamworks, and Microsoft Flight Simulator '98. So don't go away. We'll be back on the Dr. Dobbs Technetcast.

[Commercial break]

TNC: Welcome back to the program. We're giving away software today courtesy of Microsoft. This is Microsoft Flight Simulator 98. Here it is. And Dreamworks, The Neverhood. Here it is waiting to be shipped out to you.

And we're going to make it really easy this week. Usually we ask questions. Today, be the first two callers to call in and you can win a copy of Flight Simulator 98 or The Neverhood. And our toll-free number again is 1-888-PSEUDO-1.

Our guests today are Walter Sullivan and Mike Blaszczak from the Microsoft Visual C++ development team. Welcome back, guys.

Okay, well, this is your last segment. One thing that I noticed and liked in the application is that the app wizard has a whole new set of new project types.

MB/WS: Sure does. You know, we've done a whole lot of work do enhance what you can do with the wizard.

So you'll notice that the MFC wizard allows you now to produce a non-doc view application right out of the wizard. We've also enhanced the console stuff. And we've done a bunch of stuff for the ATL object wizard as well. There's lots of whole new object types that you can add from that wizard down.

TNC: You can now create an MFC application that doesn't have the document view architecture. To do this, up to now, required generating an app and manually pulling out code. Dangerous.

MB/WS: Well, maybe not so dangerous, but I'm sure it was exciting.

But, yes, you can do that right out of the wizard right now. There are a few situations where doc view is just not appropriate, and we wanted to support those applications as well.

TNC: You can also generate a skeleton Win32 application. Because I rarely use MFC, I used to copy the same files over and over again to start my projects applications. And now I can just generate it with app wizard.

MB/WS: Sure. The plain WIN 32 console application's been there probably since 4.0. I know it was in 5.0. But we've also added MFC support to that guy. So if you are using MFC from a console app, you can flip a button and there it is.

TNC: Another thing I noticed is that the compiler generates a lot of new warnings. I compiled a large project I had been working on and was horrified when the compiler started emitting all these warnings…

MB/WS: The compiler guys, as well as doing some optimization for floating point and for in-line functions in this release to improve run time, have also gone on a binge to try to help people find bugs in their applications before the applications actually run. So the idea behind the new warnings is just to be a little bit more conservative about processing marginal code.

Some of the warnings are actually for standards compliance. So the compiler guys have stepped up the way exceptions are handled. We now deal with placement delete correctly. We also have a new option on the compiler/GZ, where GZ are both upper case letters. And that guy turns on some extra checking per function call that you can do in your debug releases to verify the state of the stack pointer and what's on the stack to make sure that you're not doing any bad casts on function pointers, or to make sure nothing has overwritten a boundary [and corrupted the stack.]

Those are pretty exciting options. We'd like to, going forward, do a lot more work in that arena to help C++ programmers become a lot more productive.

TNC: Let's talk about the C++ language features. Is there anything new in the compiler? There's nothing in the documentation. There's just a quick line saying that there's two Microsoft engineers are working on language compliance.

Are there new language features or fixed language features in this release?

MB/WS: Mike mentioned that we support the placement new and delete and vector new and delete.

MB/WS: We also did a lot of bug fixing on our template support.

TNC: And obviously those would come up in ATL.

MB/WS: Exactly. And ATL drove a lot of those because, as those of you who use ATL know, we use templates pretty aggressively there.

But as far as just generic conformance work, we didn't do a lot in this release. We're actually, for the most part, generally pretty happy with the level of conformance we have. We're well over 90 percent on any conformance that we've run, which is the highest on the Windows platform. We're pretty happy with that.

Rosie Perez

MB/WS: We can talk about ATL.

MB/WS: Let's talk about Rosie Perez.

TNC: Okay. What are your thoughts on Rosie Perez, Mike?

MB/WS: I'm wondering if she's a C++ programmer or not.

TNC: I'm sure she'd be willing to learn, with the right tutor…

MB/WS: She doesn't strike me as a Java kind of gal.

TNC: Well, I was at the Java 1 conference, and I was surprised at the number of women there, compared to other developer conferences…

MB/WS: Yes. We've noticed.

MB/WS: Yes. we've noticed that.

We haven't mentioned much about ATL. We wanted to point out that ATL, you know, I touched on it just a second ago. But ATL has a lot of new support in the object wizard. There's lots of cool new features you can use to object wizard to add support to your ATL projects.

One of the most exciting is called the composite control. And the idea behind the composite control is that you can take a dialog and turn it into an (unintelligible) control. So you end up with composite control. Water ballet is ballet in the water.

It turns out that the dialog can host other OLE controls, can host HTML, can host whatever you're interested in using. ATL will go ahead and when you co-create that control, it actually brings up the dialog, handles all the focusing issues, handles all the ambient property issues, handles all the event routing issues and gets you off the ground with a real large size component that is generally going to be more monolithic than a single OLE control, and therefore a lot more flexible.

ATL vs MFC

TNC: Now, I happen to like ATL because of its use of templates. But where is ATL more convenient than MFC for creating controls, and where would it be preferable to use MFC? What are the differentiating points here?

MB/WS: Going forward, I'll tell you, with this release, maybe in 5.0 I would have said, well, look, use ATL for OLE controls if you're going to be redistributing on the Web. They're much smaller, they're a little bit more flexible, they're a little bit faster because of the size.

If you're going to end up using any heavy scale features in MFC, such as database connectivity, go ahead and use MFC.

Starting with the 6.0 release, I think I'd change my advice and pretty much say, look, any time you write an OLE control from now on, go ahead and use ATL only. We'll create MFC support for creating controls, but we're probably not going to be interested in adding too much more functionality to it.

ATL provides a much better solution. It's a lot smaller, it's a lot more flexible. The object wizard now provides for light controls, which are, you know, slim down their interfaces and their ambient support to provide a much better footprint for controls that will be hosted in Internet Explorer, which is a great Web base story.

So I think that's sound advice for anyone who's starting a new project.

TNC: A while ago I wrote a container and I wrote it in C. It was arduous, but eventually using the "Inside OLE" book I was able to do it.

What is the easiest way now to write a container?

MB/WS: It's still tough.

MB/WS: In the long term we sort of envision MFC as a client side technology, whereas ATL is a component-oriented technology.

TNC: Is it possible to write a, or is there support on ATL for writing a container?

MB/WS: Indirectly through the composite control, sure.

MB/WS: In ATL there is a generic control containment technology that allows you to attach a control container to an HWND. And that's actually how we've implemented that composite control.

TNC: Why are there so few containers out there? Apart from development tools, there are very few applications that actually that can actually natively host ActiveX controls.

MB/WS: It's pretty pervasive in a development tool these days, that even as far as Access and Excel and Word and those kinds of desktop productivity apps, it's pretty common for them to be able to host controls because ActiveX controls are a pretty good component development story.

But as far as generic, things like Encarta or whatever, they would use ActiveX controls as part of their implementation, but wouldn't necessarily expose a way for you to generically host any ActiveX control.

TNC: Okay, Mike, Walter, we only have a minute left. I want to ask you, what language is the IDE actually written in?

MB/WS: C++

TNC: Without MFC?

MB/WS: With MFC.

TNC: What's next? Are you guys going to take a vacation now?

MB/WS: You got it.

MB/WS: We're on the next version, man.

TNC: This release is coming out in September?

MB/WS: That's right.

TNC: So what's on your to do list for VC 7.0…

MB/WS: Faster, better, smaller.

TNC: Are we going to see more integration with other Visual Studio products, for example?

MB/WS: That is a goal of the product. Exactly how that will pan out, we have yet to determine, because we're just entering the planning stages for those phases.

TNC: Okay, Walter, Mike, thank you very much for joining us today.

Mike Blazac and Walter Sullivan are developers on the Visual C++ team at Microsoft. We'll be back in two weeks, actually in three weeks here on the Dr. Dobbs Technetcast. Thanks for watching.

MB/WS: Thanks a lot.

TNC: Thanks, guys.



TechNetCast MSVC++ 6.0 Forum

Back to TechNetCast Home