I am still not totally sure what you are doing.
A good place to start is with the sample. Get the sample compiled and run
and then you will have the "environment" established for your own DLL
development.
Perhaps the only thing you are missing is "loading" your DLL. You do that
in the Library section of configuration. There are libraries you can select
at the top of the dialog box (yours will not be listed) or you can search
for them in the bottom of the dialog.
All this dialog does is to insert a LibPreLoad statement into cwright.ini
for your DLL. If it is in the CodeWright root it will be something like ...
LibPreLoad=tlaLocal.dll
You can see them at the beginning of your cwright.ini file.
If you plan to include the functions in other DLLs then you need to move the
.LIB and .EXP files that are created to the CodeWright LIB/WIN32 directory.
The prototype ...
int DLL locOutputWindow( void );
,... is obviously optional in this sample.
To reference the function from another DLL you would use a prototype of ...
CW_DECLSPEC int DLL locOutputWindow( void );
... in the calling module.
A simple example follows. After compiling and adding the LibPreLoad
statement you can execute the function with>>locOutputWindow( );<<
-------- tlaLocal.c
// -------------------------------------------------------------------------
--------------
//
// tlaLocal.dll
//
// -------------------------------------------------------------------------
--------------
#include <windows.h>
#include "exports.h"
#include "cwstart.h"
int DLL locOutputWindow( void );
LIBMAIN
// -------------------------------------------------------------------------
--------------
// _init - Register External DLL Functions
// -------------------------------------------------------------------------
--------------
void DLL _init( )
{
LibExport( "int locOutputWindow( void )" );
return ;
}
// -------------------------------------------------------------------------
--------------
// locOutputWindow
// -------------------------------------------------------------------------
--------------
int DLL locOutputWindow( void )
{
return ( OutputWindow( 8 ) );
}
// -------------------------------------------------------------------------
--------------
// 2003.02.06 10:51 Copyright ?1993-2003 - Thom Little Associates, Ltd. -
www.tlaNET.net
-------- tlaLocal.def
LIBRARY tlaLocal
DESCRIPTION 'tlaLocal.dll'
;CODE READ SHARED EXECUTE
;DATA READ WRITE
EXPORTS
_init @2
locOutputWindow@3
--
-- Thom Little --
www.tlaNET.net -- Thom Little Associates, Ltd.
"Bob" <
XXXX@XXXXX.COM >wrote in message
Quote
well, i fixed the linking problem. i switched from c++ to a c compiler and
it works. only i'm not able to call my own dll functions. what i did is the
following:
Quote
- made the dll
- compiled (succesfully)
- created a .def file (by hand, dont know if there is some tool for this)
- copied both files to the codewright dir
- from codewright: Customize|Libraries and added the dll form the code
write dir.
what know... i cant call it from a API command or Macro and neither can i
attach it to a keymap.
plz advise
Bob
"Bob" < XXXX@XXXXX.COM >wrote: