|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can you use an ocx in a dll?
I have an OCX that I can use with a form to put an object and then access methods and properties of the object. Works fine in that type of environment.
However I need to make a web application where I am using some of the methods and I need the end product to be a dll. Is there a way to have a dll that has no form, able to use the OCX tool? Cul |
|
#2
|
|||
|
|||
|
If u will use this ocx file,U can create the object and call the function in the ocx..
|
|
#3
|
||||
|
||||
|
design your program on paper and decide which properties and methods you will need to access of your ocx. Then, declare a new variable of your ocx type and write properties in your dll to handle the properties and methods of the ocx you need to access. Just make sure that a copy of the ocx is included on the server.
A question though... Why do you need the end result to be a dll? |
|
#4
|
|||
|
|||
|
How do I create a variable to my OCX type? For something I have referenced I can just do a: Private myRef As thereference, but an OCX isnt in the reference list, even though I have added it as a component. Is there a way I can reference my OCX?
Sorry its been awhile since I have worked with VB, very rusty. As for why a dll, what are my other options? I plan to reference it via a com object with PHP. Thanks, Cul |
|
#5
|
||||
|
||||
|
One more question. What OCX are you using? I'm not sure about PHP...Some Ocx's are web ready in ASP.NET... sometimes you can find the classID in the registry and add a new object of that classid.
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
|
#6
|
|||
|
|||
|
Its an older proprietary thing, def. from before .Net becoming common.
Cul |
|
#7
|
|||
|
|||
|
Which the ocx file do u lost in the project??The vb will show the lost reference when compile the program!After Find it,u will add it to your reference list!!
|
|
#8
|
||||
|
||||
|
Ok.. I've included an .ocx directly into some HTML that I have built. This is a very, very simple example of how to get an ocx into a web page...
Code:
<HTML>
<HEAD><TITLE>Example of Class ID's in Objects</TITLE></HEAD>
<BODY>
<OBJECT HEIGHT = 85 width = 600 classid="clsid:{38911D92-E448-11D0-84A3-00DD01104159}" NAME=NewObject VIEWASTEXT></OBJECT>
</BODY>
</HTML>
This may or may not show up on your box, depending on whether you have the ocx installed or not. It's a control called "Coolbar" that I randomly selected from the registry. I typed in "regedit" from run on the start menu, and navigated to "HKEY_Classes_Root -> Com_Ctl.3 -> ClsID" to get the class ID for the object I wanted to insert. You might try doing it this way rather than trying to use a .dll wrapper. Otherwise, i would reccommend using VB.NET to write your dll as you can use an imports statement to get the classes into your project. |
|
#9
|
|||
|
|||
|
Isnt an OCX file just that, a file? How do you register an OCX so it will show up in the registery and have a classid? With a dll I use regsvr32, I didnt think you could use that with an OCX file?
Having a hard time following you cleverpig. geocode.ocx is the ocx control, I can load it as a control in VB and it lets me draw a control on a form. I can then access the properties of that control, however in the dll I am making I dont have a form, only a class module so I wasnt sure how to connect the two together. Cul |
|
#10
|
||||
|
||||
|
nope.. an OCX is essentially executable code, it is basically an activex dll with a visual control wrapped around it. You can register it through the same procedure as a regular dll, unless it has a programming error that will not allow Windows to find the entry point
|
|
#11
|
||||
|
||||
|
Just for clarification, I found this on This Site
Quote:
|
|
#12
|
|||
|
|||
|
Thanks Fisherman. One last question, how browser compatible is the classid property with <object>?
Thanks again, Cul |
|
#13
|
||||
|
||||
|
well, I'm not exactly sure what it is that you're asking. If you have the classid on a registered ocx, then you should be able to access it in the way that I posted before. If you're asking whether it is cross compatible with other browsers... then it should be - object is just an HTML spec keyword. A word of advice, to discover your class hierarchy (functions and properties inside your ocx), use the dependency walker to view interior methods.
|
|
#14
|
|||
|
|||
|
ok thanks!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Can you use an ocx in a dll? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|