🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: include TForm into ShellExtensionDLL

#11291
From: nik
Date: Tue, 17 Feb 2004 17:08
38 lines
2304 bytes
can I use following code?
         //...
         TMyForm *form = new TMyForm(NULL);
         try {
             form->Show();            // I set the Action parameter of the
OnClose event to caFree. so normally it should free the memory itsselfe

         }
         catch(...){                    // for the case that any exception
has been thrown.
             delete form;
         }
         //...
I don't want to use ShowModal, since my Form represents a progresswindow
that has to be updated by another function.
nik



> > How do I have to free the memory after the use of the Form,
> > i.e. after I don't need the form any more.

> The easiest way to handle this is to simply instantiate the form when the
> DLL's IContextMenu::InvokeCommand() is called, use the form's ShowModal()
> method, and then 'delete' the form when ShowModal() returns, ie:
>
>     HRESULT TIContextMenuImpl::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
>     {
>         //...
>         TMyForm *form = new TMyForm(NULL);
>         try {
>             form->ShowModal();
>         }
>         __finally {
>             delete form;
>         }
>         //...
>     }
Technical Details
Message-ID: <40324a77$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <402baeac$1@newsgroups.borland.com> <402bcd77$3@newsgroups.borland.com> <402ebc24$1@newsgroups.borland.com> <402ec23f$1@newsgroups.borland.com> <40310c11$1@newsgroups.borland.com> <40314206$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,12d8f10b74656960
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-17 09:10:49 PST
From: "nik" <neusser@okstate.edu>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <402baeac$1@newsgroups.borland.com> <402bcd77$3@newsgroups.borland.com> <402ebc24$1@newsgroups.borland.com> <402ec23f$1@newsgroups.borland.com> <40310c11$1@newsgroups.borland.com> <40314206$1@newsgroups.borland.com>
Subject: Re: include TForm into ShellExtensionDLL
Date: Tue, 17 Feb 2004 11:08:07 -0600
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 139.78.92.106
Message-ID: <40324a77$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1077037687 139.78.92.106 (17 Feb 2004 09:08:07 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail