error in vb6 program!

  • Thread starter Christopher Schlüter
  • Start date
C

Christopher Schlüter

HI NG,


i have been working on a vb6 project for 5 years. Now, the program crashes,
but on other pcs and other Windows OS it works correctly.
I've learned that the problem is caused by a kernel32 API.

HeapFree GetProcessHeap(), 0, pASTAT

Public Declare Function GetProcessHeap Lib "kernel32" () As Long



Public Declare Function HeapAlloc Lib "kernel32" _
(ByVal hHeap As Long, ByVal dwFlags As Long, _
ByVal dwBytes As Long) As Long
Public Declare Function HeapFree Lib "kernel32" _
(ByVal hHeap As Long, _
ByVal dwFlags As Long, _
lpMem As Any) As Long

----------------------------------------------------------------------
is there a possibility to write this in another way? Why doesn't the
SourceCode work anymore. I've installed XPSP2RC2 and Windows Media Player10b
Can you help me?
The weired thing is, that the error only appears in the ready-compiled exe
file, but not in the vb6 env.

Mfg

CS
 
T

Tony Hoyle

Christopher Schlüter said:
HI NG,


i have been working on a vb6 project for 5 years. Now, the program crashes,
but on other pcs and other Windows OS it works correctly.
I've learned that the problem is caused by a kernel32 API.

HeapFree GetProcessHeap(), 0, pASTAT
Check that the pointer you are freeing was definately returned by a
corresponding HeapAlloc in your program.

SP2 is a lot stricter on this - your program was already buggy but
other windows OSs let you get away with it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top