|
-
October 17th, 2001, 05:01 AM
#1
reserving memory question
Hi, if I define a structure in VB, what is the most common way to reserve memory for it. Thank you
-
October 17th, 2001, 05:15 AM
#2
Re: reserving memory question
Dim variablename as structuretype
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
October 17th, 2001, 10:13 PM
#3
Re: reserving memory question
when do you use api call like globalalloc then? Thanks!
-
October 18th, 2001, 06:10 AM
#4
Re: reserving memory question
You would only need to use GlobalAlloc if you want your data structure to be available to another application than the one it is declared in...and it is a pain to use from VB!
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
October 18th, 2001, 08:33 AM
#5
Re: reserving memory question
Just declare it. There's a garbage collector in VB and you should be ok. Most VB arrays can be dynamically expanded and reduced and the same is true for strings. The good thing is that it is transparent and you don't need to do the mechanics to allocate new memory just like C++ or other language. Arrays are treated a bit differently and at least you get a fault if you try to access out of the range of it.
Nicolas Bohemier
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|