PDA

View Full Version : Problem with DLL


Archangel
2nd December 2004, 09:25 AM
Hello!

Please, can you show me a sample code of the simple DLL for PDA? I don't realy sure that I write function implementation in correct place... :oops: :oops:
Here is my code, can you tell me were is my mistake?

myHeader.h

#ifdef MYDLL_IMPLEMENTATION
#define DLLEXPORT _declspec(dllexport)
#else
#define DLLEXPORT _declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif

DLLEXPORT int _cdecl Get54();

#ifdef __cplusplus
}
#endif


cppDll.cpp

// CppDll.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "CppDll.h"
#include "myHeader.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#define MYDLL_IMPLEMENTATION

//
// Note!
// .......
//

/////////////////////////////////////////////////////////////////////////////
// CCppDllApp

BEGIN_MESSAGE_MAP(CCppDllApp, CWinApp)
//{{AFX_MSG_MAP(CCppDllApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCppDllApp construction

CCppDllApp::CCppDllApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CCppDllApp object

CCppDllApp theApp;

int _cdecl Get54()
{
return 54;
}