Results 1 to 4 of 4

Thread: load a form in OCX

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    2

    load a form in OCX

    I am a novice in VB. I have written an ActiveX control in VB6.0 which loads a form ( or atleast that was my intention). Here is the function in the ocx.

    Public Function ocxMain1()
    MsgBox "In VB OCX before calling form load"
    MyForm.Show
    End Function

    MyForm is a form in the ocx. The form has 3 to 4 buttons which perform some screen capturing functions. I have written a VC++ client that calls the ocx function. It correctly displays the message box but gives a 'Runtime Error' in the MyForm.show line.

    Can anyone enlighten me why this error is generated. My understanding is that forms can be loaded in an OCX. is this correct? If so, what is the right way to load a form? I appreciate the help.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    What is the actual error? (Number/Description)
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    2
    There isn't a specific Error number shown. A message box appears with the following information.


    "Runtime Error!

    The application has requested the Runtime to terminate it in an unusual way. Please contatct the application's support team for more information."

    Thats all it says. So I was wondering whether the problem arises because we are trying to open a form in an OCX from a different application(here it is a VC++ client ).

    Hope this helps!

    thanks

  4. #4
    Hyperactive Member hassa046's Avatar
    Join Date
    May 2001
    Location
    Venlo, The Netherlands
    Posts
    336
    Originally posted by trc_007
    There isn't a specific Error number shown. A message box appears with the following information.


    "Runtime Error!

    The application has requested the Runtime to terminate it in an unusual way. Please contatct the application's support team for more information."

    Thats all it says. So I was wondering whether the problem arises because we are trying to open a form in an OCX from a different application(here it is a VC++ client ).

    Hope this helps!

    thanks
    I guess you have to use MyForm.Show vbModal

    ;-)
    Better to regret things you did, than those you didn't
    International Intelligence

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