Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

My own VB code updates

Posted on 1999-06-30
7
Medium Priority
?
167 Views
Last Modified: 2013-11-14
My question is this:  I developed some code which uses my own dll's written in visual basic.  These dll's contain functions that work fine.  What I want to be able to do is make a new dll to replace the existing dll, then simply delete the old dll and copy over the new one.
In short I could develop patches for my existing programs with out having to replace the entire program.
I have tried to write a replacement dll and copy it into an existing VB program (my own vb program).  The program crashes because it cant find the function from the original dll(even though it does exist in the new one.)
any ideas would be great.
0
Comment
Question by:jtjcomp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Expert Comment

by:mannen
ID: 1521143
Use a setup program, it automaticly replaces the DLL if it is a newer version.

As for the crashing, I think that Windows assigns a identifyer for each function, and calls it by this ID. I can't explain more than that.

If you want help about this question, you could visit the MSDN online site, which has millions of references and answers to just about anything (if you know how to find it).

Please tell me if you would you accept this as an answer.
Thanks

If you have any questions, post them here or drop me a mail.

- Vidar Braut Haarr
  AmigoSoft Productions
  folk@popmail.com
0
 
LVL 1

Author Comment

by:jtjcomp
ID: 1521144
yes i would
0
 
LVL 1

Author Comment

by:jtjcomp
ID: 1521145
And could you give a  little more detail on how you would make a setup program for a dll as opposed to the vbp.

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Expert Comment

by:wpd
ID: 1521146
Hmm... seems you have developed an ActiveX DLL with VB ? Which you'd like to replace "on the fly", i.e without exiting the .EXE ? It can't be done, unless the EXE "releases" the DLL (=> Set myDllObj = Nothing) when it does not need it. As for the program crashing, it depends whether you've included the DLL in the references for your EXE ("early binding") or you're instantiating the DLL with CreateObject() ("late binding"). The first case is more likely to produce crashes.

May be you should tell a bit more about what you want to do.
0
 
LVL 2

Accepted Solution

by:
mannen earned 400 total points
ID: 1521147
Thanks...

To the setup issue, use another setup maker than the one that comes with vb, like:

InstallShield
Wise
GKSetup (www.gksetup.com)

Or any other good setup program. Or you can just make your own self-extracting zip-file with WinZip SelfExtractor.
Second alternative is a web-based setup.

I agree with "wpd", if the user has the program open and running, you can't update the DLL file. So you have to tell him to close it before running the update.

OK?

If you need some more help, just post it, or mail me.

- Vidar Braut Haarr
  AmigoSoft Productions
  folk@popmail.com
0
 

Expert Comment

by:mirrorinternetzahavnet
ID: 1521148
Hey jtjcomp,
what about versions compatibility?
DO you take it in account when compiling new DLL?
0
 
LVL 1

Author Comment

by:jtjcomp
ID: 1521149
Thanks for all the great tips.  It is not that i want to
update the dll while the program is running. I just want to offer patches for my code.  I would like the user to be able to install these patches by running a batch or (the alternative setup program)

On the same topic would i use this same method (or is it even possible) to change a form that the program is using.
(ie.  frmMain which is developed on 6/20/1999 is replaced by frmmain which is developed on 7/2/1999)  The form would serve the same purpose as the old one but would have a easier to use interface.
 

Comments are great.. Thanks again..
jtjcomp
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question