error in vb6 program!

Posted: 07-24-2004, 03:31 PM
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


Reply With Quote

Responses to "error in vb6 program!"

Tony Hoyle
Guest
Posts: n/a
 
Re: error in vb6 program!
Posted: 07-25-2004, 02:14 PM
"Christopher Schlüter" <DataLtCommander@web.de> wrote in message news:<ehZJprYcEHA.2324@TK2MSFTNGP10.phx.gbl>...
> 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.
Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Program that won't go away iambennu Windows Vista Performance & Maintenance 7 07-03-2006 08:51 AM
cannot run program josh Windows XP Beta 0 01-16-2004 03:59 PM
Running DOS program under XP Stephen D. Windows XP 2 07-11-2003 12:12 PM
Error 1606 When Installing a Program salty mcp Windows XP 0 07-10-2003 01:16 AM
Is there actually any program... vonbayern Windows XP Work Remotely 1 07-08-2003 02:29 AM