Hi,
I really need help . I would be very grateful.
I've made an activex control (using mfc)
It appears in my the web page but it seems that I don't set the property properly because mymethod has a MessageBox to show the value of the variable and it appears nothing in it (although it works fine in the test container)
<HTML>
<BODY>
<OBJECT ID=myactivex CLASSID="clsid:835373ED-FB5F-4EB5-84B1-28E1B30AA231" WIDTH=300 HEIGHT=200 BORDER=1 HSPACE=5>
<PARAM NAME="mymessage" VALUE="hello">
</OBJECT>
<INPUT TYPE="button" VALUE="mybutton" onClick="myactivex.mymethod()"><BR>
<BODY>
</HTML>
I haven't found a tutorial of activex and mfc, so I don't know if what I've done it's correct.
To set the property "mymessage", I've selected "Add Property" and I've set:
External name: mymessage
Type: BSTR
having selected Get/Set methods
and I've created m_mymessage as a member variable
So, I have:
BSTR CPru1Ctrl::GetMymessage()
{
CString strResult;
strResult = m_mymessage; //I've added this
return strResult.AllocSysString();
}
void CPru1Ctrl::SetMymessage(LPCTSTR lpszNewValue)
{
m_mymessage = lpszNewValue; //I've added this
SetModifiedFlag();
}
void CPru1Ctrl::mymethod()
{
MessageBox(m_mymessage, "value of mymessage", MB_OK);
}
Thanks in advance.
I really need help . I would be very grateful.
I've made an activex control (using mfc)
It appears in my the web page but it seems that I don't set the property properly because mymethod has a MessageBox to show the value of the variable and it appears nothing in it (although it works fine in the test container)
<HTML>
<BODY>
<OBJECT ID=myactivex CLASSID="clsid:835373ED-FB5F-4EB5-84B1-28E1B30AA231" WIDTH=300 HEIGHT=200 BORDER=1 HSPACE=5>
<PARAM NAME="mymessage" VALUE="hello">
</OBJECT>
<INPUT TYPE="button" VALUE="mybutton" onClick="myactivex.mymethod()"><BR>
<BODY>
</HTML>
I haven't found a tutorial of activex and mfc, so I don't know if what I've done it's correct.
To set the property "mymessage", I've selected "Add Property" and I've set:
External name: mymessage
Type: BSTR
having selected Get/Set methods
and I've created m_mymessage as a member variable
So, I have:
BSTR CPru1Ctrl::GetMymessage()
{
CString strResult;
strResult = m_mymessage; //I've added this
return strResult.AllocSysString();
}
void CPru1Ctrl::SetMymessage(LPCTSTR lpszNewValue)
{
m_mymessage = lpszNewValue; //I've added this
SetModifiedFlag();
}
void CPru1Ctrl::mymethod()
{
MessageBox(m_mymessage, "value of mymessage", MB_OK);
}
Thanks in advance.