Hello,
I am new to Pelles C.
I have deep experiences with C under Unix plattforms,
but none with C under Win32.
Actually I try to create a dll file which shall contain a function mytest()
I'd like to call from several different exe files.
To do this I've got a Demo.h template which looks like this:
#ifndef DEMO_H
#define DEMO_H
typedef char bool;
struct DEMO_DATASTRUCT
{
int year,month,day,starttime,endtime;
bool plotme;
bool ascii_been_here;
};
extern "C" double __declspec(dllexport) mytest(DEMO_DATASTRUCT *price_ptr,
int currentptr, int *int_args, int num_int_args, double *double_args,
int num_double_args, char **string_args, int num_string_args);
#endif
The according c-source Demo.c file has this content:
#include <windows.h>
#include "Demo.h"
//---------------------------------------------------------------------------
extern "C" double __declspec(dllexport) mytest(DEMO_DATASTRUCT *price_ptr,
int currentptr, int *int_args, int num_int_args, double *double_args,
int num_double_args, char **string_args, int num_string_args)
{
/* well, this function actually does nothing usefull,
however, it should compile without failure */
return 0.4711;
}
#pragma argsused
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return 1;
}
My question regarding Pelles C is,
how must this template be modified to compile it as a dll library.
I'd appreciate, if anyone could explain me this.
Thanks in advance
Christoph