Skip to main content

Problem:

Applications will have .EXE programs calling DLLs.

The COBOL progams used to create the >DLLs may have multiple entry points in addition to the main entry point or there might be multiple COBOL programs built into the one .DLL.

Will the LIB file be kept and will LINK resolve calls to these entry points?

Resolution:

Check the related tab for a complete example project.

===========================================================

                          M I C R O F O C U S

                          N E T E X P R E S S   

===========================================================

                       PROJECT COBOL Entry Points

                       ==================

DATE CREATED: April, 2006

=================

BUILD WITH RELEASE: NetExpress 4.0 all06n40.exe

================================

TABLE OF CONTENTS

=============

INTRODUCTION

SOURCE FILES

REQUIREMENTS

OPERATION

INTRODUCTION

==========

This example illustrates how a calling program interfaces with an entry

point in a DLL.

A definite Build protocol must be observed.

Build the DLL file first. Keep the temporary files from the build. The

DLL's import library (*.LIB) is a temporary file. It is created in the

DEBUG folder. In "Project" (menu), "Build Settings..." (button), "Link"

(tab), "Category" (listbox), select "Advanced", check "Keep temporary

Linker files" (checkbox).

Code a "special-names" paragraph in the calling program. Assign the

"static link" (8) call convention a symbolic name (cc8).

        special-names.

            call-convention 8 is cc8.

Include the "static link" symbolic name in all call statements to DLL

entry points.

        call cc8 'ENTRYPT'

When you build the calling program you must specify the import library

file names for the link program. In "Project" (menu), "Build

Settings..." (button), "Link" (tab), "Category" (listbox), select

"Advanced", complete "Link with these LIBS." (textbox), by typing in

your import library folder and file names.

        ./DEBUG/DLLONE.LIB ./DEBUG/DLLTWO.LIB

"Rebuild All" may not compile your programs successfully. Remember, all

the DLL files must be rebuilt before you can rebuild the EXE program.

SOURCE FILES:

=========

Program Files

Description

========================================================

MAINpgm.cbl     This example program calls an entry point "DLLONE1" in

                          DLL DLLONE and an entry point "DLLTWO1" in DLL DLLTWO.

                          Call convention 8 and import libraries are used to

                          resolve the call statements.

DLLONE.cbl      This example program has an entry point "DLLONE1" and

                         when compiled creates an import library.

DLLTWO.cbl      This example program has an entry point "DLLTWO1" and

                         when compiled creates an import library.

REQUIREMENTS:

==========

There are no special requirements.

OPERATION:

========

Animate the MAINpgm program and observe how the calls are resolved.

===========================================================

Micro Focus and Net Express are registered trademarks of:

                   Micro Focus International, Inc.

========================================================================

Copyright (C) 1996-2006 Micro Focus, Inc.

Attachments:

EntryPts.zip

Old KB# 3909