Search found 52 matches

by 4RESTER
Tue Jan 01, 2013 7:10 pm
Forum: Coding Questions
Topic: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?
Replies: 5
Views: 1121

Re: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?

Look in the commented asm, you need to import them before using (just reference HeapCreate_() somewhere in your PB code and it will be the same).

You are right, this working as in pure FASM:

!if ~ defined _HeapAlloc@12
!extrn _HeapAlloc@12
!end if

!if ~ defined _HeapReAlloc@14
!extrn ...
by 4RESTER
Tue Jan 01, 2013 5:40 pm
Forum: Coding Questions
Topic: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?
Replies: 5
Views: 1121

Re: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?

Why is it useful to allocate a 0 bytes memory area ?

Functions the AllocateMemory and ReAllocateMemory in windose PureBasic versions should not be a procedure, it must be a macro to create the calls to HeapAlloc and HeapReAlloc.

Compiled application should not be used initially artificially ...
by 4RESTER
Tue Jan 01, 2013 11:31 am
Forum: Coding Questions
Topic: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?
Replies: 5
Views: 1121

Re: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?

Look in the commented asm, you need to import them before using (just reference HeapCreate_() somewhere in your PB code and it will be the same).

I have a few questions.

1. For what in the PureBasic is specially refused the HeapAlloc and HeapReAlloc with zero size?
Possibility to create zero ...
by 4RESTER
Mon Dec 31, 2012 1:08 pm
Forum: Coding Questions
Topic: How to call _HeapAlloc@12 & _HeapReAlloc@16 ?
Replies: 5
Views: 1121

How to call _HeapAlloc@12 & _HeapReAlloc@16 ?

I can use calling:
!PUSH dword [_PB_MemoryBase]
!CALL _HeapDestroy@4

I can use calling:
!PUSH dword 0
!PUSH dword 4096
!PUSH dword 8
!CALL _HeapCreate@12
!MOV [PB_MemoryBase], EAX

But can't calling:
!CALL _HeapAlloc@12
&
!CALL _HeapReAlloc@16

Error: undefined symbol

How to call ...
by 4RESTER
Sun Oct 07, 2012 3:52 pm
Forum: Feature Requests and Wishlists
Topic: Extend a operators FindString and CountString
Replies: 1
Views: 925

Extend a operators FindString and CountString

I propose to extend the operators by optional parameter Mode :

Position = FindString(String$, StringToFind$, StartPosition)
up to
Position = FindString(String$, StringToFind$, StartPosition [,Mode])

and

Result = CountString(String$, StringToCount$)
up to
Result = CountString(String ...
by 4RESTER
Mon Jan 30, 2012 7:15 pm
Forum: Coding Questions
Topic: Heap
Replies: 8
Views: 1438

Re: Heap

ts-soft wrote:doesn't work on my pc, but this works:

Code: Select all

*mem = AllocateMemory(100)
PokeL(*mem + $0000, $12345678)

*mem = ReAllocateMemory(*mem, 200)
Debug StrU(MemorySize(*mem))
Debug PeekL(*mem + $0000) 

May be into the PureBasic exist constant the Heap ID of task, like #PB_HEAP ?
by 4RESTER
Fri Dec 30, 2011 10:42 pm
Forum: Feature Requests and Wishlists
Topic: [Implemented] Update the version of the zlib.lib
Replies: 1
Views: 1663

[Implemented] Update the version of the zlib.lib

Are you planning to do change static lib ..\PureBasic\PureLibraries\Windows\Libraries\zlib.lib
from version 1.2.3 to the newest version 1.2.5 ?

Suggest to description into the http://www.zlib.net/ , the version 1.2.3 is have a lot big bugs:

Version 1.2.4 has many changes over 1.2.3, including ...
by 4RESTER
Wed Sep 07, 2011 10:26 am
Forum: Coding Questions
Topic: More that one CheckBox in Row
Replies: 8
Views: 3252

Re: More that one CheckBox in Row

Foz wrote:Perhaps esGrid or exGrid will be apt for you: http://www.purecoder.net/grids/screenshots.htm
If exist the MoreListIconGadget UserLib for the PureBasic 4.5x/4.6x then also can help (for free).
by 4RESTER
Wed Sep 07, 2011 8:14 am
Forum: Coding Questions
Topic: More that one CheckBox in Row
Replies: 8
Views: 3252

Re: More that one CheckBox in Row

How to make ListIconGadget with the more that one CheckBox in Row?
On Windows that would be very difficult using the Microsoft ListView control (which is
the underlying basis of the ListIconGadget) even if using API functions. But RASHAD
has found a kind of "cheat" by using two ListIconGadgets ...
by 4RESTER
Wed Sep 07, 2011 8:10 am
Forum: Coding Questions
Topic: More that one CheckBox in Row
Replies: 8
Views: 3252

Re: More that one CheckBox in Row

There may be an easier way to do this, but this will start you off with icons in other columns.

; English forum: http://www.purebasic.fr/english/viewtopic.php?t=7059&postdays=0&postorder=asc&start=15
; Author: Denis (updated for PB 4.00 by Andre)
; Date: 30. July 2003
; OS: Windows
; Demo: No ...
by 4RESTER
Tue Sep 06, 2011 9:54 am
Forum: Coding Questions
Topic: More that one CheckBox in Row
Replies: 8
Views: 3252

More that one CheckBox in Row

How to make ListIconGadget with the more that one CheckBox in Row?

Like this:
Image
by 4RESTER
Sat Aug 27, 2011 6:52 pm
Forum: Tricks 'n' Tips
Topic: Windows DIB Procedures
Replies: 1
Views: 2447

Re: Windows DIB Procedures

These procedures are taken from the "wincap32" DIB API.
They deal with creating, loading and saving windows bitmaps.
You can get the original source code here:
http://www.codeproject.com/clipboard/dib2clipboard.asp

Edit: I have removed the BITMAP parameter in CreateDIB, LoadDIB and LoadBMP and ...
by 4RESTER
Sat Aug 13, 2011 7:42 am
Forum: Feature Requests and Wishlists
Topic: "dup" extension for operator "Data"
Replies: 1
Views: 876

"dup" extension for operator "Data"

It would be nice to expand the directive "Data" by
"Dup" operator then make multiple copies of values (like in FASM).

Like this:
Data.B 4 Dup (5) = Data.B 5,5,5,5
Data.L 8 Dup (1,2) = Data.B 1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2
by 4RESTER
Sun May 15, 2011 12:51 am
Forum: Coding Questions
Topic: Select + Case + Default + EndSelect
Replies: 8
Views: 1689

Re: Select + Case + Default + EndSelect

netmaestro wrote:.c is 16 bits in unicode mode, better use .a for unsigned byte.
Okay.
8-bits unsigned as .A
16-bits unsigned as .U

What about 32-bits UNSIGNED values?
by 4RESTER
Sun May 15, 2011 12:24 am
Forum: Coding Questions
Topic: Select + Case + Default + EndSelect
Replies: 8
Views: 1689

Re: Select + Case + Default + EndSelect

What wrong in this code?

Global BPB_Media.B = $F8

Select BPB_Media.B
Case $F0,$F8 To $FF
Debug "BPB_Media: $"+RSet(Hex(BPB_Media, #PB_Byte),2,"0")
Default
Debug "Wrong BPB_Media: $"+RSet(Hex(BPB_Media, #PB_Byte),2,"0")
EndSelect


In fact, with such value
BPB_Media.B = $F8
the branch of ...