Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Call a dll from a dll Pin
hli126-Jun-06 5:23
hli126-Jun-06 5:23 
GeneralRe: Call a dll from a dll Pin
hli126-Jun-06 5:30
hli126-Jun-06 5:30 
GeneralRe: Call a dll from a dll Pin
Sarath C26-Jun-06 5:24
Sarath C26-Jun-06 5:24 
GeneralRe: Call a dll from a dll Pin
hli126-Jun-06 5:35
hli126-Jun-06 5:35 
GeneralRe: Call a dll from a dll Pin
Zac Howland26-Jun-06 5:55
Zac Howland26-Jun-06 5:55 
GeneralRe: Call a dll from a dll Pin
hli126-Jun-06 7:42
hli126-Jun-06 7:42 
GeneralRe: Call a dll from a dll Pin
Zac Howland26-Jun-06 9:02
Zac Howland26-Jun-06 9:02 
GeneralRe: Call a dll from a dll Pin
hli127-Jun-06 3:28
hli127-Jun-06 3:28 
Thank you Zac,

However, I failed to change dllexport to dllimport with a warning: "warning C4273: 'GetConnection' : inconsistent dll linkage. dllexport assumed". So, I changed it back. Did I miss something?

I simplified my case by exporting one function only. Because I am a new VC++ programmer and don't know how to create a macro, I hope you could give me a further suggestion. This project is so import to me. I would very much appreciate if I could get assistance here.

Below is a brief detail. Many thanks.

-----------------------------------

Error message:

nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in firstDll.obj
nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in firstDll.obj; second definition ignored
Creating library Debug/firstDll.lib and object Debug/firstDll.exp



In the second dll (made by MFC), I declared an export function in the header file, DBArea.h.

__declspec(dllexport) int GetConnection(char *connectionStr);

In the first dll (made by stardard C++), I defined FIRSTDLL_EXPORTS in the firstDll.cpp

#include "stdafx.h"
#define FIRSTDLL_EXPORTS /////////////
#include "firstDll.h" ////////////////

I created a class, callSecondDll, and a member function callDll(), which was accessed from firstDll class. The header file DBArea.h (in second dll) was included in the file callSecondDll.cpp

#include "stdafx.h"
#include "callSecondDll.h"
#include "DBArea.h" //////////////////

...............

int callSecondDll::callDll()
{
................
int n = GetConnection(myString);
return 0;
}

hli
GeneralRe: Call a dll from a dll Pin
Zac Howland27-Jun-06 4:24
Zac Howland27-Jun-06 4:24 
GeneralRe: Call a dll from a dll Pin
hli127-Jun-06 7:43
hli127-Jun-06 7:43 
QuestionDebugger issues Pin
capricious_00126-Jun-06 4:39
capricious_00126-Jun-06 4:39 
QuestionRe: Debugger issues Pin
David Crow26-Jun-06 4:42
David Crow26-Jun-06 4:42 
AnswerRe: Debugger issues Pin
capricious_00126-Jun-06 4:59
capricious_00126-Jun-06 4:59 
AnswerRe: Debugger issues Pin
Sarath C26-Jun-06 4:51
Sarath C26-Jun-06 4:51 
GeneralRe: Debugger issues Pin
capricious_00126-Jun-06 5:01
capricious_00126-Jun-06 5:01 
GeneralRe: Debugger issues Pin
Sarath C26-Jun-06 5:05
Sarath C26-Jun-06 5:05 
GeneralRe: Debugger issues Pin
capricious_00126-Jun-06 5:19
capricious_00126-Jun-06 5:19 
Questiona map Resizing a map file; Pin
hatemtalbi26-Jun-06 4:27
hatemtalbi26-Jun-06 4:27 
QuestionRe: a map Resizing a map file; Pin
David Crow26-Jun-06 4:37
David Crow26-Jun-06 4:37 
AnswerRe: a map Resizing a map file; Pin
hatemtalbi26-Jun-06 4:50
hatemtalbi26-Jun-06 4:50 
QuestionRe: a map Resizing a map file; Pin
David Crow26-Jun-06 5:05
David Crow26-Jun-06 5:05 
AnswerRe: a map Resizing a map file; Pin
hatemtalbi26-Jun-06 5:10
hatemtalbi26-Jun-06 5:10 
GeneralRe: a map Resizing a map file; Pin
James Brown26-Jun-06 6:42
James Brown26-Jun-06 6:42 
GeneralRe: a map Resizing a map file; Pin
hatemtalbi26-Jun-06 6:46
hatemtalbi26-Jun-06 6:46 
GeneralRe: a map Resizing a map file; Pin
James Brown26-Jun-06 7:43
James Brown26-Jun-06 7:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.