Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 1st, 2004, 06:56 PM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old January 1st, 2004, 09:02 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
If u will use this ocx file,U can create the object and call the function in the ocx..

Reply With Quote
  #3  
Old January 1st, 2004, 09:21 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
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?

Reply With Quote
  #4  
Old January 1st, 2004, 11:57 PM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 5
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

Reply With Quote
  #5  
Old January 2nd, 2004, 08:27 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
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

Reply With Quote
  #6  
Old January 2nd, 2004, 09:51 AM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 5
Its an older proprietary thing, def. from before .Net becoming common.

Cul

Reply With Quote
  #7  
Old January 2nd, 2004, 09:59 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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!!

Reply With Quote
  #8  
Old January 2nd, 2004, 10:38 AM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
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.

Reply With Quote
  #9  
Old January 2nd, 2004, 11:50 AM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 5
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

Reply With Quote
  #10  
Old January 2nd, 2004, 12:36 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
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

Reply With Quote
  #11  
Old January 2nd, 2004, 12:41 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
Just for clarification, I found this on This Site

Quote:
Microsoft now calls an OCX an ActiveX control, the component object under Microsoft's set of ActiveX technologies, of which the fundamental concept is the Component Object Model (COM) and, in a network, the Distributed Component Object Model (DCOM).

An OCX or ActiveX control is actually implemented as a dynamic link library DLL module. (You can think of a DLL program as a "subprogram" that can be used by any number of application programs, each of which is a "container" for the DLL or OCX/ActiveX control "object.") Visual Basic and C++ are commonly used to write OCX or ActiveX controls.

Reply With Quote
  #12  
Old January 2nd, 2004, 02:01 PM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 5
Thanks Fisherman. One last question, how browser compatible is the classid property with <object>?

Thanks again,

Cul

Reply With Quote
  #13  
Old January 2nd, 2004, 02:05 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,176 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 42 m 4 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
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.

Reply With Quote
  #14  
Old January 2nd, 2004, 02:24 PM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 5
ok thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Can you use an ocx in a dll?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off