[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

Executing ActiveX form

How can I execute one ActiveX form within the browser?
What I need to include in my HTML page to run this OCX?

Regards.
0
sergio_2001
Asked:
sergio_2001
  • 3
  • 2
1 Solution
 
bbangerterCommented:
The easiest way is to use Microsofts Design Time ActiveX Control Pad (available for download from Microsofts site - sorry I don't know the exact URL to get to the correct download page).

But you'll end with somethink like the following in your HTML page

<OBJECT ID="myControl" WIDTH=100 HEIGHT=51
 CLASSID="CLSID:F0A59CA5-B599-11D0-836B-0004ACFCB2B9">
    <PARAM NAME="myParam1" VALUE="myValue1">
    <PARAM NAME="myParam2" VALUE="myValue2">
</OBJECT>

The ClassID is the tricky part.

This is probably going to be information than you want or need, but here goes....

Using the ActiveX control pad is the easiest way to get the ClassID.

But if you have Visual Basic you can include the control in a VB form, then open the .frm file in a text editor and look for a line like
Object = "{F0A59CA5-B599-11D0-836B-0004ACFCB2B9}#2.0#0}"; "myControl.ocx"
The part between the {}'s is your ClassID.

You can also run RegEdit from 'Start... Run... RegEdit' and then do a search (ctrl-f) on the name of your control (e.g., myControl).  The very first entry in the registry should show the class ID in {}'s.

The hardest method is using VC++.
If you are using VC++ you can insert the control into a project, open the newly generate header file, and look for something like.
static CLSID const clsid
                  = { 0xf0a59ca5, 0xb599, 0x11d0, { 0x83, 0x6b, 0x0, 0x4, 0xac, 0xfc, 0xb2, 0xb9 } };
            return clsid;

You'll note that by stripping off all of 0x and inserting dashes in the correct character positions you end up with
F0A59CA5-B599-11D0-836B-0004ACFCB2B9
remembering that this last section is a 12 character code, and may need leading zeros.

Presumably other Microsoft products that are capable of working with ActiveX controls have similar methods of determining the Class ID.
0
 
sergio_2001Author Commented:
bbangerter,

Your comment is correct. That's what I want.
Please send-me the answer to grade you.

Note: I done um activeX form using delphi. Using your answer I got to introduce the activex form in the html page but the form don't show properly. What should be?!?!?!?

thanks
0
 
bbangerterCommented:
Answer to above for getting the ActiveX control to work.

As for the form not showing properly, could you clarify what it is doing?
0
 
sergio_2001Author Commented:
I can see the space used for the activeX within the browser but I just see that litlle default icon at upper left side.
I hope to be clear....
thanks...
0
 
bbangerterCommented:
Yes I do know what you mean, now if I can just remember how to fix it :).

What ActiveX control are you trying to use?  Is it a custom one or one built by say Microsoft or IBM or some other 3rd party developer?  Are there any properties within the control that determine whether or not to display the user-interface?  Any sizing properties to determine the size of the UI?

Also, just realized I'm getting charged 5 points to come in here and make comments (no big deal), but if we could move this to either a new question in experts-exchange or to private email (fanatic@aros.net) I'd appreciate it.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now