 Issue 5979857238360064:
  Issues #1163, #1173 - refactor CPluginUserSettings  (Closed)
    
  
    Issue 5979857238360064:
  Issues #1163, #1173 - refactor CPluginUserSettings  (Closed) 
  | Left: | ||
| Right: | 
| OLD | NEW | 
|---|---|
| 1 #ifndef PLUGIN_USER_SETTINGS_H | |
| 2 #define PLUGIN_USER_SETTINGS_H | |
| 1 #pragma once | 3 #pragma once | 
| 
Oleksandr
2014/08/17 22:52:01
Do we really need both #pragma once and #ifndef ab
 
Eric
2014/09/29 18:45:41
It's not needed for correctness; the #ifndef guard
 
Oleksandr
2014/10/02 20:36:53
I have never seen both versions used simultaniousl
 
Eric
2014/10/14 22:23:50
All four of the ATL library use this pattern, for
 | |
| 2 | 4 | 
| 3 #include <vector> | 5 #include <OAIdl.h> | 
| 4 #include <utility> | |
| 5 | 6 | 
| 6 /* | 7 /* | 
| 7 Class is used to call methods Get,Set,Update of Settings object from JavaScript. | 8 Class is used to call methods Get,Set,Update of Settings object from JavaScript. | 
| 8 When url is local page "user_mysettings.html", after document is loaded, C++ cre ates Settings object in page's JavaScript. | 9 When url is local page "user_mysettings.html", after document is loaded, C++ cre ates Settings object in page's JavaScript. | 
| 9 Then var value = window.Settings.Get(par), window.Settings.Set(par, value), wind ow.Settings.Update() can be called from JavaScript | 10 Then var value = window.Settings.Get(par), window.Settings.Set(par, value), wind ow.Settings.Update() can be called from JavaScript | 
| 10 */ | 11 */ | 
| 11 class CPluginUserSettings: public IDispatch | 12 class CPluginUserSettings: public IDispatch | 
| 12 { | 13 { | 
| 13 public: | 14 public: | 
| 14 CPluginUserSettings(); | 15 CPluginUserSettings() // = default; | 
| 16 { | |
| 17 } | |
| 15 | 18 | 
| 16 // IUnknown | 19 // IUnknown | 
| 17 STDMETHOD(QueryInterface)(REFIID riid, void **ppvObj); | 20 STDMETHOD(QueryInterface)(REFIID riid, void **ppvObj); | 
| 18 ULONG __stdcall AddRef(); | 21 ULONG __stdcall AddRef(); | 
| 19 ULONG __stdcall Release(); | 22 ULONG __stdcall Release(); | 
| 20 | 23 | 
| 21 // IDispatch | 24 // IDispatch | 
| 22 STDMETHOD(GetTypeInfoCount)(UINT* pctinfo); | 25 STDMETHOD(GetTypeInfoCount)(UINT* pctinfo); | 
| 23 STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo); | 26 STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo** pptinfo); | 
| 24 STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID l cid, DISPID* rgdispid); | 27 STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames, LCID l cid, DISPID* rgdispid); | 
| 25 STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DI SPPARAMS* pDispparams, VARIANT* pVarResult, | 28 STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DI SPPARAMS* pDispparams, VARIANT* pVarResult, | 
| 26 EXCEPINFO* pExcepinfo, UINT* pArgErr); | 29 EXCEPINFO* pExcepinfo, UINT* pArgErr); | 
| 27 }; | 30 }; | 
| 31 | |
| 32 #endif | |
| OLD | NEW |