Results 1 to 6 of 6

Thread: ActiveX EXE - how, why?

  1. #1

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    Fairly easy questions if you guys ever used an ActiveX EXE.

    I have a project that needs to call an external .exe (activex exe). My activeX exe is compiled, containing one class module and one form. From my main application, I want to show that form, or in other words, execute that activex exe. How can I do that? Is it a SHELL Command I must use or can't I just use MyForm.show (even tho it's in another project, in the same project group)

    My 2nd question: Can I (MUST I) build the ACTIVEX EXE in the vbproject from which the it's gonna be called? Personnally, I would appreciate if I could keep the activex exe in my main project, as I will want to swap between them in the same VB window (easier for debugging)

    Thanks for your help.

    Chris

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    1. Your AcitveX.exe does not need to be shelled. You can add a refernce to the AX exe in your test project. You can then declare a variable of this type, and then get a new instance of the AX exe. You can then use this AX exe like any other object.

    I am not really sure what you are talking about with the form. You will have to have a method in your AX exe, that loads it.

    Code:
    Dim myClassObject As New ClassName
    
    myClassObject.ShowForm
    2. Add a new project to your ActiveX exe project, or your existing test project. You now have a project group. Right click on this new project in the project explorer, and set it as the start up object. You can now debug away quite happily
    Iain, thats with an i by the way!

  3. #3
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    This is a huge subject, which would take too long to answer here.......

    If you have the samples frim VB installed, then look at the 'Coffee' folder and read the 'Aboutcof.txt' file. This should answer some of your question.

    Also look at the MSDN on building an ActiveX.EXE application.

    Good luck....
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  4. #4

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    I`m having an error while trying to make a reference to my .exe.

    In my main project, I'm trying to set a reference to my compiled activex exe (Update.exe) and it says:

    Project 'Update.vbp' can not be referenced because it's project type is EXE.

    Any idea?
    Chris

  5. #5
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Hmmm.

    I have just tried it, and it works fine for me.

    Compile your AX exe.
    In your main project goto Project :> References.
    Scroll through the list till you find the name of your AX exe.
    Check the box next to your projects name and click OK.
    Iain, thats with an i by the way!

  6. #6

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    Ok.. Quite a stupid error of mine. The refernece now seems to work but I find it sad that the ActiveX EXE project itself cannot be in the project group.

    Whenever I tried adding the project back to the project group, I get the "Project 'Update.vbp' can not be referenced because it's project type is EXE." error message, the project is added alright but the main project looses the reference.

    I am still hoping for a solution.


    Chris

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