[shell-coding] Re: CPP variable storage question

----- Original Message -----
From: "e-sushi" <e-sushi@xxxxxxx>
To: <shell-coding@xxxxxxxxxxxxx>
Sent: Thursday, July 11, 2002 2:00 PM
Subject: [shell-coding] CPP variable storage question


> [...]
>
> Now to what I'm not sure about:
> what's the safest way to do the job in cpp without losing the data
somewhere
> in space and without having any heavy module load just to keep that one
var
> allive. Stupid me thinks another textfile would be stupid... and I hate
> reg-tuning, even if that's a nice possebility... but hey, all coding
> languages support var storing in several cool ways... Anyone feeling like
he
> should become my personal hero of the day and tell me what's up with vars
in
> cpp? Any pitfalls? Any hints?  A short answer like: "memcopy will not get
> lost when..." or "just don't try to..." would be enough, I'll sort out the
> rest  and stop bugging you right away - thanks!


sorry, mate.  the only way to achieve such persistence is to write out to a
file or to the Registry.

actually, i take that back.  theoretically, you could define the variable as
a raw resource (RT_RCDATA) and just modify the resource's data as your
variable value changes (or whenever you see fit to persist the value).
check out the UpdateResource API call.

that said, i'm not sure which strategy offers the most advantages, best
performance, etc., etc.  i'm just giving you options. ;)  again, however,
there's no way to persist data after a process has expired besides writing
said data to a file (modifying the resource data implicitly does this) or
using the Registry.

hope that helps.

voxelite



__________________________________________________
Subscription options and archive:
http://www.freelists.org/list/shell-coding

Other related posts: