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