Problem - Value not excepted
-
Hi guys! I have a problem with my ActiveX component, that i developed (with VS.NET, ATL7, C++)! I created a ActiveX component with one property "FileName", who's a BSTR. I have included my ActiveX component in a Visual Basic sample. The property "FileName" is visible in the object property viewer and I can change his value! That's fine! But when I start my Visual Basic sample, the ActiveX component will use the old standard value of "FileName" and not the value I have changed during the design time! Is this normal? How can I fix it? Here is a little of my source code, the header file:
// FileLogTarget.h : Deklaration von CFileLogTarget
#pragma once
#include "resource.h" // Hauptsymbole
#include
#include "DCIpuControl2003.h"// CFileLogTarget
class ATL_NO_VTABLE CFileLogTarget :
public CComObjectRootEx,
public IDispatchImpl,
public IPersistStreamInitImpl,
public IOleControlImpl,
public IOleObjectImpl,
public IOleInPlaceActiveObjectImpl,
public IViewObjectExImpl,
public IOleInPlaceObjectWindowlessImpl,
public CComCoClass,
public CComControl
{
public:CFileLogTarget() : m\_bstrFileName(OLESTR("IpuLogFile.dat")) { m\_bAutoSize = TRUE; m\_bResizeNatural = TRUE; SIZEL sPix, sHiM; sPix.cx = 32; sPix.cy = 32; AtlPixelToHiMetric(&sPix, &sHiM); m\_sizeExtent = sHiM; m\_sizeNatural = sHiM; }
DECLARE_OLEMISC_STATUS(OLEMISC_RECOMPOSEONRESIZE |
OLEMISC_INVISIBLEATRUNTIME |
OLEMISC_CANTLINKINSIDE |
OLEMISC_INSIDEOUT |
OLEMISC_ACTIVATEWHENVISIBLE |
OLEMISC_SETCLIENTSITEFIRST
)DECLARE_REGISTRY_RESOURCEID(IDR_FILELOGTARGET)
BEGIN_COM_MAP(CFileLogTarget)
COM_INTERFACE_ENTRY(IFileLogTarget)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IViewObjectEx)
COM_INTERFACE_ENTRY(IViewObject2)
COM_INTERFACE_ENTRY(IViewObject)
COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
COM_INTERFACE_ENTRY(IOleInPlaceObject)
COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
COM_INTERFACE_ENTRY(IOleControl)
COM_INTERFACE_ENTRY(IOleObject)
COM_INTERFACE_ENTRY(IPersistStreamInit)
COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
END_COM_MAP()BEGIN_PROP_MAP(CFile