Click here to Skip to main content
15,908,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerApologize Pin
Wischkony15-Dec-08 3:40
Wischkony15-Dec-08 3:40 
GeneralRe: Apologize Pin
Mark Salsbery15-Dec-08 11:05
Mark Salsbery15-Dec-08 11:05 
QuestionDeviceIoControl Pin
john563215-Dec-08 0:36
john563215-Dec-08 0:36 
AnswerRe: DeviceIoControl Pin
Steve Thresher15-Dec-08 4:29
Steve Thresher15-Dec-08 4:29 
QuestionUnresolved external symbol in a DLL Pin
George_George14-Dec-08 23:32
George_George14-Dec-08 23:32 
AnswerRe: Unresolved external symbol in a DLL Pin
nbugalia15-Dec-08 0:45
nbugalia15-Dec-08 0:45 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 0:55
George_George15-Dec-08 0:55 
GeneralRe: Unresolved external symbol in a DLL Pin
nbugalia15-Dec-08 1:18
nbugalia15-Dec-08 1:18 
Here is the Dll file code -
foo.h
class __declspec (dllexport) CFoo 
{
public:	
    CFoo();	
    int foo1();	
    int foo2();
};

__declspec (dllexport) CFoo foo;re>

Foo.cpp
<pre>#include "Foo.h"

CFoo::CFoo()
{	
    return;
}
int CFoo::foo1()
{	
    return 100;
}
int CFoo::foo2()
{	
    return 200;
}


and here is the console based application code -
Foo.h
class __declspec (dllimport) CFoo
{
public:	
    CFoo();	
    int foo1();	
    int foo2();
};

__declspec (dllimport) CFoo foo; 

test.cpp
#include "foo.h"
int main()
{	
    int i = foo.foo1();	
    i = foo.foo2();	
    return 0;
}

Don't forget to set the dependency to Foo.lib file in the test project settings.
Hope this will help. Big Grin | :-D

GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 1:54
George_George15-Dec-08 1:54 
AnswerRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 0:51
Naveen15-Dec-08 0:51 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 1:16
George_George15-Dec-08 1:16 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 1:28
Naveen15-Dec-08 1:28 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 1:59
George_George15-Dec-08 1:59 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 2:13
Naveen15-Dec-08 2:13 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George15-Dec-08 2:49
George_George15-Dec-08 2:49 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen15-Dec-08 3:14
Naveen15-Dec-08 3:14 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George16-Dec-08 1:34
George_George16-Dec-08 1:34 
GeneralRe: Unresolved external symbol in a DLL Pin
Naveen16-Dec-08 2:16
Naveen16-Dec-08 2:16 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George18-Dec-08 0:21
George_George18-Dec-08 0:21 
GeneralRe: Unresolved external symbol in a DLL Pin
Stuart Dootson16-Dec-08 3:33
professionalStuart Dootson16-Dec-08 3:33 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George18-Dec-08 0:22
George_George18-Dec-08 0:22 
GeneralRe: Unresolved external symbol in a DLL Pin
Stuart Dootson18-Dec-08 0:36
professionalStuart Dootson18-Dec-08 0:36 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George18-Dec-08 1:25
George_George18-Dec-08 1:25 
GeneralRe: Unresolved external symbol in a DLL [modified] Pin
Stuart Dootson18-Dec-08 2:42
professionalStuart Dootson18-Dec-08 2:42 
GeneralRe: Unresolved external symbol in a DLL Pin
George_George20-Dec-08 0:07
George_George20-Dec-08 0:07 

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.