C/C++ Source: setDebugOutput.cpp, DBStream.h, and DBStream.cpp

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - Digital Signatures

C/C++ Source: setDebugOutput.cpp, DBStream.h, and DBStream.cpp

The source code consists of the following three files.

Source file Description
setDebugOutput.cpp Main program that instantiates a DBStream object, sets it on the IXMLDigitalSignature object to receive debug output, and calls sign/verify on IXMLDigitalSignature.
DBStream.h Header file for the DBStream class.
DBStream.cpp Class implementation of DBStream.

Try It!

  1. Ensure that you have completed all the procedures in Getting Started with XML Digital Signatures.
  2. Start Visual C++.
  3. From the File menu, select New. On the Projects tab of the New dialog box that appears, select Win32 Console Application in the left pane. Then type "setDebugOutputProj" in the Project name field. For the project Location field, either accept the default setting or choose another location. Click OK.
  4. The Win32 Console Application property page will appear. For the type of Console Application, select An empty project and click Finish. When the New Project Information box displays, click OK.
  5. Select FileView on the project browser, and highlight setDebugOutputProj files. From the File menu, select New.
  6. On the Files tab of the New dialog box, highlight C++ Source File. Then type "signature.template.xml" in the File name text box.
  7. Click OK.
  8. Copy the XML signature template file from Resource: signature.template.xml, and paste it into the text file you just created.
    Note   You can also copy the file into the project's main directory using Windows Explorer (or a command prompt).
  9. Repeat steps 5-8 for the setDebugOutput.cpp C++ file.
  10. Repeat steps 5-8 for the DBStream.h header file.
  11. Repeat steps 5-8 for the setDebugOutput.cpp C++ file.
  12. From the Project menu, click Settings..., then click the Link tab.
  13. In Object/library modules, type "crypt32.lib". Insert this text either before or after the existing string that lists all objects and modules for the current project. Then click OK.
  14. Build the sample by selecting Build setDebugOutputProj.exe from the Build menu.
  15. Execute the sample application by selecting !Execute setDebugOutputProj.exe from the Build menu.
  16. Verify that you get output similar to that listed in the Output topic at the end of this example.