Jump to content
Sign in to follow this  
Nologic

Error\Bug with DllStructCreate

Recommended Posts

Nologic

If you run the below script as is...it works fine, but if you uncomment ether "GUISetState" or "MsgBox" it will toss a memory error...anyone got any bright idea's? ^_^

#include <WinAPI.au3>

GUICreate("My GUI")
;GUISetState( )
GUIDelete ( )

;MsgBox(0, "Test:", 'test' )

$String = '1185760800'
$tBuffer = DllStructCreate("char[" & Number ( $String ) & "]")
$tBuffer = 0

MsgBox(0, "Finished:", 'Done' )

Share this post


Link to post
Share on other sites
monoceres

I cannot reproduce. However you do realize you're trying to allocate 1.2 GB of memory? It's possible you're running out of system memory or something.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Nologic

Yeah realize how much I'm buffering...but I have 3gigs of memory 2 of which is free...and not seeing why I'm getting the error when displaying a messagebox...or having a gui display then being destroyed.

Works fine other wise.

Share this post


Link to post
Share on other sites
Richard Robertson

No good program needs a buffer that large.

Share this post


Link to post
Share on other sites
Nologic

Well it does if is going to split a large binary file.

Really how big the buffer is...is not the issue I'm concerned with...but more why it fails (for me) when a messagebox is displayed, where if it not displayed it works fine.

Edited by Nologic

Share this post


Link to post
Share on other sites
monoceres

Well it does if is going to split a large binary file.

Ehm no?

Really how big the buffer is...is not the issue I'm concerned with...but more why it fails (for me) when a messagebox is displayed, where if it not displayed it works fine.

You're right, so since I cannot reproduce more info is needed. For starters, is the error coming from autoit or windows?


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Nologic

Heh okay your right it doesn't need to be that large...I'm trying to be lazy. ^_^

The error is from AutoIt version 3.3.0.0

Now if I set:

$String = '1000000000'

everything works fine, but at the original value things go wrong.

I'll see if I can find where the breaking point is.

Edited by Nologic

Share this post


Link to post
Share on other sites
Nologic

Exact values for my system prior to error:

$String = '1112735712' ; With both GUISetState & MsgBox Enabled

$String = '1255538656' ; With both disabled

So a difference of about 136MB...thats rather large.

Edited by Nologic

Share this post


Link to post
Share on other sites
Yashied

Share this post


Link to post
Share on other sites
Nologic

Well I'm not sure if fragmentation is the issue...as after rerunning the script several times I'm seeing that any GUI stuff displayed strips 136mb of my available resources...that seems really heavy. ^_^

Anyways I can and will work around this...just seemed odd that I'd lose 136mb and not have it reclaimed after the destruction of the GUI object.

Edited by Nologic

Share this post


Link to post
Share on other sites
Yashied
Nologic

I've tried that before but it doesn't seem to take on my system for some reason.

Well its not required to make one that large by any means in the present day...I was mostly looking to see if anyone had a work around for this curiosity I bumped into.

That and a blank GUI eating up that much resources has to be a bug of some sort.

All that said, thanks guys for your input and time.

Share this post


Link to post
Share on other sites
Richard Robertson

The use of resources is the large structure.

Many large-file programs use a buffer of about 64 kilobytes for a max. That is a fine space to allocate and it's not often you need more data than that at one time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.