?
Solved

Free an OCX module from memory

Posted on 1997-03-25
3
Medium Priority
?
213 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
[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
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 600 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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

800 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