DLL export vc++
I created a DLL project and sucessfully compiled which created both a .dll and a .lib
inside of the DLL project I use
#ifdef AUDITDLL_EXPORTS
#define AUDITDLL_API __declspec(dllexport)
#else
#define AUDITDLL_API __declspec(dllimport)
#pragma comment(lib, "AuditDll.lib")
#endif
to define the import/export and to set the lib path...
I also stuck the .dll file into my MFC project...
inside my MFC project I the #include"AuditDll.h"(has declaration for function checkComply)
upon compiling the MFC project I get the following error...
error LNK2001: unresolved external symbol "bool __cdecl checkComply(class System::String __gc * __gc[] ,class System::String __gc *,class System::String __gc *)" (?checkComply@@$$FYA_NP$01AP$AAVString@System@@P$AAV12@1@Z)
checkComply is a public function(wrapper) in my DLL which will call the exported function...hmmmm
what am i missing?
can anyone help...much appreciated..
[1011 byte] By [
wuhoo] at [2007-11-18 19:17:40]

# 2 Re: DLL export vc++
HEADER FILE THAT CONTAINs CheckComply
#pragma once
#include <gcroot.h>
//#include <windows.h>
//#include <_vcclrit.h>
using namespace System;
#ifdef AUDITDLL_EXPORTS
#define AUDITDLL_API __declspec(dllexport)
#else
#define AUDITDLL_API __declspec(dllimport)
#pragma comment(lib, "AuditDll.lib")
#endif
AUDITDLL_API bool checkFile(String* files[], String * logFileName,
String * baselineName);
bool checkComply(String* files[], String * logFileName, String * baselineName);
//call before anything else in this DLL/*
extern "C" AUDITDLL_API void _stdcall DllEnsureInit(void);
//call after the whole process is totally done
extern "C" AUDITDLL_API void _stdcall DllForceTerm(void);
the idea is that checkComply will call the imported function checkFile..
Thanks for taking a look..
wuhoo at 2007-11-11 1:19:01 >

# 3 Re: DLL export vc++
You need to declare it the same as 'checkFile'.
AUDITDLL_API bool checkComply(String* files[], String * logFileName, String * baselineName);
Right now, this function is not being exported from your DLL.
Viggy
# 4 Re: DLL export vc++
maybe i dont understand how this works...
here is my undewrstanding..
AUDITDLL_API bool checkFile(String* files[], String * logFileName,
String * baselineName);
^^ is a function from someother project i made..and its the thing I really need to get at...so I __declspec(dllexport) (ed) it...
bool checkComply(String* files[], String * logFileName, String * baselineName);
^^^ was meant to be a wrapper function that belonged to the dll, once called it would then call checkFile......Im gonna try to just call checkFIle directly...
if my understanding is wrong please correct me...
wuhoo at 2007-11-11 1:21:02 >

# 5 Re: DLL export vc++
i get the same error onmatter whcih function I call...
: unresolved external symbol "bool __cdecl checkFile(class System::String __gc * __gc[] ,class System::String __gc *,class System::String __gc *)" (?checkFile@@$$FYA_NP$01AP$AAVString@System@@P$AAV12@1@Z)
wuhoo at 2007-11-11 1:21:58 >

# 6 Re: DLL export vc++
The MC definatly knows something about the DLL functions because if I pass it the wrg number of params, it says, funct requires 3 paramaters , you only passed it two....
hmmm
this is my first crack at the DLL/MFC thing...and I guess Im missing something
wuhoo at 2007-11-11 1:23:06 >
