I am trying to use the following .c and .h files to create a dll. After the dll is created and I try to reference it, I get the following error:
"The instruction at "0x003e776" reference memory at "0x004e776". The memory could not be "written".
AM I MISSING SOMETHING HERE????
Here is the MainDll.c file:
___________________________________
/* MainDll.h contains the foreward declarations
for the three functions we define in this source
file */
#include "MainDll.h"
/******************************************************************************/
/* */
/* Function: */
/* Name: Login */
/* type: int */
/* parameters: PCSTR key, PSTR buffer, SIZE_T buffLen */
/* return values: 0 - successful */
/* prototype:int CALLBACK Login(PCSTR key, PSTR buffer, SIZE_T buffLen)*/
/* description: This function is called whenever a user attempts to log*/
/* in. Key is login name and is copied into buffer, */
/* bufflen is always 11 */
/* */
/******************************************************************************/
int Login(char const *key, char *buffer, int buffLen)
{
strcpy(buffer,key);
return (0); // Successful
}
void Logout(char const *key)
{
}
int VerifyUser(char const *uid, char const *pwd)
{
return (0); // Successful
}
Here is the header file:
____________________________________
#ifndef _MAINDLL_H
#define _MAINDLL_H
#include <string.h>
int Login(char const *, char *, int);
void Logout(char const *);
int VerifyUser(char const *, char const *);
#endif
"The instruction at "0x003e776" reference memory at "0x004e776". The memory could not be "written".
AM I MISSING SOMETHING HERE????
Here is the MainDll.c file:
___________________________________
/* MainDll.h contains the foreward declarations
for the three functions we define in this source
file */
#include "MainDll.h"
/******************************************************************************/
/* */
/* Function: */
/* Name: Login */
/* type: int */
/* parameters: PCSTR key, PSTR buffer, SIZE_T buffLen */
/* return values: 0 - successful */
/* prototype:int CALLBACK Login(PCSTR key, PSTR buffer, SIZE_T buffLen)*/
/* description: This function is called whenever a user attempts to log*/
/* in. Key is login name and is copied into buffer, */
/* bufflen is always 11 */
/* */
/******************************************************************************/
int Login(char const *key, char *buffer, int buffLen)
{
strcpy(buffer,key);
return (0); // Successful
}
void Logout(char const *key)
{
}
int VerifyUser(char const *uid, char const *pwd)
{
return (0); // Successful
}
Here is the header file:
____________________________________
#ifndef _MAINDLL_H
#define _MAINDLL_H
#include <string.h>
int Login(char const *, char *, int);
void Logout(char const *);
int VerifyUser(char const *, char const *);
#endif