Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Error In Program Keeps Restarting Do I Delete This From Memory.2stoperror

my computer keeps restarting everytime i quit my program. Ive got a feeling it is because im not removing this thing from memory after ive used it. But I dont know how to remove it from memory.

heres the code im using


BlendOp As Byte
BlendFlags As Byte
SourceConstantAlpha As Byte
AlphaFormat As Byte
End Type
Public lBF As Long
Public Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As Long
Public Declare Sub RtlMoveMemory Lib "kernel32.dll" (Destination As Any, Source As Any, ByVal Length As Long)

BF.BlendOp = &H0
BF.BlendFlags = 0
BF.SourceConstantAlpha = 128
BF.AlphaFormat = 0

'this needs to be deleted from memory after its
'been used, how do i do this?
RtlMoveMemory lBF, BF, 4

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Restarting Program
Is there a keyword that tells the program to restart, kind of like the END tells the program to shut down?

Restarting A Program
I am in the midst of making very basic game of 21 on visual basic. I am having some problems. One of my buttons says "start over" but I am unsure how to use that function. I need basically restart the program (IE: Redeal everything, so basically, start everything again).

Any ideas? Thanks.

Restarting A Program
Is there a command to restart a running application? My database does not seem to be updating until I close the program and restart it.


Restarting The Program
Hey everyone! I am trying to get my program to restart when something happens. I searched thorugh the site, but most of the suggestions where to reset the varibales...but my program reads a file, and if i just reset the varibales, the program will still continue to read from the file, which would throw everything off.

P.S. Almost forgot to ask if there is a way to have a listbox detect if a file is in a certain directory, and if it is there, change a varibale in the program.

Restarting Program
I would like to issue a command from within a VB6 program by which I can restart the program, and thereby have all of my variables reinitialized, and the original program ended.

There was a command in Quickbasic that permitted this.  I think it was the shell command.

Any ideas?


Cobol Comp && Comp-3 Field Convert
I'm trying to read an ascii file that has comp and comp-3 fields thoughout each record. I'm able to get all the string and normal numeric fields without any problem, but when it comes to converting the comp and comp-3 fields into a VB variable type, I'm lost. The cobol record layout that creates the file looks like this:

10 Land-Value-C Pic x(5).
10 Land-Value redefines Land-Value-C Pic s9(09) comp-3.

In my VB6 code I've got the following:
dim LandValueC as string * 5
dim LandValue as double
LandValueC = Input(5, #1)
LandValue = TranslatePackedDecimal (LandValueC, 0)
Private Function TranslatePackedDecimal(pd As String, pScale As Integer) As Double
Dim i As Integer
Dim Work As String
Dim b As Byte
Dim v As Variant

For i = 1 To Len(pd)
b = Asc(Mid$(pd, i, 1))
v = Mid$(pd, i, 1)
If i = Len(pd) Then
If ((b And 240) / 16) = 13 Then ' Negative Sign nibble
Work = "-" & Work
End If
Work = Work & CInt((b And 240) / 16)
End If
Work = Work & (b And 15)
Next i

TranslatePackedDecimal = CDbl(Work)
If pScale <> 0 Then
TranslatePackedDecimal = TranslatePackedDecimal / (10 ^ pScale)
End If

End Function

When I do a display of b as I am trying to translate the data, I get the following (the Asc value for each of the 5 characters in the pd string):

0 26 30 2 42

The value that is returned from the TranslatePackedDecimal function is:


The result I'm looking for is:


Restarting Program With Unload?
I have written a program which I want to be able to restart when the user clicks a button. The values of the variables (including arrays) should all be erased and the form should be returned to its original state. Will the following do the trick?

Unload Me
Load Me

I tried this, but it seems some variables don't get their values erased. What actually gets reset with Unload?

Reset Random With Out Restarting Program

I am working on a encryption program. I only making it for my own research.

I am using a seed to generate random numbers, which helps encrypt my data.

However, i am relying that i can generate the same set of numbers.

firstly, as I use Randomize to set a seed so I always get the same result when i start the program.

But I want to be able to get the same numbers from that seed when i generate the numbers again.

Well, it works by restarting the program, but i want to be able to reset rnd back to its first number.

Does anyone know how to do this?

Thanks in advance


ERROR Out Memory : Run Program Using Manifest
Hello all,

i finished create the application with vb 6.
for my application i use manifest file to create xp skin on my application.
whan i run my program on source (not on application) i'm not found the error.
But when i run my application (applicaton.exe) my program error :
Error description : Out Memory
Error Number : 7

and if my manifest not on my application it can run well.

what is wrong with my application ?


HELP Please: Restarting Program After Finishes Its Task? &lt; Resolved &gt;

    I have a program that takes in system ids and determines whether or not they are valid. However, after I process the first system, I'm having problems restarting my application from the beginning so that it will clear all of the text boxes, and be able to take in and process the second ID that the User inputs the same way that the first one was done. I want my program to continually refresh itself after it completes its task. I know that this is probably something really simple. But I'm pretty new. So I'd appreciate all of the advice that you can give me. Thanks.

- Raux

Edited by - tom77757 on 6/5/2004 8:02:17 PM

Error Message Using Progr On Other Comp.
I sent a friend a program I was using and it said Richedit.ocx not registered. Can I solve this by using the PDW?

Restarting An Application Upon Error
I have written a program in VB6. It works fine for a few hours, but then it receives an error saying "Invalid procedure 67", "Too many files". I have tried many ways to fix this but they have not had any effects.
I would be happy if it just autorestarted when it gets an error. I was wondering if that is possible

Loss Of Data Using VB6 With Access 97 After Closing Program Or Shut Down And Restarting Machine
Could you please help me to get out of my problem?

I have a program using vb6 with MS Access 97.
The problem is when records are entered users can display and even print reports but when the machine is shut down and restarted all the data will be lost. Both multi and single users experience the same problem. I use Begitrans and Committrans within the saving procedure. what might be wrong?

Comp To Comp Connections
Here's the deal ... I'm attempting to create a Card Game program over the internet using Visual Basic 6. I took a year-long collage course on the subject but the teacher knew absolutely nothing about the internet, so he convienently left that part out.

How would one go about connecting a version of a program to itself via IP adress?

"Runtime Error-429 ActiveX Component Can't Create Object". For COM+ Comp. On Win2003
Hi There!

Could anybody please help regarding the below issue.

We had a COM+ component deployed on Windows 2000/NT machine it was working fine, I mean when it was being invoked from other machines it was creating object and was serving the purpose.

Recently as an upgrade we moved all the COM+ component from Windows 2000/NT to WINDOWS 2003 and now when we are trying to invoke that component its throwing "Runtime Error-429 ActiveX Component can't create Object".

Client side machines are running Windows XP with SP2, COM+ component was created as a server application. I doubt that it may be because of Windows 2003 security issue but not sure or am I missing something while building that component.

Please help or provide your suggestions.

Thanks in advance.

Delete Entire Array (Empty Memory)
Do you know how to delete an entire array and free the memory
that it occupies ?

something like this

dim myarray(100) as long

private sub delete_array


end sub

the problem is that i get an error. is there a way to do this
with setting it to nothing ? or do i have to make redim myarray(0)
or something ?

by the way , i have already the array sized so i cannot do simple

thanks !

Program Error ( *.exe Has Generated Errors...restart Program.... Error Log Created...
I have a VB Application in Production for last 4 yrs and in last 2 weeks the users were getting this error.

Error Message Window Header: Program Error

Actual Error Msg: [My program name].exe has generated errors and will be closed by windows. You will need to restart the program. An error log is being created.

Buttons: Cancel

This error is happening randomly on different machine(all machines have same image) on random Screens.

I have not seen this error yet on my development workstation.

Any help will to fix this will be greatly appreciated.


How Can I Delete My Program While It Is Running Without Using Another Program
It doesn't really matter if it makes an error message, but how can I make my program self-delete itself, either RIGHT AWAY, or at next RESTART, without using another program to do it. Thanks.

How Much Memory Does My Program Use?
Forgive me if this was posted in the wrong thread...

I was wondering if there is any way I could find out how much memory my game uses. Specifically, I am using a set of variables to determine the maximum amount of objects that the game generates during run-time; If I set it to 1000, then 1000 'Actor' classes are possible, which means there would also be 1000 inventories, each capable of holding 100 objects... also, each enemy can have up to 10 bullets, so there's a further 10 x 1000 bullets to consider... Each of these things are created by using a UDT with thier own set of variables, so the variable space required must be quite phenomenal... and I would really like to find a way of knowing exactly how much variable space is required for the game each time it is run... so that I can change the limits to these objects and easily know where to draw the line. Does anyone have an easy way of doing this??

Memory In Use By A Program?
Hi, is there a way to find out how much memory a program is using? Thanks

Memory Taken By Program
I never looked at the memory taken by an application but now it is an issue for an application.
The application is taking 8 megs of memory when it starts up. I took this information from the task manager in Windows 2000.
What changes can I make to reduce the memory taken by the application ??

Program Too Big To Fit In Memory
Once upon a time, I wrote an application that reads HTML files, looks for information, and writes it to an output TEXT file. It works just fine.

Yesterday, I made a copy of that application, changed it to read Excel files instead. It looks for a whole lot more information and does validation, etc, but the main concept behind the code is essentially the same.


Today I went to compile this new EXE for the first time (VB6, Windows XP) and when I tried to run the EXE from my "dev machine" (it's a microsoft virtual machine), I got the quick command-window flash that turned out to say "Program too big to fit in memory". The icon isn't right for the EXE -- it should be the "eyeball" standard VB icon, but I'm getting the generic "this is an application" square icon.

The EXE itself came out to 88 KB. Task manager shows that I have 261,616 K of physical memory.
- After rebooting, memory available = 42,700
- When running VB alone, memory available = 30,800
- When running VB with the source code open, memory available = 28,500
- After launching the app through VB (but not doing anything with it), memory available = 28,400

I tried recompiling, I tried using the VB6 tool to create a setup for it and running that on my "real" machine (the host of the VM), but no go.

The project type is a Standard EXE, compiling to Native Code (optimize for fast code), and it only has one form with drive and directory controls on it.

References: VBA, VB runtime, VB objects, OLE automation (all of these are default); MS Excel 11.0 Object Library.

Components: MS Windows Common Controls 6.0 (SP6) (by default)

UPDATE! I created a new project, added my form and the Excel reference, compiled it, and it worked. So it seems my VBP file was corrupt somehow. WHEW!

Program Too Big To Fit Memory!!
firstly, i apology for this post, because i dont know whether i should post this thread.......

i'm writing a program using foxpro 2.6 and i'm facing one the program i call a batch job to execute...


when the flow reach the third line, it will display one error said that "program too big to fit memory"...................what is the problem of this? I alr check all the thing, the batch job command is correct, code no problem.......anyone can tell me why?

Run Program In Memory?
Not to long ago the Code Red worm was running rampid. I noticed that one of its key qualities is it's ability to run in memory. Is it possible to create something of this nature in VB. Maybe a program that spawns another program but does not place it on the hard drive; it runs in memory and when it is done there is no trace of it on the system? Also, Code Red had the ability to alter its self from time to time. How can a program "recompile" its self like this? Can this be done in VB?


PS: No, I don't want to be a virus writter. I just think the abilities of Code Red were cool and would like to understand how it works.

How Much Memory Does A Program Take
Is there a relatively easy way of seeing how much memory a program is allocating to itself when it starts up, or does anyone know of a 3rd party product to demonstrate this ?


Memory Used By Any Program.

Is any way to determine the size of memory used by specified program?

John, 14 years old

The Program Keeps On Memory
Hi people!!

i`ve been developing a vb database program. when its was small, the program unload good, it didn't keep on memory, but now, when the program grow a lot, when the program exit, it keeps on memory, I want to know if the are a way to get where the program is not unload.


Recordset.delete Error( Multiple-Step....error... )
Does any1 know here why i get this error saying "Multiple-step operation generated errors. Check each status value."

I get this whenever i cal adodc.recordset.delete

I couldnt delete the current record. But when the record is only one i could delete it. After doing the delete i also get an error whenever i try to update a record.


With Adodc2.Recordset
End With

Error When Delete Records? Error Number:-2147217842
When i delete a record, it permit me to delete this record, but it doesn't permit me to do any actions such as: move, addnew,... and tell me this error description: Multi step OLEDB operation generated errors. Check each OLEDB statue value, if avaiavle. No work was done. The error number is: -2147217842.

When i close the form, then reload the form, the record that i deleted disappear --> it permits me to delete the record, but why i can't do any actions.

Can anyone help me to handle this problem? If need more details pls ask me! I really need help.

Vb Program Hanging In Memory
I have just created a vb program which contains 3 forms - 1 main form and 2 child forms. The main form has 2 buttons which launch the child forms using the frmMain.hide and
Everything seems to be working fine - the problem arises when I go to a child form. If I close the exe by using the x (in the upper right corner), the program stays in memory.

Is it possible to actually "close" the project out completely so that nothing is left in memory?

Thanks for any thoughts

Program Taking Too Much Of Memory !!!
Can neone tell me when does "out of memory " and the windows virtual memory low error arises .
Can it be due to the number and type of variable one uses in the program ??

Reading Another Program's Memory
Ok here's the deal. I work for a company where we need to gather information from one program and bring it into our own program. The programs that I am trying to capture data from are terminal emulations (reflections, rumba...) Currently we are trying to do this with the clipboard but it is very slow and cumbersom. The other issue is that not all emulators allow access to the clipboard.
What I would like to be able to do is to read the emulation screen directly from memory. I know that the emulation programs store the screen at the same offset from the begining of the program. What I need is to be able to find the begining of a another program in memory and then read memory locations from that offset. I would like to be able to do this in VB6 if possible.

As I see it i have 3 options:

1) find the program and read the memory
2) load the program within my programs memory and read the memory
3) Write a C based DLL to do the memory reads and use the data in VB

My problem is i really don't know how to do any of these. So if anyone has any suggestions that would be great.

My Program Takes Up A Lot Of Memory :(
My program in its "Idle" so to speak form is taking up tons of memory after a while...I left it on since last night and when i got home at like 3:30 it said virtual memory was low (the computer said that) and the task manager showed my program had like 224k usage. I was wandering how you keep that at a bare minimum...Cuz when i open it only for a little bit its like 20k usage or less. It only goes high when i leave it on...

is there a way i can fix this?

Program Remains In Memory?
Could anyone give me some pointers please.

I've got a routine that has an exit button. In the code I have this

Timer1.enabled = false
unloade me

The trouble is, when the person clicks this button, on occasions the program remains in memory as process.

What else am I supposed to be shutting down to make sure everything ends cleanly. The program uses multiple forms etc.



Making Program Use Less Memory?
Does anyone have any tips/coding that would make a program more memory efficient. Maybe something that will dump memory/release resources when a process is complete. Pretty much making sure the program cleans up after each process. I noticed on some of my apps if they run for a long period of time say 2-3days the Memory usage that taskmanger shows for that app will start to increase more than usual.

Program Stays In Memory
Could someone be so helpfull as to look at my small program and see if they can figure out why Excel, and the program itself, resides in the task manager after everything is closed? I'm setting all the objects to nothing (I think) but it still doesn't work. Thank you in advance!

Removing Program From Memory
i am accesing msaccess forms using vb code.....once i run my application a copy of msaccess stays in memory.......when i run the program next time it doesnt work properly......but once i remove the copy of msaccess from memory it works can i remove the msaccess program from memory?

thanks a lot


Load Program Through Memory?
I found some source for a project. You can store files in a file. I have an exe stored and I need some way to load it through memory. (for protection) I have saved the bytes to a file, but then someone might be able to just grab the bytes and uncompile or whatever they do. I was thinking load it in memory or something...

please help,

Program-already-in-memory Check

Hmmm... I wanted to ask, does somebody know a way to check in VB whether the running program is already running?


Free Up Your Program's Memory
Lemme explain what I mean. I have a simple PRELOADER program that sits in my systray. This PRELOADER only sits there to monitor hotkeys and launch an external application. Problem is, it uses about 4 mb of memory. It uses about 2mb to start out, and then after an application has been launched and it's menu and msgbox items have been invoked, it goes up to about 4 to 4.5 mb. The only and only form is hidden from view and it does not contain a border style and does not show itself ever. I noticed that if i have a regular form and I minimize it, the memory is freed and usage goes down to about 462kb and then once I used the program again it'll go back up to about 2.5-3mb usage and if i minimize again, it'll go back to about 462kb of memory usage.

My question to you all, is there a call to the API that windows uses to free up memory when you minimize. Can I replicate this call ? If so how ? I can't simply have the form go from normal state to minimize because the form is hidden and u can't perform these operations on a hidden form.


Free All Memory From Program?
I am working on a program that is memory-intensive, and although I will be going through trying to make it as effecient as possible, I believe it will still use a lot. It will need the ability to restart, and therefore *basically* perform the same thing with different data again.

Is there anyway I can "clear" all data from the memory currently associated with the program, or ANYTHING that would help me out... thanks!

Vb Program Does Not Free Up Memory
Hi All

My application loads controls (command buttons) at runtime, with the top, left, caption, etc. properties. I do this with for/next statements, which I close afterwards.

After I have run the program a few times, my pc becomes very sluggish, and vb has alreay reported that it is out of memory.

How can I get my app to free all 'memory it is using after it has

Any help would be great.


Program Memory Requirements
As a matter of interest:

How would I be able to determine the minimum memory and clock speed requirements of a program I have written in VB.

e.g. 16Mb RAM, 450MHz

It's to put on the side of the packaging I'm designing for my latest work of genius

How Do I Allocate Memory For My Program
I have a bit of a problem. I have written an app. for our office and it works fine. My problem however, is with a piece of old 16 bit software that everyone in the office also runs. The stupid thing seems to lock all of a computers memory. For example, I run a PIII 700 with 256 MB of RAM and a 25 GB harddrive, and the rogue app pushes my system resources down to 20%. Now the app. that I wrote is really light and uses one .dll that I wrote for it but when this 16 bit program is running, it just won't work right. I am wondering if there is a way that I can allocate my own amount of virtual memory so that it will run, even if this other program is running. It must be able to be done, because MS's software runs (though a bit slower), and generally can even free up some of those capture resources. Any suggestions??

VB DLL Memory Management When Used In A C++ Program

We have a C++ application that uses an OCX component written in VB. We watch our memory usage in performance monitor. We can see that when we use the OCX, memory increases then periodically returns back to a minimum level. This cycle continues indefinitely. It looks like to us that the VB OCX is using internal garbage collection to manage memory in the OCX. Can anyone confirm (or refute) that this is actually the case, in other words if we load an OCX, COM, or regular VB DLL in a C++ program, the VB memory management is used for that DLL?


Program Memory Usage
Hey guys. I want to get your thoughts/opinions/tricks/tweaks on this issue I have with a VB program I just compiled. It's a patient scheduling program for the hospital where I work and it accesses an Oracle database. When I ran the program and checked the task manager to see how much memory it was using, I was shocked. This program uses almost 14MB of memory!

Now, this isn't an issue for my development machine, since it's pretty beefy. But the clerks in the hospital who actually use the program don't have very good machines. In fact, they pretty much suck.

So, how can I get that memory useage down? Users are complaining about the performance... The program code itself is rather large - 44 Forms, 2 Basic Modules, 23848 lines of code. It reads in an array of 4600 doctors from the database. Any ideas?

Thanks in advance!

Need to set up a website?
For really great, inexpensive
webhosting, visit

Memory Resident Program
How to make a VB application Memory Resident?

I know how to put it in system tray and in start programs. But, I want it to make the real memory resident program so that the user will not be able to remove from the Startup programs. Also, how to make it invisible when a user press 'ctrl+Alt+Del'. Please reply ASAP.


Control Other Program Memory

I am new to here.
How to read and write other program's memory in main memory? which tools I should use?

Thx. in advance.

How Do You Delete A Vba Program?
wrote my first VB program in Excel and want to delete it and start fresh because the first one has too many errors.

I deleted all the code and closed the sheet, but everytime of re-open Excel it goes right into de-bugging mode into the program that I thought I got rid of.

how do I delete the VB program for good?

Copyright 2005-08, All rights reserved