home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VCM / VCM.MDB / VcmComponentContainer / 26_Cabinet / CREATEDOCFILE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-18  |  624 b   |  31 lines

  1. #include <windows.h>
  2. #include "ActiveDoc_i.c"
  3.  
  4. // Creates a compound file which can be used to host ActiveDoc in Internet Explorer
  5. // Compile with
  6. // cl createdocfile.cpp /link ole32.lib
  7. // Use ActiveDoc.htm to test - after this program has been run.
  8.  
  9. void main ()
  10. {
  11.     HRESULT hr = CoInitialize(NULL);
  12.     if (FAILED(hr))
  13.         return;
  14.  
  15.     IStorage  * pStorage = NULL;
  16.  
  17.     hr = StgCreateDocfile(
  18.         L"ActiveDoc.AAA",
  19.         STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE ,
  20.         NULL,
  21.         &pStorage);
  22.  
  23.     if (SUCCEEDED(hr))
  24.     {
  25.         pStorage->SetClass(CLSID_CActiveDoc);
  26.         pStorage->Release();
  27.     }
  28.  
  29.     CoUninitialize();
  30. }
  31.