Clarion DLL Wrapper for C DLL 
Author Message
 Clarion DLL Wrapper for C DLL

I have developed a C DLL for which I have also developed a Clarion for
Windows 2 (CW2) DLL to serve as a wrapper for the C functions.  I can
access the functions in the C DLL directly from a CW2 program without a
problem.  However, I am having problems using the CW2 wrapper DLL.  If I
include the C DLL when I build the CW2 DLL (via the Library, object, and
resource files section of the Project settings), the C functions do not
work properly.  If I do not include the C DLL I get Link Errors
(Unresolved External) for the C functions when I try to build the CW2
DLL.

I have built and used both C and CW2 DLLs before, but I have not tried
to develop a CW2 DLL that accesses a C DLL before.  What do I need to do
to create my CW2 DLL?

Randall W. Morrison



Fri, 14 Mar 2003 03:00:00 GMT  
 Clarion DLL Wrapper for C DLL
Quote:

> I have built and used both C and CW2 DLLs before, but I have not tried
> to develop a CW2 DLL that accesses a C DLL before.  What do I need to do
> to create my CW2 DLL?

Nothing special unless you doing 16 bit. CW 16 bit dlls are not quite
standard.  I think the easiest thing if you are comfortable with c is to
call loadlibary and getprocaddress() then use a little topspeed C to call
the C dll directly without the topspeed dll in the middle.

Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com



Fri, 14 Mar 2003 03:00:00 GMT  
 Clarion DLL Wrapper for C DLL
Jim,

Thank you for your reply.  I am developing it as 32 bit and I want to
use Clarion for Windows 2 (CW2) for the wrapper to use some CW2
features.

I think the problem I am having is with the project settings.  How do I
build the CW2 DLL without the Link Errors (Unresolved External) when the
C DLL is not linked into the CW2 app?  I have included the function
prototypes for the C functions in the global map of the CW2 app.  How do
I tell CW2 that they will be linked later so that it does not try to
resolve the calls to the C functions?

Randall W. Morrison

Quote:


> > I have built and used both C and CW2 DLLs before, but I have not tried
> > to develop a CW2 DLL that accesses a C DLL before.  What do I need to do
> > to create my CW2 DLL?

> Nothing special unless you doing 16 bit. CW 16 bit dlls are not quite
> standard.  I think the easiest thing if you are comfortable with c is to
> call loadlibary and getprocaddress() then use a little topspeed C to call
> the C dll directly without the topspeed dll in the middle.

> Jim Kane  - TeamTopSpeed
> Productive Software Solutions
> Can't Find that Message?
> Get Organized, Get ForKeeps!
> www.fkeeps.com



Sat, 15 Mar 2003 03:00:00 GMT  
 Clarion DLL Wrapper for C DLL
Quote:

> I think the problem I am having is with the project settings.  How do I
> build the CW2 DLL without the Link Errors (Unresolved External) when the
> C DLL is not linked into the CW2 app?  I have included the function
> prototypes for the C functions in the global map of the CW2 app.  How do
> I tell CW2 that they will be linked later so that it does not try to
> resolve the calls to the C functions?

Like I said, get rid of the prototypes and call by address. Define the
functions in somefile.c and add the .c function to what ever you are
compiling as an external source file. CW will compile the c code to call
by address and avoid the problem you are having.  The alternative is
making a lib for the c dll with libmaker and linking that into your app.  
That requires understanding/control of name mangling with the ,name()
attribute depending on how the c dll is structured. Lots easier to do as I
say and write a few lines of topspeed c code.
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com


Sat, 15 Mar 2003 03:00:00 GMT  
 Clarion DLL Wrapper for C DLL
Randy,

Maybe I'm misunderstanding your question, but what I do:

(1) Use the Clarion LibMaker utility to create a DLL export library (.LIB)
for the 'C' DLL.  (Clarion's linker uses a different .LIB format and
generally barfs on .LIB files created by other C compilers like VC++.)

(2) Add the export library created in step 1 to your project under
Library/Object/Resource files.

HTH,

Bob


Quote:
> I have developed a C DLL for which I have also developed a Clarion for
> Windows 2 (CW2) DLL to serve as a wrapper for the C functions.  I can
> access the functions in the C DLL directly from a CW2 program without a
> problem.  However, I am having problems using the CW2 wrapper DLL.  If I
> include the C DLL when I build the CW2 DLL (via the Library, object, and
> resource files section of the Project settings), the C functions do not
> work properly.  If I do not include the C DLL I get Link Errors
> (Unresolved External) for the C functions when I try to build the CW2
> DLL.

> I have built and used both C and CW2 DLLs before, but I have not tried
> to develop a CW2 DLL that accesses a C DLL before.  What do I need to do
> to create my CW2 DLL?

> Randall W. Morrison




Sun, 16 Mar 2003 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. C5EE (Clarion Chain DLL) w/ C5EE (ABC Chain DLL)

2. C4a Making Clarion DLL using outside DLL's

3. CTL3D.DLL, CTL3D32.DLL, CTL3DV2.DLL and Clipper/Fivewin/R&R

4. Clarion MDI dlls called from VB - well done clarion

5. Odd problem with run-time linking to a clarion dll from a non-clarion app

6. Prototyping in Clarion a (non-Clarion) dll function

7. wsock.dll, wininet wrapper in STX

8. NT - Performance Data Helper DLL Wrapper?

9. VAST Help needed - Creating class wrapper fo C++ Custom control DLL

10. Visual DLL wrapper

11. Wrapper for GetOpenFileName() in comdlg32.dll

12. SWIG: Wrapper over windows dll

 

 
Powered by phpBB® Forum Software