Tabcontrol in none VB6 container |
Post Reply |
Author | |
youka
Groupie Joined: 20 March 2006 Status: Offline Points: 20 |
Post Options
Thanks(0)
Posted: 01 June 2011 at 5:01am |
Hi all , This is a question for CJ developers. I know this is far beyond a technical support , but i do hope to find answers here.
I am recently work on a test container that can host activex controls but found something strange in cj tab control(tested with suitcontrol 11.1.3 and 15.0.2 demo), i have even succeeded in make the old age sstab control work with my container , but not for codejock tabcontrol.
when tabcontrol switchs selected tab, the control will do late bound invoke to extender controls' visible, name, index , left properties, but it won't work if it's not VB6.
the problem is that when tabcontrol is trying to set the left and visible property to the child control contained, but the parameter passed is not a COM standard one, which is , as documented in msdn, 'a DISPATCH_PROPERTYPUT call should use named arguments' , in fact it's not and it do works with VB6, but won't work with other containers.
snap1:
getidofname : left
snap2:
invoke property put to left to an offscreen position
you can see that "cNamedArgs' is 0 and rgdispidNamedArgs is NULL instead of &DISPID_PROPERTYPUT
Regards,
-Youka
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Please open new ticket in support.codejock.com (support@codejock.com)
We will try to help and send changed ActiveX to test.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
youka
Groupie Joined: 20 March 2006 Status: Offline Points: 20 |
Post Options
Thanks(0)
|
Also present a small fix here for ATL dispatch impl (not so good but anyway solve the problem now)
#define NO_DISPATCH_FIX //fix for some control ?
#ifndef NO_DISPATCH_FIX
#define IDispatchImplFix IDispatchImpl
#else
//define for replacement of idispatchimpl
template <class T, const IID* piid = &__uuidof(T), const GUID* plibid = &CAtlModule::m_libid, WORD wMajor = 1,
WORD wMinor = 0, class tihclass = CComTypeInfoHolder>
class ATL_NO_VTABLE IDispatchImplFix : public IDispatchImpl<T, piid, plibid, wMajor, wMinor>
{
public:
STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid,
LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult,
EXCEPINFO* pexcepinfo, UINT* puArgErr)
{
HRESULT hr = _tih.Invoke((IDispatch*)this, dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr);
if (hr == DISP_E_PARAMNOTFOUND && wFlags == DISPATCH_PROPERTYPUT)
{
//fix and invoke again
if (pdispparams->cNamedArgs==0 && pdispparams->rgdispidNamedArgs==NULL && pdispparams->cArgs==1)
{
DISPID dispidPut = DISPID_PROPERTYPUT;
pdispparams->rgdispidNamedArgs = &dispidPut;
pdispparams->cNamedArgs=1;
hr = _tih.Invoke((IDispatch*)this, dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr);
}
}
return hr;
}
};
#endif |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |