Print Page | Close Window

Tabcontrol in none VB6 container

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=18480
Printed Date: 19 September 2024 at 4:37am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tabcontrol in none VB6 container
Posted By: youka
Subject: Tabcontrol in none VB6 container
Date 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
 
 
 
 
 
 
 



Replies:
Posted By: Oleg
Date Posted: 03 June 2011 at 4:49am
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


Posted By: youka
Date Posted: 04 June 2011 at 8:16am
Originally posted by oleg oleg wrote:

Please open new ticket in support.codejock.com (support@codejock.com) 
We will try to help and send changed ActiveX to test.
thanks oleg , i have sent the mail.
 
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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net