1
0

JSAPI_DispatchTable.cpp 394 B

12345678910111213141516171819202122
  1. #include "JSAPI_DispatchTable.h"
  2. #include <strsafe.h>
  3. JSAPI::Dispatcher::Dispatcher(const wchar_t *_name, DISPID _id, IDispatch *_object)
  4. :id(_id), object(_object)
  5. {
  6. memset(name, 0, sizeof(name));
  7. if (NULL != object)
  8. object->AddRef();
  9. StringCchCopyW(name, ARRAYSIZE(name), _name);
  10. }
  11. JSAPI::Dispatcher::~Dispatcher()
  12. {
  13. if (NULL != object)
  14. {
  15. object->Release();
  16. object = NULL;
  17. }
  18. }