CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Activex

  1. #1
    Join Date
    Jun 1999
    Location
    Pune, Maharastra, India
    Posts
    59

    Activex

    Can we pass a form to an Activex Exe .I have an Activex Dll to which I pass a form and change the caption and the form's caption gets changed but the same is not happening with an Activex Exe , the dll and the exe and the form are on the same machine. Is this proper or is something going wrong.



  2. #2
    Join Date
    May 1999
    Posts
    45

    Re: Activex

    My recommendation
    You might be able to do that if both client & server are VB apps. But you should never do that in either cases (DLL / Server).
    Package all required properties of the form and pass to the server. Server will return the changed properties. Then client (Owner of the form) takes care of updating the form properties. So server receives parameters of the standard data types. And everthing will be leagal and fine.

    Brief description of problem
    All GUI CLASSES are always Private in VB. And you cannot pass references of private object to the outside world. There are two reasons.
    1) If your class is private it's not part of the type library. So client is unaware of the methods. So client can't use it.
    2) If the server deletes the object, VB will not take care of checking if client is still using it or not. So client has invalid reference.

    In your case VBRuntime is one (inproc) server and your ActiveX exe is another (outproc). MSVBVM creates form object gives reference to standard exe. It is private inside standard exe. So it should not be passed outside.

    On the otherside if your ActiveX Exe is in C++ it is not really aware of the "Form" class exposed by MSVBVM. So can't use it.



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