 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Fri Jul 25, 2008 11:39 pm Post subject: |
|
|
| ell wrote: | | how I set the 'AND' of A and B to C ? | Setup C as shown for A, or B, with its buffer z. Replace the line
| Code: | | NumPut(NumGet(&x-1,A_Index,"UChar") & NumGet(&y-1,A_Index,"UChar"), &x-1, A_Index, "UChar") | with
| Code: | | NumPut(NumGet(&x-1,A_Index,"UChar") | NumGet(&y-1,A_Index,"UChar"), &z-1, A_Index, "UChar") | (The bitwise AND is ‘&’, replaced here with the bitwise OR: ‘|’, providing the union of the two bitmaps A and B in the bitmap C.)
| ell wrote: | | SET bitmap vars one to other… C := A | Replace the above line with
| Code: | | NumPut(NumGet(&x-1,A_Index,"UChar"), &z-1, A_Index, "UChar") |
| ell wrote: | on the 128mb bitmap var,
I can make same commands as you posted on your 'AND' example ?
what is the number I set as bitmap var capacity of 1GB ? | It should work with any size, up to 2GB. 32-bit Windows versions do not handle more. When the physical memory is exhausted, parts of the bitmap will be swapped to disk, which is very slow. |
|
| Back to top |
|
 |
rani
Joined: 18 Mar 2008 Posts: 95
|
Posted: Mon Sep 29, 2008 10:15 pm Post subject: ntdll bitmaps |
|
|
Hi Laslo
I checked in ahk and later in vb6 the ntdll bit search 'or' and 'and'
and itterate on or bits=1 in specififc ntdll
of course in ahk it was real slow.
but in VB6 I expected for much better response (immeditely)
if I want to use in my application hundreds( or even thousands)
of bitmap strings , using ntdll
how I can handle these bitmaps ?
putting all in memory in some pointer array ?
or is there some other technique to handle it ?
some internal 'database' or else ?
rgrds
rani |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Mon Sep 29, 2008 10:47 pm Post subject: |
|
|
When you create the bitmaps, you have to give them a name (an AHK variable, which contains the bitmap structure) and reserve memory for the data (other AHK variables, with the necessary VarSetCapacity calls). These variables can be array elements:
| Code: | Number_of_Bits = 66 ; whatever you need
Size_in_Bytes := ceil(Number_of_Bits/8)
Loop 999 {
VarSetCapacity(Bitmap%A_Index%, 8, 0) ; Bitmap header always 8 bytes
VarSetCapacity(Buffer%A_Index%, Size_in_Bytes, 0) ; Bitmap buffer
DllCall("ntdll\RtlInitializeBitMap", UInt, &Bitmap%A_Index%, UInt, &Buffer%A_Index%, UInt, Number_of_Bits)
} |
Edit: fixed typo
Last edited by Laszlo on Wed Oct 22, 2008 2:32 pm; edited 1 time in total |
|
| Back to top |
|
 |
rani
Joined: 18 Mar 2008 Posts: 95
|
Posted: Wed Oct 08, 2008 11:28 am Post subject: ntdll instance |
|
|
Hi Laso,
1.
I checked the array in VB6 , and it works.
2.
is it possible to make one instance of the array of bitmap strings (thousand's)
and in other tasks (PID threads) to get /set values to this array ?
to aviod loading all array in every task opened ?
how is the technique to do that ?
by COM/DCOM maybe ?
any code sample will help
3.
is it possible to make ahk script to wrap under COM object ?
so it will be treated ad activex dll ?
thanks
ran |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Wed Oct 08, 2008 12:54 pm Post subject: |
|
|
| look here |
|
| Back to top |
|
 |
rani
Joined: 18 Mar 2008 Posts: 95
|
Posted: Thu Oct 09, 2008 7:43 pm Post subject: |
|
|
Hi Laslo
I read your link but I could not connect how to use the ntdll functions
with the rea/write memory
ran |
|
| Back to top |
|
 |
rani
Joined: 18 Mar 2008 Posts: 95
|
Posted: Sat Oct 11, 2008 5:48 am Post subject: |
|
|
Hi Laslo
is it possible to wrap ahk script
as COM activex object ?
so other program can use it as DLL instance ?
rgrds
ran |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Sat Oct 11, 2008 1:49 pm Post subject: |
|
|
| Ask (PM) a COM expert, like Sean or Lexikos. |
|
| Back to top |
|
 |
rani
Joined: 18 Mar 2008 Posts: 95
|
Posted: Wed Oct 22, 2008 4:51 am Post subject: |
|
|
Hi Laszo
when I initialize the bitmap,
I want the max bits will be ,let say 500,000 or 1MB bits:
bits=500000
what is the number I set in the :
DllCall("ntdll\RtlInitializeBitMap"
it is in bits or bytes ? or k*32 ? |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Wed Oct 22, 2008 2:33 pm Post subject: |
|
|
| The last parameter is the number of bits. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|