rxregsvc.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // Name: rxregsvc.h
  12. //
  13. // Description:
  14. //
  15. //////////////////////////////////////////////////////////////////////////////
  16. #ifndef _RXREGSVC_H
  17. #define _RXREGSVC_H 1
  18. #include "rxdlinkr.h"
  19. #include "adesk.h"
  20. #pragma pack (push, 8)
  21. // Load a module, given its file name.
  22. //
  23. bool acrxLoadModule(const ACHAR * moduleName, bool printit, bool asCmd=false);
  24. // Load an app, given its logical app name.
  25. //
  26. bool acrxLoadApp(const ACHAR * appname, bool asCmd=false);
  27. // UnLoad a module, given its file name. Module's services and classes are
  28. // queried for dependencies. If all module elements have no dependencies,
  29. // then unload can proceed.
  30. //
  31. bool acrxUnloadModule(const ACHAR * moduleName, bool asCmd=false);
  32. // UnLoad an app, given its logical app name.
  33. //
  34. bool acrxUnloadApp(const ACHAR * appName, bool asCmd=false);
  35. // Return an AcDbVoidPtrArray* containing names of applications
  36. // that are currently loaded. Caller must delete the names
  37. // and the array afterwards. See acrxAppIsLoaded(), if that's
  38. // all you want to use this for.
  39. //
  40. void *acrxLoadedApps();
  41. // Given its logical app name, load all its auto loaded components
  42. // In the demand loaded registry setting, there is a subkey "AutoloadApps"
  43. // that developers can add to put their app to be loaded when the other
  44. // application is loaded.
  45. //
  46. // %ProductRegRoot%\Applications\SomeApp\AutoloadApps
  47. //
  48. // For example:
  49. // HCKU\..\%ProductRegRoot%\Applications\EtransmitEngine\AutoloadApps
  50. // AcStETransmit
  51. bool ACDB_PORT acrxLoadAutoloadApps(const ACHAR * appname);
  52. // Given its logical app name, unload all its auto loaded components
  53. // In the demand loaded registry setting, there is a subkey "AutoloadApps"
  54. // that developers can add to put their app to be loaded when the other
  55. // application is loaded.
  56. //
  57. // %ProductRegRoot%\Applications\SomeApp\AutoloadApps
  58. //
  59. bool ACDB_PORT acrxUnloadAutoloadApps(const ACHAR * appname);
  60. // Find out if an app is loaded. Name is case independent
  61. // but must include the extension (.arx etc).
  62. //
  63. bool ADESK_STDCALL acrxAppIsLoaded(const ACHAR *pAppName);
  64. // Return a const string containing the ObjectDBX Registry root,
  65. // e.g. Software\Autodesk\ObjectDBX\R15.0
  66. //
  67. const ACHAR * acrxObjectDBXRegistryKey();
  68. // Return 32 bit value containing the product locale id
  69. //
  70. Adesk::UInt32 acrxProductLCID();
  71. // Write an entry to the NT/WIN95 system registry for this app.
  72. // Returns:
  73. // AcadApp::eOk if success.
  74. // AcadApp::eKeyExists if entry already exists and can't be over written.
  75. // AcadApp::eRejected if the write could not be completed.
  76. //
  77. AcadApp::ErrorStatus acrxRegisterApp(AcadApp::LoadReasons alr,
  78. const ACHAR *logicalName, bool bDwgU = false);
  79. // Remove app entry from the NT/WIN95 system registry.
  80. // Returns:
  81. // AcadApp::eOk if success.
  82. // AcadApp::eRejected if entry cannot be removed.
  83. // AcadApp::eKeyNotFound if entry cannot be found.
  84. //
  85. AcadApp::ErrorStatus acrxUnregisterApp(const ACHAR *logicalname,
  86. bool bDwgU = false);
  87. // return a void * representing a handle to the module that
  88. // registered the service, NIL if service is not present.
  89. //
  90. // For be use in C API libraries to link up stub entry points with
  91. // real ones. C++ libraries can use this function as well.
  92. //
  93. void * acrxGetServiceSymbolAddr(const ACHAR * serviceName, const ACHAR * symbol);
  94. // Tell system that the service represented by serviceName string is
  95. // present in this module. The system registers an instance
  96. // of AcRxService with this name, for internal use.
  97. //
  98. void* acrxRegisterService(const ACHAR * serviceName);
  99. // Return boolean indicating whether named service is registered
  100. // and present in the system.
  101. //
  102. bool acrxServiceIsRegistered(const ACHAR * serviceName);
  103. // Unlocks an application to enable it from being unloaded in mid-session.
  104. // The default is that applications are locked, and hence unloadable in
  105. // mid-session. The appId argument is the Id passed in as a void* during
  106. // the AcRx::kInitAppMsg call back when the application is loaded. Return
  107. // of non-zero means success.
  108. //
  109. bool acrxUnlockApplication(void* appId);
  110. // Returns non-zero if the specified app is locked.
  111. //
  112. bool acrxApplicationIsLocked(const ACHAR * modulename);
  113. // Symmetric to acrxUnlockApplication. Locks it, and hence prevents it from
  114. // being unloaded in mid-session. Return of non-zero means success.
  115. //
  116. bool acrxLockApplication(void* appId);
  117. // acrxApplicationsIsMDIAware()
  118. // Retruns non-zero if application has registered itself as MDI aware during its kInitApp msg
  119. //
  120. bool acrxIsAppMDIAware(const ACHAR * moduleName);
  121. // acrxSetApplicationMDIAware()
  122. // Register Application as MDI aware default is NOT MDI aware
  123. //
  124. bool acrxRegisterAppMDIAware(void* appId);
  125. // acrxSetApplicationNotMDIAware()
  126. // ARX application is NOT MDI aware this is the default.
  127. //
  128. bool acrxRegisterAppNotMDIAware(void* appId);
  129. #pragma pack (pop)
  130. #endif