19
19
extern " C"
20
20
{
21
21
#include " ..\lua.h"
22
- #include " ..\lauxlib .h"
22
+ #include " ..\lualib .h"
23
23
#include " LuaCompat.h"
24
24
}
25
25
@@ -36,6 +36,7 @@ const OLEVERB verbs[] = {
36
36
{ OLEIVERB_PRIMARY, 0 , 0 , 0 },
37
37
{ OLEIVERB_UIACTIVATE, 0 , 0 , 0 }
38
38
};
39
+ // unused: OLEIVERB_PRIMARY, OLEIVERB_OPEN, OLEIVERB_DISCARDUNDOSTATE
39
40
40
41
#define MIDL_DEFINE_GUID (type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8 ) \
41
42
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
@@ -742,46 +743,32 @@ STDMETHODIMP tLuaControl::GetClipboardData(DWORD dwReserved, IDataObject** ppDat
742
743
STDMETHODIMP tLuaControl::DoVerb (LONG lVerb, LPMSG pMsg, IOleClientSite *pActiveSite,
743
744
LONG lIndex, HWND hwndParent, LPCRECT prcPosRect)
744
745
{
745
- HRESULT hr = OLEOBJ_S_INVALIDVERB; // See Lua mailing list (NJG)
746
+ HRESULT hr;
746
747
747
748
switch (lVerb) {
748
749
case OLEIVERB_SHOW:
749
750
case OLEIVERB_INPLACEACTIVATE:
750
751
case OLEIVERB_UIACTIVATE:
751
- hr = InPlaceActivate (lVerb==OLEIVERB_UIACTIVATE);
752
- return (hr);
753
-
752
+ hr = InPlaceActivate (lVerb == OLEIVERB_UIACTIVATE);
753
+ return hr;
754
+ // FIX: handle cases for in-place activatable v.s. nonactivatable objects?
755
+ // e.g. for OLEIVERB_UIACTIVATE, "If the object does not support in-place
756
+ // activation, it should return E_NOTIMPL" (msdn)
754
757
case OLEIVERB_HIDE:
755
758
UIDeactivate ();
756
759
if (m_fInPlaceVisible) SetInPlaceVisible (FALSE );
757
760
return S_OK;
758
-
759
761
default :
760
- // if it's a derived-control defined verb, pass it on to them
761
- //
762
- if (lVerb > 0 ) {
763
-
764
- // FIX-TODO!!! hr is undefined here.
765
- // http://lua-users.org/lists/lua-l/2006-09/msg00030.html
766
- // #pragma message("FIX - luacom bug http://lua-users.org/lists/lua-l/2006-09/msg00030.html")
767
- // FAIL("FIX - luacom bug lua-l/2006-09/msg00030.html");
768
-
769
- if (hr == OLEOBJ_S_INVALIDVERB) {
770
- // unrecognised verb -- just do the primary verb and
771
- // activate the sucker.
772
- //
773
- hr = InPlaceActivate (0 );
774
- return (FAILED (hr)) ? hr : OLEOBJ_S_INVALIDVERB;
775
- } else
776
- return hr;
777
- } else {
778
- FAIL (" Unrecognized Negative verb in DoVerb(). bad." );
762
+ if (lVerb > 0 ) { // derived control defined verb
763
+ // treat unrecognized verb as OLEIVERB_PRIMARY (i.e. just activate in some way)
764
+ hr = InPlaceActivate (0 );
765
+ return FAILED (hr) ? hr : OLEOBJ_S_INVALIDVERB;
766
+ } else { // unrecognized negative verb
779
767
return E_NOTIMPL;
780
768
}
781
769
break ;
782
770
}
783
771
784
- // dead code
785
772
FAIL (" this should be dead code!" );
786
773
}
787
774
0 commit comments