🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9404

Re: Hibernate and wake up your application

#9404
From: Bob Gonder
Date: Sat, 10 Jul 2004 02:31
39 lines
2781 bytes
<Donut> wrote:

>All labtop computers has a hibernate function which stores the current state
>of all running application at the time hibernate function activated and then
>when wake-up function activated all applications are restored and they
>continue normal operation from the state when they are forced to hibernate.
>
>How to implement such  functions; hibernate and wake-up, on application base
>in such a way that we can press a button and save the current state of the
>application and may be copy the saved state onto another computer and wake
>it up from the state when it hibernated?
>
>Any idea?

No.
You'd have to copy all of the DLLs loaded into memory that the program
relys on, as there is no guarantee that loading them again after
hybernation would put them back in the same locations.
Then, when you restore the dlls, well, they aren't registered properly
with Windows, so who knows what kind of system bugs that would
produce?

Or, before you saved the program, you would need to unload _all_ the
dlls, probably including the kernal, and all of the auto-load dlls
that load before you even get to _main(). And how would you save it
without the file i/o from the kernal?

Then there's the problem of how do you restore it? Writting a program
into executable memory isn't allowed. (Or it is? But not for long as
it's a Viral action?)

So, no. Hibernate in the Windows sense isn't going to make it.

But, all is not lost.
What you _can_ do is copy all of your data and settings to disk, and
read them back in when you restart the application. If the data is in
Global as opposed to Stack space, then the copying is easier. If you
want to come back to the same sub-screen, you'd need to mark that in
the file some how, and add the code to get back to that screen.
Technical Details
Message-ID: <tqjue05n7v2h4ilf9jlb9ru8gqrdjgs5sl@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40eeca58@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4d674f5ededb40e6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Hibernate and wake up your application
Date: Fri, 09 Jul 2004 19:31:47 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <tqjue05n7v2h4ilf9jlb9ru8gqrdjgs5sl@4ax.com>
References: <40eeca58@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 65.40.149.185
X-Trace: newsgroups.borland.com 1089426703 65.40.149.185 (9 Jul 2004 19:31:43 -0700)
Lines: 44
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail