CodeProject: Post-Mortem Debugging Your Application with Minidum. Download source code - 2Kb Summary: If your application crashes at a customer site, you can now debug it after the fact using minidumps and the Microsoft® Visual Studio® NET debugger. This article describes how minidumps work, how to make your application create them when it crashes, and how to read them back with Visual Studio .NET. Minidumps are key to the Microsoft error reporting program to improve the reliability of the Windows operating system and applications such as Visual Studio .NET.
This article also describes how to use the Microsoft symbol server to automatically find symbols for system components. This article assumes that you are familiar with Win32 and C++ programming. Contents What Is a Minidump? What Is a Minidump? A minidump is a file containing the most important parts of a crashed application. Since the early days of Windows NT, the Dr. They were huge. Minidumps were designed to fix these problems in a number of ways: Creating a Minidump Build Issues Figure 1. Figure 2. CodeProject: A simple yet debuggable COM skeleton code. Free sou. Download source files - 58.1 Kb Introduction This article and topic will probably inspire reluctance from code gurus. But, even after 7 years and a massive use in today's Windows-centric world, I often see people wondering the simplest questions about COM. Microsoft introduced several years ago the ATL library, hoping that ready-to-use macros would simplify the COM development process. But in practice, the macros tend to obfuscate what the code really does and is expected to do.
Furthermore, one obvious thing at the basis of this article is that ATL macros produce un-debuggable code. That's why I shall in this article, show how to write working COM components from scratch, and without a single macro. The remainder of this article provides three (hopefully reusable) sample COM implementations : a simple COM DLL an automation-enabled COM DLL an automation-enabled COM exe Plus several working test environments (C/C++ and VB). A simple COM DLL Now we are going to declare our COM interface. Managing Object Lifetimes Through Reference Counting (COM) In traditional object systems, the life cycle of objects—that is, the issues surrounding the creation and deletion of objects—is handled implicitly by the language (or the language run time) or explicitly by application programmers.
In an evolving, decentrally constructed system made up of reused components, it is no longer true that any client, or even any programmer, always "knows" how to deal with a component's lifetime. For a client with the right security privileges, it is still relatively easy to create objects through a simple request, but object deletion is another matter entirely. It is not necessarily clear when an object is no longer needed and should be deleted. (Readers familiar with garbage-collected programming environments, such as Java, may disagree; however, Java objects do not span machine or even process boundaries, and therefore the garbage collection is restricted to objects living within a single-process space. For more information, see the following topics: CodeProject: Introduction to COM Part II - Behind the Scenes of. Purpose of this Article As with my first Introduction to COM article, I have written this tutorial for programmers who are just starting out in COM and need some help in understanding the basics.
This article covers COM from the server side of things, explaining the steps required to write your own COM interfaces and COM servers, as well as detailing what exactly happens in a COM server when the COM library calls into it. Introduction If you've read my first Intro to COM article, you should be well-versed in what's involved in using COM as a client. Now it's time to approach COM from the other side - the COM server. This article assumes you are proficient in C++ and understand the concepts and terminology covered in the first Intro to COM article. Quick Tour of a COM Server - Describes the basic requirements of a COM server.
Server Lifetime Management - Describes how a COM server controls how long it remains loaded. Other Details - Notes on the source code and debugging. QueryInterface() Writing Stable Browser Extensions. The stability of Windows Internet Explorer is adversely affected by poorly implemented extensions such as Browser Helper Objects (BHOs), toolbars, or Microsoft ActiveX controls.
This article summarizes important guidelines developers should follow when creating Component Object Model (COM) extensions to customize the browser and provides tips and best practices for well-behaved browser extensions that do not cause Internet Explorer to crash or become unresponsive ("hang"). This article contains the following sections: COM Considerations Tip 1: Use AddRef and Release correctly. Tip 2: Implement DllCanUnloadNow correctly and efficiently. Code Safety Tip 3: Always validate external input to prevent buffer overruns. Tip 4: Use the /GS compiler switch to add extra protection against buffer overruns. Tip 5: Check the return values of each function for errors before continuing. Threading Tip 6: Handle your chosen threading model appropriately. Tip 7: Avoid single threaded controls. Timeouts DLLMain. About Browser Extensions. Browser extensions allow developers to provide easy access to their browser enhancements by adding elements (like an Explorer Bar) to the default user interface.
This enables developers to create Explorer Bars and add entries into the standard context menus. Developers can also add entries into the Tools menu and buttons to the toolbar. Benefits So what are the benefits of utilizing browser extensions? Microsoft Internet Explorer 4.0 allowed developers to create Explorer Bars (also known as Browser Bands and Communication Bands) and add entries to the standard context menus. Menu items in the Tools menu Toolbar buttons These additions are enhancements to the existing user interface, so there will be no negative effect on the end-user's experience.
Scenarios Let's say you've implemented an Explorer Bar that displays financial information (like a stock ticker or currency exchange rates) that you want to provide for your customers. Related Topics Overviews Tutorials Examples. Creating Custom Explorer Bars, Tool Bands, and Desk Bands. The Explorer Bar was introduced with Microsoft Internet Explorer 4.0 to provide a display area adjacent to the browser pane. It is basically a child window within the Internet Explorer window, and it can be used to display information and interact with the user in much the same way.
Explorer Bars are most commonly displayed as a vertical pane on the left side of the browser pane. However, an Explorer Bar can also be displayed horizontally, below the browser pane. There is a wide range of possible uses for the Explorer Bar. Users can select which option they want to see in several different ways, including selecting it from the Explorer Bar submenu of the View menu, or clicking a toolbar button. Internet Explorer provides several standard Explorer Bars, including Favorites and Search.
One of the ways you can customize Internet Explorer is by adding a custom Explorer Bar. To create a custom Explorer Bar, you must implement and register a band object. The following topics are discussed. Browser Extensions. Browser extensions allow developers to add functionality to the browser and enhance the user interface in a way that is not directly related to the viewable content of Web pages. This class of extensibility includes add-on functionality that users might install to enhance their browsing experience. Overviews/Tutorials Methods Interfaces Structures. CodeProject: COM in plain C. Free source code and programming he.
Download source files - 17.6 Kb Contents Introduction There are numerous examples that demonstrate how to use/create COM/OLE/ActiveX components. But these examples typically use Microsoft Foundation Classes (MFC), .NET, C#, WTL, or at least ATL, because those frameworks have pre-fabricated "wrappers" to give you some boilerplate code. Unfortunately, these frameworks tend to hide all of the low level details from a programmer, so you never really do learn how to use COM components per se. Rather, you learn how to use a particular framework riding on top of COM. If you're trying to use plain C, without MFC, WTL, .NET, ATL, C#, or even any C++ code at all, then there is a dearth of examples and information on how to deal with COM objects. With standard Win32 controls such as a Static, Edit, Listbox, Combobox, etc., you obtain a handle to the control (i.e., an HWND) and pass messages (via SendMessage) to it in order to manipulate it. Not so with an OLE/COM object.
A COM object and its VTable.