[delphizip] Re: Source code formatting for DLLs

  • From: "Russell Peters" <russellpeters@xxxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Tue, 2 Apr 2002 07:17:10 +1000

Yes, I finally remembered that - I could not work out why those calls
worked, I remembered that for efficiency Windows (external interface
particularly) used what at that time was called the Pascal calls (now almost
standardised as __stdcall). It should be safe to leave those calls WINAPI
and as only the address of the call-back function is used provided it is
typedef with __stdcall (or WINAPI) all should be happy.
- Russell
----- Original Message -----
From: <Eric.Engler@xxxxxxxxxxxxxx>
To: <delphizip@xxxxxxxxxxxxx>
Sent: Tuesday, April 02, 2002 4:08 AM
Subject: [delphizip] Re: Source code formatting for DLLs


> VC++ has a macro called WINAPI that specifies __stdcall
> as part of it's definition. Does C++ Builder also have
> the WINAPI macro?
>
> I still need to look at all the declarations.
>
> Eric
>
> -----Original Message-----
> From: Russell Peters [mailto:russellpeters@xxxxxxxxxxx]
> Sent: Monday, April 01, 2002 12:44 AM
> To: delphizip@xxxxxxxxxxxxx
> Subject: [delphizip] Re: Source code formatting for DLLs
>
>
> I'd say your problem is the interface with ZipBuilder -
> Your secondary entry points probably need to be
> __stdcall long
> ie
> extern __stdcall long GetUnzDllVersion( void );
> extern __stdcall long GetUnzDllPrivVersion( void );
> extern __stdcall long UnzDllExec( DCL1 *C );
> but definately the callback must be declared
> /* Define a type called DLLCALLBK: */
> typedef __stdcall unsigned long (*DLLCALLBK)(CallBackStruct *);
> or it will freeze (or worse) after return from it.
> - Russell
> ----- Original Message -----
> From: "Eric Engler" <englere@xxxxxxxxxxx>
> To: <delphizip@xxxxxxxxxxxxx>
> Sent: Monday, April 01, 2002 2:43 AM
> Subject: [delphizip] Source code formatting for DLLs
>
>
> > I have updated the "betadllsrc.zip" file on my
> > web site. The source files have been reformatted
> > to make them look much better!
> >
> > I have included the code to initialize the DLLs,
> > but there is still a problem somewhere.  I'll
> > look into it further.
> >
> > I also have a nice Delphi source code formatter that
> > I'll explain in the future. For now I'm working on the
> > DLLs.
> >
> > Here's some more info:
> >
> >              Auto Formatting of C Source Files
> >
> > Some programmers don't like source code formatting
> > programs because they can make formatting changes that
> > aren't desired, or in some cases they can actually "break"
> > a source file.
> >
> > I started out hating formatting programs, but over the years
> > I have changed my mind. There is a lot of C source code in
> > the Delphi Zip DLLs, and it's too hard to keep formatting
> > the code "by hand".  I have decided to use the GNU "indent"
> > program to automatically format the source files to make
> > them easier to understand.
> >
> > You must use this "indent" program with extreme caution
> > because it is possible that a source file can be damaged. If
> > you spot the error message you can often figure out what
> > went wrong.  You can then edit the source file to make it
> > easier for the indent program to do it's job correctly, and
> > then you can run the formatter again.
> >
> > See my web site for "betadllsrc.zip":
> > http://www.geocities.com/SiliconValley/Network/2114/
> >
> >
>
>
>


Other related posts: