About #Pragma Library #include .CH and DLLs

If you are converting a text-based Clipper application, a FoxPro application or just writing an application from scratch, use this forum for your eXpress++ questions.
Post Reply
Message
Author
User avatar
alepap
Posts: 94
Joined: Tue Jul 28, 2015 5:15 am

About #Pragma Library #include .CH and DLLs

#1 Post by alepap »

It would be nice to have some posts that explains the difference between the DLL and the LIB, when to add it as #Pragma Libray in the PRG file or in the project file.

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: About #Pragma Library #include .CH and DLLs

#2 Post by rdonnay »

A DLL contains executable binary code. It is identical to an EXE except that it has no specific start procedure.

A LIB contains a list of public functions that are included in the associated DLL. This is why you must reference LIB files in your project file or with a #Pragma() in your source code.

The linker (ALINK) is called by PBUILD as the last step in the project build process. It resolves symbols that are called from your application to where they exist in a DLL and only when all symbols are resolved then the EXE or DLL is created. This resolution is accomplished by searching the LIB file for each DLL.

You do not need to distribute LIB files with your end applications unless your customers are Xbase++ programmers who intend to use your library in their own application, such as eXpress++ because LIB files are only used at LINK time not at RUNTIME.

CH files are basically the same as PRG files. They are used by the XPP compiler when compiling source into .OBJ files which will later be linked together into an EXE or DLL.

CH files usually contain only commands or definitions but they can also contain executable code an procedures.

DCDIALOG.CH contains all the DC* command for the eXpress++ GUI system.

The XPP compiler also contains a pre-processor. This pre-processing is done before the actual compiling of the source. It converts all commands into functions recognizable by the compiler and all defines into literal values recognized by the compiler. To see how the pre-processor works add the /P switch to your compile parameters in your project file. A file will be created with the .PPO (pre-processed output) extension. This will show exactly what is getting compiled into your binary EXEs and DLLs.
The eXpress train is coming - and it has more cars.

User avatar
alepap
Posts: 94
Joined: Tue Jul 28, 2015 5:15 am

Re: About #Pragma Library #include .CH and DLLs

#3 Post by alepap »

:clap: Thank you.

Post Reply