Click to See Complete Forum and Search --> : Active X and IE
Bomber2006
Feb 11th, 2006, 06:55 AM
I have created an Active X object in VB6 but, when trying to run it, Internet Explorer (version 6) opens and prevents it from being run in VB. When I 'tell Internet Explorer to 'unblock' it, the object is displayed in the Browser and not in VB. I've tried deselecting the JIT option in IE security as recommended by Microsoft but it has had no effect.
Can anyone help please?
Thanks :wave:
Hack
Feb 13th, 2006, 06:26 AM
Welcome to the forums. :wave:
What does this OCX do (or supposed to do) and how does it do it (or how is it supposed to do it?)?
Bomber2006
Feb 13th, 2006, 06:34 AM
The OCX is an option box with amended properties for movement purposes. It's a fairly basic one from a beginners tutorial and the first one I've created.
But....it jumps straight to Internet Explorer.
Hack
Feb 13th, 2006, 07:28 AM
Does the ocx have code that opens IE?
iPrank
Feb 13th, 2006, 11:32 AM
Have you tried compiling it into a ocx and then adding it into a new VB project ?
Are you trying to run the activeX control project itself ?
Bomber2006
Feb 13th, 2006, 12:45 PM
There is no code that requests IE to open. Also, after creating the Active X object I run it just as any normal VB project is run. Is there another way to run it if using Active X objects...I don't know as its the first one I've created?
Thanks
iPrank
Feb 13th, 2006, 02:26 PM
OK. You are making an ActiveX Control. (In the File menu, the make menu now shows "Make Project1.ocx" and in the window that opens when you click Project>Project1 Properties menu, it shows "ActiveX Control" as 'Project Type'.
Deleloping and debugging ActiveX Controls / ActiveX Exe / ActiveX DLL, is slightly different than developing a Standard Exe.
The following tutorials will help you more understanding the topic.
ActiveX Control Tutorials By Karl Moore :
Part 1 - See page 5 - That's exactly what you are looking for (http://www.developer.com/net/vb/article.php/1539541)
Part 2 (http://www.developer.com/net/vb/article.php/1539571)
Part 3 (http://www.developer.com/net/vb/article.php/1539631)
Part 4 (http://www.developer.com/net/vb/article.php/1539651)
Part 5 (http://www.developer.com/net/vb/article.php/1539671)
Make Your First ActiveX Control (http://cuinl.tripod.com/tutorials/ocx-11.htm)
Bomber2006
Feb 19th, 2006, 10:11 AM
Thanks a lot. That seems to be fine.
Laser2200
Feb 19th, 2006, 08:04 PM
I was´nt able to find any answer to this problem on the Page 5 you mentioned.
Am I missing something?
Dave Sell
Feb 20th, 2006, 12:44 AM
What happens when you 2x-click a file ending in .OCX from Windows Explorer?
iPrank
Feb 20th, 2006, 04:17 AM
If the .ocx filetype is associated with some program in the registry (in HKEY_CLASS_ROOT), Windows opens it with that program. If it is not associated, Windows displays the 'Open With' window.
Right click any file in explorer. In the context menu, if there is a bold menu, that is the default action of that file. When you doubleclick the file, that action will happen.
To register/unregister an ActiveX dl/control/exe from context menu, see this tip: http://www.devx.com/vb2themax/Tip/18337
Laser2200
Feb 20th, 2006, 06:00 AM
Guys, let me give this example:
In VB6, I start a new Activex Control Project.
A designer named UserControl1 opens up.
I Put a Command Button or a Shape inside UserControl1.
After that, I add a Form to this project, which will be Form1.
Then I close UserControl1, and a new control icon appears
at the bottom of the Toolbox.
I create an instance of this control, which is exactly equal
to the control that I have created in UserControl1.
After this, I run the program by clicking on Start, hopping
to see a Form with my custom control, but instead, a new
instance of Internet Explorer opens up, showing my control.
I need to test my ActiveX controls, as I develop them, on a
form, not on a browser.
I have also tryed to use the OPEN WITH option in Windows
Explorer, to force Visual Basic to open this kind of files, but
the problem still remains.
iPrank
Feb 20th, 2006, 07:14 AM
There is a difference between (embedded) 'User Control' and 'ActiveX Control'.
When you select the "ActiveX Control Project" from 'New Project' menu, the project compiles into a ocx file.
You need to either reference the compiled ocx in a completely new 'Standard Exe' project, or you need to create a 'Project Group' in your existing ActiveX Control project to test it. Click on 'File> Add Project' menu to add a new standard exe project.
Adding just a form will not work.
'User Controls', on the other hand, doesn't compile into separete ocx. The embeds into the exe.
To add a new usercontol, open a new 'Standard Exe' project. Then, from 'Project' menu, select 'add User Control'. From the dialogbox, add a new user control.
See, VB has added a new usercontrol for us !
Just paste a button and in it's click event, write
MsgBox "Hello User Control"
Now, close the designer window of the user control. Open the form's designer window and look at the tool box. You'll see an icon for your usercontrol. Click it and paste in into the form. Run the project. :)
Dave Sell
Feb 20th, 2006, 07:30 AM
Guys, let me give this example:
In VB6, I start a new Activex Control Project.
A designer named UserControl1 opens up.
I Put a Command Button or a Shape inside UserControl1.
After that, I add a Form to this project, which will be Form1.
Then I close UserControl1, and a new control icon appears
at the bottom of the Toolbox.
I create an instance of this control, which is exactly equal
to the control that I have created in UserControl1.
After this, I run the program by clicking on Start, hopping
to see a Form with my custom control, but instead, a new
instance of Internet Explorer opens up, showing my control.
I need to test my ActiveX controls, as I develop them, on a
form, not on a browser.
I have also tryed to use the OPEN WITH option in Windows
Explorer, to force Visual Basic to open this kind of files, but
the problem still remains.
Got it. Again, what happens when you 2x-click a file ending in .OCX (or .DLL) from Windows Explorer?
iPrank
Feb 20th, 2006, 01:17 PM
Got it. Again, what happens when you 2x-click a file ending in .OCX (or .DLL) from Windows Explorer?
See post #11
Dave Sell
Feb 20th, 2006, 01:25 PM
See post #11
The question is directed toward the original poster for him to test and report what happens on his system presently.
iPrank
Feb 20th, 2006, 01:27 PM
Oh. Sorry. :o
I misunderstood the question.
iPrank
Feb 20th, 2006, 01:31 PM
I thought he has added a form in a ActiveX Control Project and is trying to run the same project by pressing F5. Isn't it ?
Dave Sell
Feb 20th, 2006, 01:35 PM
I think so.
iPrank
Feb 20th, 2006, 01:38 PM
Then why it has anything to do with Windows Explorer ? :confused:
Dave Sell
Feb 20th, 2006, 01:40 PM
There may be something associated with OCX or DLLs on his system. It is just a check for bomber to test.
iPrank
Feb 20th, 2006, 01:44 PM
No matter what program is associated with an ActiveX ocx/dll, if it is correctly registered, it will always work correctly if you referenced (or CreateObject) it in a VB project.
In my system, dll/ocx files are associated with a small (un)registration utility.
Dave Sell
Feb 20th, 2006, 01:45 PM
It is a test for bomber to perform.
iPrank
Feb 20th, 2006, 01:54 PM
LOL. I realized our misunderstanding. :)
This thread is started by Bomber2006. Looks like his problem is solved in post#8.
The current question is posted by Laser2200 in post#10 and post#12.
Dave Sell
Feb 20th, 2006, 02:18 PM
Oh, right. I think I completely missed bombers post#8. I think I withdraw my request LOL.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.