Solved

Free an OCX module from memory

Posted on 1997-03-25
3
207 Views
Last Modified: 2012-08-13
When my VB program is not closed normally, there are some OCX module are still remaining in memory which are not free from memory. So there is any tools or method to free OCX module like using WPS to free VBX module on VB3.0 environment? (This OCX module can not be seen when my program is executed, that is the OCX module there is no user interface for user like Timer object).
0
Comment
Question by:Paco Hsiao
3 Comments
 
LVL 5

Expert Comment

by:volking
ID: 1424741
You should NOT be trying to do this.
OCXs often interrelate to other OCXs, DLLs, etc.
Forcing an OCX to terminate can cause severe problems including registry corruption, file system corruption, memory corruption, and lots of other bad things.

I'd STRONGLY urge you to pursue the question, "Why Didn't The OCX terminate Properly?"
Meaning. "Fix the problem! . . . Don't kludge a patch that has the potential to REALLY SCREW UP THINGS!"
0
 
LVL 1

Expert Comment

by:andyb013197
ID: 1424742
Concurs with volking. Your problem is not *how* to release ocx's but *why* they are still there after the app has terminated. I would suggest lots of setting forms to nothing and object variables to nothing as a solution. I cant see a situation where a vb app will always terminate normally except with calls to api functions which cant be trapped.
0
 
LVL 1

Accepted Solution

by:
ndb earned 200 total points
ID: 1424743
You can try the API Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileA" (ByVal lpFileName As String) As Long.
This removes a file from memory.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now