🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to use LoadPackage in BCB ?

#15605
From: Pang Fu
Date: Sun, 22 Jun 2003 06:46
55 lines
2506 bytes
Dear Remy Lebeau (TeamB),

Thank you for the Delphi to BCB convertion of the code.

This code generates two error messages one in compile time and the other at
run time.

Compile time error message is on the UnloadPackage(PackageModule) line.
I've tried UnloadPackage( reinterpret_cast<unsigned>(PackageModule)) to
clear the compile time error message. (I'm not sure if this is right way to
do)

The runtime error is on the LoadPackage line. This line causes
'InvalidPointerOperation' run-time error message.

Would you recommend further how to solve this problems?
Is there any BCB example code somewhere in this universe showing how to use
dynamic package loading in BCB?

Thanks.

Pang Fu
pangfu@hotmail.com



"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3ef2aa44$1@newsgroups.borland.com...
>
> "Pang Fu" <pangfu@hotmail.com> wrote in message
> news:3ef2a233@newsgroups.borland.com...
>
> >    (3) Can some one convert the following Delphi code
> > into BCB
>
>     typedef void __fastcall (*TProc00)(void);
>
>     HMODULE PackageModule;
>     TProc00 Proc00;
>
>     PackageModule =
reinterpret_cast<HMODULE>(LoadPackage("Package1.bpl"));
>     if( PackageModule )
>     {
>         Proc00 = reinterpret_cast<TProc00>(GetProcAddress(PackageModule,
> "ProC00"));
>         if( Proc00 )
>             Proc00();
>         UnloadPackage(PackageModule);
>     }
>
>
> Gambit
>
>
Technical Details
Message-ID: <3ef5c77e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ef2a233@newsgroups.borland.com> <3ef2aa44$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2a0bcef6d2779e50
X-Google-Attributes: gid10cc67,public
X-Google-Thread: 102541,2a0bcef6d2779e50
X-Google-Attributes: gid102541,public
X-Google-ArrivalTime: 2003-06-22 08:16:21 PST
From: "Pang Fu" <pangfu@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.students
References: <3ef2a233@newsgroups.borland.com> <3ef2aa44$1@newsgroups.borland.com>
Subject: Re: How to use LoadPackage in BCB ?
Date: Sun, 22 Jun 2003 16:46:22 +1000
Lines: 57
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: 210.50.52.26
Message-ID: <3ef5c77e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1056294782 210.50.52.26 (22 Jun 2003 08:13:02 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail