|
-
May 7th, 2005, 09:15 AM
#1
Thread Starter
New Member
puting an ocx in vb form
I am new to vb but have written a web server in other language. I used an web server ocx to get the request and send response to the browsers accessing the site. I have tried to put the ocx in a visual basic form but cannot. How do I use it in my VB code? OR an easier way to make my application know what is being requested by browsers and send reposnse? just need to get started. Thanks in advanve OAk
-
May 22nd, 2005, 07:54 PM
#2
Re: puting an ocx in vb form
Hi oakwv and welcome to VBForums!
In order to use ocx in VB - control must be properly installed on the developer's machine including lisense for developer (quite often we may have some ocx on the system but we cannot use it).
Assuming you have it installed then you may create a brand new instance of that control by adding it to controls collection at run time:
(on the form only)
Dim ctl As Control
Set ctl = Controls.Add("VB.Textbox", "txtNew")
where VB.Textbox is ocx's ProgID and txtNew is its name.
Also, since (in my sample) Textbox is an intrinsic control you don't have to add lisense to lisenses collection or it is mandatory otherwise.
Unlike web apps VB requires ALL runtime files to be installed (and for that purpose we build distribution packages) so your chances to distribute your app without any ocx utilized in the project and expect it (your app) to function are close to ZERO - error such "ActiveX component cannot create object ..." most likely to be raised ...
Last edited by RhinoBull; May 22nd, 2005 at 07:57 PM.
-
May 24th, 2005, 01:46 PM
#3
Re: puting an ocx in vb form
If you don't want to add it at runtime, you can add it to your components list, and add it at design time.
This, of course, is, as RhinoBull points out, contingent on the proper licensing being available.
-
Jun 8th, 2005, 02:03 AM
#4
New Member
Re: puting an ocx in vb form
hi,
first register that component by typing
regsvr32 "path"
e.g. regsvr32 "C:\Workspace\GridOCX\GridOCX.ocx"
at the command prompt where "path" represent the actual path for that .ocx file
then select it from project menu and add it to ur form
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|