Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 28th, 2008, 09:57 AM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Moving OCX Files

I am new to using ocx's and dll's. The VB6 application that I just inherited uses more than 10 dll's and an ocx. They are all located in the same folder.

I wanted to see what happens if they are moved to a different folder and what it takes to point the exe to the new folder. I want to become familiar with the error messages that are produced and with fixing the problems.

The dll'd seem to be easy to work with. If I move a dll to a different folder, all I hve to do is to register the dll from the new folder. This seems to automatically unregister the dll from the previous folder and register it from the new folder.

The ocx is not so well behaved, i.e., I don't know how to get it to behave well. I am going to play around with it some more but would appreciate instructions on what it takes to move ocx from folder to folder.

I have had to delete the form containing the control provided by the ocx a lot. I want to do this only when absolutely essential.

Also, when I do a Project->References, I see several versions of the ocx, some in folders no longer present. As I was learning the application, I created several of these. How can I delete these? In general, I am looking for hints on working with ocx's. Thanks.

Reply With Quote
  #2 (permalink)  
Old April 29th, 2008, 01:23 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A question related to this topic:

The project I inherited has 18 dll's and an ocx. After each stage of development, the application is packaged using the Package and Deployment Wizard to create install files. In other words, even if only the VB part changes or only one dll changes, the entire package is recreated. Aren't some of the benefits of using dll's lost doing things this way? (No other application can benefit from these dll's -- these are all highly specific to the application.) Can't a dll be released by itself?



Reply With Quote
  #3 (permalink)  
Old April 29th, 2008, 01:37 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Something to try: Keep the .frm file, but delete the .frx file. When you re-open the app, the IDE will rebuild the .frx from the .frm.

I'm not sure there won't be some collateral damage—for instance, and image list might lose the images—but try it.
Reply With Quote
  #4 (permalink)  
Old April 29th, 2008, 01:38 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Well, no.. Dll can be use to separate each part of the system. And other app still can benefits for it, I don't see why not...

And a dll can be released by itself. But if nobody will use it, what's the point?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #5 (permalink)  
Old April 29th, 2008, 02:10 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

> I'm not sure there won't be some collateral damage—for instance, and image list might lose the images—but try it.

This scares me.

> Something to try: Keep the .frm file, but delete the .frx file. When you re-open the app, the IDE will rebuild the .frx from the .frm.

What would this potentially accomplish? Thanks.

Reply With Quote
  #6 (permalink)  
Old April 29th, 2008, 02:17 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

There is another way to do this. You can modify the frm files in any notepad. You are looking for the first line, the one that defines the version of ocx and dll. The easy way to do this. Close the project, (that also has some definition in the begining of the file, but edit it). Start a new app, add the references and controls you need, and then copy the lines that defines that dll and ocx to your old project, overwritting the one that are inside them.

did I explain it clearly?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #7 (permalink)  
Old April 29th, 2008, 02:56 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gonzalo,

You are giving some crucial hints. Let me try it out. Thanks.

Shaker

Reply With Quote
  #8 (permalink)  
Old April 30th, 2008, 10:29 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Quote:
quote:Originally posted by amd2003
 What would this potentially accomplish? Thanks.
Well, one crucial thing it would accomplish is keeping all the controls and their positions, sizes, etc., and the event code that has been written for them. That could be a big time saver, if you find that you are in the position where previously you had to delete the entire form.

Gonzalo,

If you edit the .frm, does the .frx reflect that change well enough for everything to function properly? I’m specifically wondering about controls that store their data in the .frx, like image lists.
Reply With Quote
  #9 (permalink)  
Old April 30th, 2008, 10:42 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Well, I have done it several times, and never had problems with the frx, since it's store only the binary data, and the controls are the same. The only potential problem I can think off is if you are using a third party control that changes a lot between versions, but it doesn't happens with ms controls.
I did it with forms that have imagelist and didn't have any problem, but you can always save a backup before doing it.

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
Reply With Quote
  #10 (permalink)  
Old April 30th, 2008, 11:16 AM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

So to paraphrase: You’re saying that the .frm will specify the packaged code that will use the .frx’s data, but the .frx only contains the data & will be happy to provide it to any reference in the .frm that properly asks for it?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving files to new drive HaileyJ Windows Server 2 August 5th, 2008 10:59 AM
Moving files based on an Excel file sachtaridis Excel VBA 1 November 26th, 2007 12:39 PM
Moving files from one folder to another sachtaridis C# 1 November 23rd, 2007 04:33 AM
Use Ocx saulodet ADO.NET 0 January 5th, 2004 01:32 PM
MSFLXGRD.OCX and MSDATGRD.OCX Clive Astley Access 1 July 25th, 2003 08:47 AM



All times are GMT -4. The time now is 05:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.