Thanks for the quick reply...
after some searching i found the proper #pragma command
#pragma pack(1)
so i added that to the daemon.h file at the top, compiled with no problem but same error message when i was trying to run
i also added it to the main.c file ( just with a slight hope it might help but no luck )
Heres a paste of the main.c file
//
// TEMPLATE.C
// Basic shell code for a Mercury/32 Daemon Process
//
// Copyright (c) 1997-98, David Harris, All Rights Reserved.
//
#pragma pack(1) /* set alignment to 1 byte boundary */
//#define STRICT
#include "main.h"
#include <stdio.h>
#include <stdarg.h>
#define USES_M_INTERFACE
#include "daemon.h"
HINSTANCE hLibInstance; // set in LibMain, used throughout the DLL
M_INTERFACE *mi; // see the note below under "daemon" for this.
short _export daemon (void *job, M_INTERFACE *m, char *address, char *parameter)
{
// This is the function called by Mercury. Note that we have
// created a global variable of type "M_INTERFACE *" called
// "mi": doing this allows us to use the "convenience macros"
// in DAEMON.H for accessing Mercury internal functions.
//
// At present, the return value from this function is unused
// except for Global Daemons (see DAEMON.TXT for more
// information on Global Daemons). You should always return
// 0 from this function by default.
mi = m;
if ((mi->vmajor < 2) || ((mi->vmajor == 2) && (mi->vminor < 20)))
return 0;
// Do your daemon processing here.
FILE *fp = fopen("mercuryDLL.txt", "a+");
fwrite("> demon\r\n", 9, 1, fp );
fclose( fp );
return 0;
}
// DLLEntryPoint is the standard Win32 DLL entry point for the
// module. Usually all we do in this function is store our
// Instance handle for use in other places, but any reasonable
// initialization processing can be done here as well.
BOOL WINAPI DllEntryPoint (HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
//WNDCLASS wc;
if (reason == DLL_PROCESS_ATTACH)
hLibInstance = hInst;
return (TRUE); // Initialization went OK
}
I also used the template\daemon.h file adding the
#pragma pack(1)
command to the top of that too