-
VB6 ocx to ATL
I have existing VB ocx control , now i want to create a ATL control. A container 'C' hac already stored a file with a control file1.xxx( activex test container).Now i create a similar ATL control and unregister the VB control and register the ATL.
The control get replaced, but the properties of the control i save in file 1 are not received.
IN vb i have saved the properties as:
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "booProp", var2, "False"
PropBag.WriteProperty "douProp", var1, "0"
End Sub
include the get set function
The container will save the entire object in a stream, hence will loading in VC++
I load the properties in ATL using the function.
Also the saving of prperties by VB6 is ni <name, value> format
STDMETHODIMP CsameerCtl::Load(IStream *pStream)
{
BYTE buff[256];
ULONG ulNumBytes = 0;
pStream->Read(&var2,sizeof(bool),&ulNumBytes);
pStream->Read(&var1,sizeof(double),&ulNumBytes);
return (S_OK);
}The value in the variables we get are not correct.
Thank You
Pawan