AGCChat.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __AGCChat_h__
  2. #define __AGCChat_h__
  3. /////////////////////////////////////////////////////////////////////////////
  4. // AGCChat.h : Declaration of things common to chatting from AGC.
  5. //
  6. #include "..\igc\igc.h"
  7. #include "resource.h"
  8. #include <agc.h>
  9. /////////////////////////////////////////////////////////////////////////////
  10. // Command Name Resolution
  11. inline HRESULT FindCommandName(const char* pszCommand, CommandID* pID,
  12. REFCLSID clsid, REFIID iid)
  13. {
  14. // Search for the specified command string
  15. assert(pszCommand);
  16. for (CommandID i = 0; i < c_cidMax; ++i)
  17. {
  18. if (!_stricmp(pszCommand, c_cdAllCommands[i].szVerb))
  19. {
  20. *pID = i;
  21. return S_OK;
  22. }
  23. }
  24. // Specified command string was not found
  25. return AtlReportError(clsid, IDS_E_COMMANDNAME, iid,
  26. MAKE_HRESULT(1, FACILITY_ITF, IDS_E_COMMANDNAME),
  27. GetAGCGlobal()->GetResourceInstance());
  28. }
  29. inline HRESULT FindCommandName(const OLECHAR* pszCommand, CommandID* pID,
  30. REFCLSID clsid, REFIID iid)
  31. {
  32. USES_CONVERSION;
  33. const char* pszCommandA = pszCommand ? OLE2CA(pszCommand) : "";
  34. return FindCommandName(pszCommandA, pID, clsid, iid);
  35. }
  36. /////////////////////////////////////////////////////////////////////////////
  37. #endif // !__AGCChat_h__