CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    5

    ActiveX control properties

    I have created an OCX, and it has some custom properties, ie left, top, width, height. When I add the ocx to a project, I can access the properties by right clicking on the control, but I cannot access them in the code.

    myocx.left

    Gives me an error saying that left is not a member of myocx. I can access the properties by calling myocx.GetLeft and myocx.SetLeft, but I would like to be able to just use the property name. Any help you could give would be greatly appreciated.

    Thanks,
    sfought




  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: ActiveX control properties

    I very often come upon such errors. They come mostly from misspelling. If you have generaed you class with the Class Wizzard probably all the names starts with m_ (like m_left). Or check if you have declared your member vars in some improper place. Try this out, it worked for me several times:

    find a nice clean WHITE space in the declaration of your class and write:

    public:
    int m_left;
    ....

    be sure your vars appear in BLACK


  3. #3
    Guest

    Re: ActiveX control properties

    I don't think you're supposed to have access to the properties. Most often they are declared private or protected with public access functions such as
    get_Property, set_Property. This is one part of object orientation. Simple, just use the get/set operations....

    /Rob


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured