Hidden ActiveX Params
Hello!
I have been scratching my head on this for weeks. Any help would be highly appreciated.
I want to dynamically create a third-party ActiveX control. I am having problems getting the hidden param's set -- as they do not have a published set methods. The ActiveX control can be downloaded at
https://www.hlebroking.com/v2/ebroking/ebroking_fe9/control/cswx.cab
The <object> tag for hosting the ActiveX control within a web page is appended at the end of this message. Hidden param's are "theme", "addr", "httpaddr", "port", "session", etc.
Many thanks!
Best regards
Boon
<object style="DISPLAY:inline-block" ID="svweb"
classid="clsid:B9B2EE1A-E314-4338-A305-BE845EACB112" codebase="control/cswx.cab#version=2,51,2005,715" height="350" onreadystatechange="activeXCtrl();">
<param name="size" value="0">
<param name="theme" value="0">
<param name="addr" value="202.9.104.201">
<param name="httpaddr" value="202.9.104.201">
<param name="port" value="81">
<param name="session" value="92fbbc28c8bdbd38d7ebe0fcbff0e017f1d2a5f8ad0556cdbbda71b6d9c6d3ef">
<param name="urlstocknews" value="http://www.hlgebiz.com/masanews/web/browsenews.asp?stock=%StockCode%&size=0&theme=0">
<param name="urlnews" value="http://www.hlgebiz.com/masanews/web/browsenews.asp?size=0&theme=0">
<param name="urlextrainfo" value="http://www.hlgebiz.com.my/v2/ebroking/ebroking_fe2/intrastatus.asp#OP">
<param name="customtranscost" value="2">
<param name="minbrokerage" value="12">
<param name="minbrokerageloan" value="2">
<param name="brokerage1" value="0,100000,0.7">
<param name="brokerage2" value="100000,500000,0.7">
<param name="brokerage3" value="500000,1000000,0.5">
<param name="brokerage4" value="1000000,2000000,0.3">
<param name="brokerage5" value="2000000,0,0.3">
<param name="stampduty" value="1,1000,200">
<param name="clearingfee" value="0.04,200">
<param name="appname" value="HLGeBiz">
<param name="supportchn" value="1">
<!--
<param name="favaddr" value="www.hlgebiz.com.my">
<param name="favcmd" value="control/csfav.dll">
<param name="favcheck" value="">
-->
</object>
[2464 byte] By [
boon313] at [2007-11-20 1:23:11]

# 1 Re: Hidden ActiveX Params
I want to dynamically create a third-party ActiveX control. I am having problems getting the hidden param's set -- as they do not have a published set methods.And? What is your question?
In case a property has no setter it means it was designed to be read-only (not hidden :)). Or to be set via some other method call. Read documentation on activex, ask support service... Do it civilized way. :)
# 2 Re: Hidden ActiveX Params
My question is how could I set the values for those hidden properties. There's no documentation. They are hidden, not readonly.
# 3 Re: Hidden ActiveX Params
My question is how could I set the values for those hidden properties. There's no documentation. They are hidden, not readonly.Any library/component has its own design. And client side must obey it. As I already told you, you either find a documented way (referring to documentation or support service) or abandone it and move to another component of a similar functionality.
I dont believe the web component breaking could have any sense.
# 4 Re: Hidden ActiveX Params
Maybe see if they have tech support for this control? ;)
Greg Dolley
# 5 Re: Hidden ActiveX Params
I am not trying to break the control. I am only interested in knowing how Internet Explorer could have initialised the control, by simply proving the param-value pairs.
I have seen artilces on CodeProject that show how to expose these hidden properties. I want to know how to set a value for them.
To get help from the technical support of the control, there's a very, very heafty fee to pay -- which is not possibly for a developer like myself. I am not trying to break their control. All I want is to host the control in my application, instead of Internet Explorer. It is, afterall, an ActiveX control.
If you could help, please let me know. Any help will be highly appreciated. Many thanks!
# 6 Re: Hidden ActiveX Params
It's been nearly 2 months since I first bumped into this problem. I have asked around here and there, but still can't find a person who has an answer to it. Any developer out there who knows how Internet Explorer or Firefox instantiates ActiveX controls?
# 7 Re: Hidden ActiveX Params
I am not trying to break the control. I am only interested in knowing how Internet Explorer could have initialised the control, by simply proving the param-value pairs.:D I got you at last.
IE queries an object for IPropertyBag interface and uses its Read and Write methods.
Hope this will help. :wave:
# 8 Re: Hidden ActiveX Params
Sorry, a slight refinement:
IE queries for IPersistPropertyBag interface, creates its own IPropertyBag, stuff it with the properties specified and provides its point to IPersistPropertyBag::Load method, which uses caller's property bag as source of values.
# 9 Re: Hidden ActiveX Params
Igor,
Many thanks for your help -- very much appreciated.
I am in the process of implementing a class that supports IPropertyBag. If anybody knows of any good, free implementation out there, please let me know. Thanks!
Boon
# 10 Re: Hidden ActiveX Params
I found a very good, working implementation of IPropertyBag.
I tried using CoCreateInstance to create an instance of the ActiveX at runtime, retrieved its IPersistPropertyBag interface, and invoked its InitNew and Load methods. All the properties in my PropertyBag were passing through successfully, but the ActiveX failed to initialise due to some unknown reason -- I guess it's because that the ActiveX was not docked to any parent?
So I tried inserting the ActiveX to a MFC Dialog form at design time, within Visual Studio 6. I then used MFC ClassWizard to generate a CWnd-derived wrapper class for the ActiveX and associated the ActiveX with a member variable. Now my question is:
How can I get the IUnknown interface from CWnd?
# 11 Re: Hidden ActiveX Params
CDialog will take care about this, to provide a site for activex and activate it.
# 12 Re: Hidden ActiveX Params
Yes. But my question is how should I go about to call IPersistPropertyBag's InitNew and Load methods?
How can I get a reference of the IPersistPropertyBag interface?
# 13 Re: Hidden ActiveX Params
If I am creating the ActiveX at runtime, I can do
CoCreateInstance ( guid, NULL, CLSCTX_INPROC_SERVER,
IID_IUnknown, (void**) &pIUnknown );
and
IPersistPropertyBag* pIPersistPropertyBag;
pIUnknown->QueryInterface( IID_IPersistPropertyBag,
(void**)&pIPersistPropertyBag );
to get a reference of IPersistPropertyBag. When inserting the ActiveX to a MFC Dialog Form at design time, I have a CWnd-derived class wrapping the ActiveX. My question is:
How can I get a reference of IPersistPropertyBag then?
/////////////////////////////////////////////////////////////////////////////////////////////
The following is the CWnd-derived wrapper class for the ActiveX generated by MFC ClassWizard.
class CCSX : public CWnd
{
protected:
DECLARE_DYNCREATE(CCSX)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xb9b2ee1a, 0xe314, 0x4338, { 0xa3, 0x5, 0xbe, 0x84, 0x5e, 0xac, 0xb1, 0x12 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName,
LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey); }
// Attributes
public:
CString GetBestbuyprice();
void SetBestbuyprice(LPCTSTR);
CString GetBestsellprice();
void SetBestsellprice(LPCTSTR);
CString GetCloseprice();
void SetCloseprice(LPCTSTR);
CString GetDate();
void SetDate(LPCTSTR);
CString GetLastdoneprice();
void SetLastdoneprice(LPCTSTR);
short GetLotsize();
void SetLotsize(short);
CString GetReferenceprice();
void SetReferenceprice(LPCTSTR);
CString GetStockcode();
void SetStockcode(LPCTSTR);
CString GetStockname();
void SetStockname(LPCTSTR);
CString GetStockstatus();
void SetStockstatus(LPCTSTR);
CString GetTime();
void SetTime(LPCTSTR);
CString GetUpperlimitprice();
void SetUpperlimitprice(LPCTSTR);
CString GetLowerlimitprice();
void SetLowerlimitprice(LPCTSTR);
CString GetBestbuyprice2();
void SetBestbuyprice2(LPCTSTR);
CString GetBestbuyprice3();
void SetBestbuyprice3(LPCTSTR);
CString GetBestsellprice2();
void SetBestsellprice2(LPCTSTR);
CString GetBestsellprice3();
void SetBestsellprice3(LPCTSTR);
short GetStocksector();
void SetStocksector(short);
CString GetMarketstatus();
void SetMarketstatus(LPCTSTR);
CString GetNewsid();
void SetNewsid(LPCTSTR);
short GetNewssource();
void SetNewssource(short);
CString GetVersion();
void SetVersion(LPCTSTR);
// Operations
public:
long SearchStock(LPCTSTR lpszStock);
void KeyPressed(short nKey);
};
# 14 Re: Hidden ActiveX Params
If I am creating the ActiveX at runtime, I can do
CoCreateInstance ( guid, NULL, CLSCTX_INPROC_SERVER,
IID_IUnknown, (void**) &pIUnknown );
and
IPersistPropertyBag* pIPersistPropertyBag;
pIUnknown->QueryInterface( IID_IPersistPropertyBag,
(void**)&pIPersistPropertyBag );
to get a reference of IPersistPropertyBag. When inserting the ActiveX to a MFC Dialog Form at design time, I have a CWnd-derived class wrapping the ActiveX. My question is:
How can I get a reference of IPersistPropertyBag then?
Right the same way:
GetDlgItem(IDC_MY_CONTROL)->GetControlUnknown()->QueryInterface(. . .);
# 15 Re: Hidden ActiveX Params
Many thanks!
I am going to try it now!!!
# 16 Re: Hidden ActiveX Params
Igor,
Many thanks for your help so far -- very much appreciated.
I am afraid I still can't get my code running. I think the problem is actually much more fundamental.
I got rid of *everything* by creating a brand new MFC Dialog based project completely from scratch, inserted the ActiveX at design time, compiled it, no error -- but it just will *not* run!
Why?
Could you please download a copy of the ActiveX and try this simple test for me? I am using Visual Studio 6.
Boon
Here's the link to download the ActiveX (try a few times if it doesn't work immediately):
https://www.hlebroking.com/v2/ebroking/ebroking_fe9/control/cswx.cab
# 17 Re: Hidden ActiveX Params
By the way, the ActiveX is called CyberStock 250.
# 18 Re: Hidden ActiveX Params
Has anyone managed to try out the ActiveX? I really need some help here.
# 19 Re: Hidden ActiveX Params
Nobody knows the answer to my last question?