Results 1 to 4 of 4

Thread: ActiveX EXE showing form

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    3

    ActiveX EXE showing form

    I'm using software Data Junction and they recommend creating COM's for showing any components. I tried creating ActEXE that show forms with Combo Box and few other features, but when I try calling the form, that doesn't work. I'm new in creating COM's, so I need a little help. I have a Method in that class for showing the form. Can I do that or I need something special?

    Thanks
    Ana

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Is your form and your class in the ActiveX exe? Just add a function in the Class to show the form. Although you wont be able to access the ActiveX Form's properties from the Project.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    3
    Form and the class are in ActiveX EXE, and I tried function for showing form, it didn't work. Any other suggestions?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    This code assumes the class is called cShowMe and the form is called frmShowMe in the ActiveX Exe
    VB Code:
    1. 'in the class
    2. Public Sub ShowForm()
    3.    frmShowMe.Show
    4. End Sub
    5.  
    6. 'in the project you are calling it from
    7. 'first make sure you referenced the activex component
    8. Private Obj as New cShowMe
    9.  
    10. Private Sub Form_Load()
    11.    Obj.ShowForm
    12.     Me.ZOrder 1
    13. End Sub
    14.  
    15. Private Sub Form_Unload(Cancel As Integer)
    16.    Set Obj=Nothing
    17. End Sub

    If you are running this in the IDE then make sure when you do to shrink the IDE window. Since the form is being called from the ActiveX Exe and not the application directly then it doesn't always move to the front of the ZOrder. I've found that it's best to use something like SetForeGroundWindow to make sure it comes to the front.

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