Home > Software engineering >  Vb to write a superior pilot run time error
Vb to write a superior pilot run time error

Time:10-11

Written in vb PC, each time you run a day or so, the following error, I don't know what reason?

CodePudding user response:

One way to check whether resource leaks:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

CodePudding user response:

What circumstance can cause resource leaks?

CodePudding user response:

A possible direct cause of this error is to call API parameters data type is not correct, check carefully,

Another possibility is that memory,

The first kind of circumstance is the problem on the design, such as the Timer handling matters in the required time is greater than the Timer interval, etc.,

The second is code bugs, such as repeated instantiate a certain object, but did not release,

The third is implicit memory leaks, some related to the specific API, this to the Internet, you can find it on the average common, look at what you use, targeted,

CodePudding user response:

Call the parameters of the API will be a problem;
How to check out of memory?
Timer time in handling matters will not greater than the time needed for the timer intervals,
Instantiate objects repeatedly in order to be released? Can, for example?

CodePudding user response:

Nine times out of ten is caused by wrong data type of memory, suggest that you focus on this aspect

CodePudding user response:

Used the wrong data type? For example? Is similar like should be single or double but with byte this kind of mistake

CodePudding user response:

Recommend a more easier way:
On the upper machine installation VB6 development environment
Will you have a problem of VB6 copy the source code in the past,
Remove or comment out temporarily VB6 similar On the Error in the source code you Resume Next Error handling statement
Run your application in VB6 IDE

In error when the pop-up dialog prompt, click the corresponding button to enter debug
The cursor is positioned in your error on the line
At this time and in the immediate window by "? A variable name (enter) "command to view the current values of variables that you care about,

CodePudding user response:

The specific code to specific analysis,
  • Related