Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Problem - Value not excepted

Problem - Value not excepted

Scheduled Pinned Locked Moved COM
c++comhelpquestioncsharp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel Strigl
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups