quote:
Originally posted by DJeX
it adds 24 bytes ever time it udates. I can even see it when i go into the task manager and look at the programs mem useage.
first of all: The values of memory usage shown in the task manager doesn't represent the real memory used by the programs, so don't worry very much about it. Are you sure it adds 24 bytes every update and forever? or does it stop at some value?
Well, about the code, I don't see anything wrong, however you don't posted all the code (in fact, I'm more interested in all the declarations of those variables and functions). First of all: Are you sure you need the calls to copymemory? i don't know where those pTablePtr and pDataRef come from, however maybe you could use a direct assignment.
And second thing: Again this is a supposition (because i don't know the declaration of the variables). What about using VarPrt? I mean:
CopyMemory VarPrt(nState), ByVal pTablePtr + (pDataRef + 4), 4
CopyMemory VarPrt(nLocalAddr), ByVal pTablePtr + (pDataRef + 8), 4
etc...
Well, if the code works, I suppose it's fine as you wrote it. (Also, at the first CopyMemory call, is it "pDataRef + 4" or just pDataRef? (and similar for other calls))