What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Memory Useage In VB

Memory Useage In VB
Author: Message:
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Memory Useage In VB
quote:
Originally posted by DJeX
Would that work?
I don't know. Maybe. Note that when you pass the pointer pTablePtr (just allocated by AllocateAndGetTcpExTableFromStack) to LocalFree, that API (LocalFree) has to know how much memory it has to free, and it will only be able to know that if the memory was allocated by another API "relative" to it. I mean, if AllocateAndGetTcpExTableFromStack calls internally some API that LocalFree knows, then yes, you'll be able to use it else you can't.


Anyway, I've searched a bit, and I've found this. Try it. It looks nice, so I think it'll work, but i don't know:

code:
Declare Function HeapFree Lib "kernel32" Alias "HeapFree" (ByVal hHeap As Long, ByVal dwFlags As Long, lpMem As Any) As Long
Declare Function GetProcessHeap Lib "kernel32" Alias "GetProcessHeap" () As Long

public sub freemem()
HeapFree GetProcessHeap(), 0&, ByVal pTablePtr
' if it doesn't work, try to remove the ByVal keyword
end sub

Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
08-30-2004 09:23 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Memory Useage In VB - by DJeX on 08-29-2004 at 07:17 AM
RE: Memory Useage In VB - by theRabbit83 on 08-29-2004 at 08:28 AM
RE: Memory Useage In VB - by DJeX on 08-29-2004 at 07:40 PM
RE: Memory Useage In VB - by Choli on 08-29-2004 at 08:58 PM
RE: Memory Useage In VB - by DJeX on 08-29-2004 at 09:04 PM
RE: Memory Useage In VB - by Choli on 08-29-2004 at 09:23 PM
RE: Memory Useage In VB - by DJeX on 08-29-2004 at 11:59 PM
RE: Memory Useage In VB - by Choli on 08-30-2004 at 09:23 PM
RE: Memory Useage In VB - by DJeX on 09-01-2004 at 05:17 AM
RE: Memory Useage In VB - by Choli on 09-01-2004 at 08:02 PM
RE: Memory Useage In VB - by DJeX on 09-02-2004 at 03:48 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On