home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / common / msdev98 / template / atl / control.ctl < prev    next >
Encoding:
Text File  |  1998-06-16  |  3.7 KB  |  131 lines

  1. [!newguid(InterfaceGUID)]
  2.  
  3. [!set(Attributes, "00110000000")]
  4.  
  5. [!if!(IEControl)]
  6. [!set(IPERSISTSTORAGE, "TRUE")]
  7. [!set(ISPECIFYPROPERTYPAGES, "TRUE")]
  8. [!set(IQUICKACTIVATE, "TRUE")]
  9. [!set(IDATAOBJECT, "TRUE")]
  10. [!set(IPROVIDECLASSINFO2, "TRUE")]
  11. [!set(IPROPERTYNOTIFYSINK, "TRUE")]
  12. [!endif]
  13.  
  14.  
  15. [!if=(CompositeControl, "TRUE")]
  16. [!Dialog("Names98", "ObjDlg98", "StockProps98")]
  17. [!set(WindowedOnlyEnabled, "TRUE")]
  18. [!set(NormalizeDCEnabled, "TRUE)]
  19. [!set(MiscStatus, "131473")]
  20. [!else]
  21. [!if=(HTMLControl, "TRUE")]
  22. [!Dialog("Names98", "ObjDlg98", "StockProps98")]
  23. [!set(WindowedOnlyEnabled, "TRUE")]
  24. [!set(MiscStatus, "131473")]
  25. [!AddStringToSymbol(HTMLFileName, ShortName, "UI.htm")]
  26. [!else]
  27. [!Dialog("Names98", "ObjDlg98", "CtlDlg98", "StockProps98")]
  28. [!endif]
  29. [!endif]
  30. [!if=(ConnectionPointsEnabled, "TRUE")]
  31. [!newguid(InterfaceGUIDCP)]
  32. [!endif]
  33. [!DoubleSlash(DGalleryPath, GalleryPath)]
  34.  
  35. [!strcpy(UpperShortName, ShortName)]
  36. [!toupper(UpperShortName)]
  37.  
  38. [!AddStringToSymbol(HeaderTemplate, GalleryPath, "control.h")]
  39. [!AddStringToSymbol(CPPTemplate, GalleryPath, "control.cpp")]
  40. [!AddStringToSymbol(RGSTemplate, GalleryPath, "control.rgs")]
  41. [!AddStringToSymbol(BMPTemplate, DGalleryPath, "ATL.bmp")]
  42. [!AddStringToSymbol(HTMTemplate, GalleryPath, "default.htm")]
  43. [!AddSymbolToString(IDR_REGISTRYID, "IDR_", UpperShortName)]
  44. [!AddSymbolToString(IDD_DIALOGID, "IDD_", UpperShortName)]
  45. [!AddSymbolToString(IDH_HTMLID, "IDH_", UpperShortName)]
  46. [!AddSymbolToString(IDR_BMPID, "IDB_", UpperShortName)]
  47.  
  48. [!GetTemporaryFileName(BMPRCName)]
  49. [!target(BMPRCName)]
  50. BITMAP  DISCARDABLE     "[!BMPTemplate]"
  51. [!target()]
  52. [!AddResourceFromFile(BMPRCName, IDR_BMPID, "BITMAP")]
  53. [!DeleteFile(BMPRCName)]
  54.  
  55. [!if=(HTMLControl, "TRUE")]
  56. [!set(atlhost.h, "<atlhost.h>")]
  57. [!AddIncludeFile(stdafx.h, atlhost.h)]
  58. [!set(mshtml.h, "<mshtml.h>")]
  59. [!AddIncludeFile(stdafx.h, mshtml.h)]
  60. [!set(exdisp.h, "<exdisp.h>")]
  61. [!AddIncludeFile(stdafx.h, exdisp.h)]
  62. [!AddStringToSymbol(HTMLTemplate, GalleryPath, "HTMLCTL.htm")]
  63. [!target(HTMLFileName)]
  64. [!include(HTMLTemplate)]
  65. [!target()]
  66. [!AddResourceFromFile(HTMLFileName, IDH_HTMLID, "HTML")]
  67. [!endif]
  68.  
  69. [!AddSymbolToSymbol(RGSName, ProjectDirectory, ShortName)]
  70. [!AddStringToSymbol(RGSName, RGSName, ".rgs")]
  71.  
  72. [!target(RGSName)]
  73. [!include(RGSTemplate)]
  74. [!target()]
  75.  
  76. [!AddRegistryToRC(RGSName, IDR_REGISTRYID)]
  77.  
  78. [!target(HeaderName)]
  79. [!include(HeaderTemplate)]
  80. [!target()]
  81.  
  82. [!target(CPPName)]
  83. [!include(CPPTemplate)]
  84. [!target()]
  85.  
  86. [!AddStringToSymbol(HTMName, ShortName, ".htm")]
  87.  
  88. [!target(HTMName)]
  89. [!include(HTMTemplate)]
  90. [!target()]
  91.  
  92. [!AddToObjectMap(CoClassName, ClassName)]
  93.  
  94. [!AddSymbolToString(header, "\"", HeaderName)]
  95. [!AddStringToSymbol(header, header, "\"")]
  96. [!AddIncludeFile(ProjectNameCPP,  header)]
  97.  
  98. [!if!(stdafx.h)]
  99. [!set(stdafx.h, "stdafx.h")]
  100. [!endif]
  101. [!if!(stdafx.cpp)]
  102. [!set(stdafx.cpp, "stdafx.cpp")]
  103. [!endif]
  104. [!set(atlctl.h, "<atlctl.h>")]
  105. [!set(olectl.h, "olectl.h")]
  106.  
  107. [!if=(CompositeControl, "TRUE")]
  108. [!set(atlhost.h, "<atlhost.h>")]
  109. [!AddIncludeFile(stdafx.h, atlhost.h)]
  110. [!endif]
  111.  
  112. [!AddIncludeFile(stdafx.h, atlctl.h)]
  113. [!AddImportFile(IDLProject, "oaidl.idl")]
  114. [!AddImportFile(IDLProject, "ocidl.idl")]
  115. [!AddIncludeFile(IDLProject, olectl.h)]
  116.  
  117. [!AddStringToSymbol(IDLInterface, GalleryPath, "ctlint.idl")]
  118. [!AddStringToSymbol(IDLCoClass, GalleryPath, "ctlco.idl")]
  119. [!AddInterfaceToIDL(IDLProject, IDLInterface)]
  120. [!AddCoClassToIDL(IDLProject, IDLCoClass)]
  121. [!AddFileToProject(CPPName)]
  122. [!AddFileToProject(HeaderName)]
  123.  
  124.  
  125. [!if=(CompositeControl, "TRUE")]
  126. [!AddStringToSymbol(DLGTemplate, GalleryPath, "cmposite.rc")]
  127. [!AddResourceFromFile(DLGTemplate, IDD_DIALOGID, "DIALOG")]
  128. [!Commit()]
  129. [!OpenDialog(IDD_DIALOGID)]
  130. [!endif]
  131.