Click here to Skip to main content
16,011,757 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalsimple vc++ help Pin
Anonymous25-Sep-04 19:39
Anonymous25-Sep-04 19:39 
GeneralRe: simple vc++ help Pin
BAIJUMAX25-Sep-04 20:58
professionalBAIJUMAX25-Sep-04 20:58 
GeneralRe: simple vc++ help Pin
BAIJUMAX25-Sep-04 20:59
professionalBAIJUMAX25-Sep-04 20:59 
QuestionHow to generate Midi Sound? Pin
Aris Adrianto S25-Sep-04 18:25
Aris Adrianto S25-Sep-04 18:25 
AnswerRe: How to generate Midi Sound? Pin
Ravi Bhavnani25-Sep-04 21:38
professionalRavi Bhavnani25-Sep-04 21:38 
GeneralPrinting bitmap Pin
Yulianto.25-Sep-04 18:18
Yulianto.25-Sep-04 18:18 
GeneralRe: Printing bitmap Pin
Andrzej Markowski3-Oct-04 14:33
Andrzej Markowski3-Oct-04 14:33 
GeneralAbout Using Class in a Dll, plz help.. Pin
25-Sep-04 16:24
suss25-Sep-04 16:24 
Here is my codes to make a dll:
// =======================================================
// common.h -- header for dll and app.
// =======================================================
#ifndef COMMON_H
#define COMMON_H

#include "iostream"
using namespace std;

#ifdef DLL
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif

// export or import a class definition
class DLL_EXPORT test
{
public:
test() : m(5){}

void print() { cout<< "m = " << m <<endl; }
public:
="" int="" m;
};

="" export="" or="" import="" a="" function="" ..
dll_export="" void="" test_interface(test*="" ptest);

#endif

="" =="===================================================
//" main.cpp="" --="" imp="" for="" dll="" ;="" with="" d="" "dll"="" out:"test.dll"
="" "common.h"

void="" ptest)
{
="" ptest-="">print();
}

And the testing app here:
// =====================================================
// app.cpp -- testing "test.dll"
// =====================================================

#include "windows.h"
#include "common.h"

typedef void (* INIT_PROC)(test* pTest);

int main(void)
{

test t;

HMODULE hModule = ::LoadLibrary("test.dll");
if(hModule)
{
INIT_PROC proc = (INIT_PROC)::GetProcAddress(hModule,

"test_interface");
if(proc)
{
(*proc)(&t);
}
::FreeLibrary(hModule);
}
return 0;
}

There is an error when building app.cpp:
app.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public:

__thiscall test::test(void)" (__imp_??0test@@QAE@XZ)
Debug/test_app.exe : fatal error LNK1120: 1 unresolved externals

I cound't fix it. Plz help. Thanks very much.
GeneralRe: About Using Class in a Dll, plz help.. Pin
Antti Keskinen26-Sep-04 1:59
Antti Keskinen26-Sep-04 1:59 
GeneralHelp !!! gateway ... Pin
mazi195525-Sep-04 12:14
mazi195525-Sep-04 12:14 
GeneralDialog Pin
swarup25-Sep-04 9:11
swarup25-Sep-04 9:11 
GeneralRe: Dialog Pin
Yulianto.25-Sep-04 18:21
Yulianto.25-Sep-04 18:21 
GeneralRe: Dialog Pin
David Crow27-Sep-04 10:10
David Crow27-Sep-04 10:10 
GeneralUrgent Database issue Pin
brdavid25-Sep-04 8:37
brdavid25-Sep-04 8:37 
GeneralRe: Urgent Database issue Pin
Yulianto.25-Sep-04 18:28
Yulianto.25-Sep-04 18:28 
GeneralRe: Urgent Database issue Pin
brdavid26-Sep-04 0:54
brdavid26-Sep-04 0:54 
GeneralRe: Urgent Database issue Pin
Yulianto.26-Sep-04 14:54
Yulianto.26-Sep-04 14:54 
GeneralRe: Urgent Database issue Pin
brdavid26-Sep-04 15:08
brdavid26-Sep-04 15:08 
GeneralRe: Urgent Database issue Pin
Yulianto.26-Sep-04 18:52
Yulianto.26-Sep-04 18:52 
GeneralRe: Urgent Database issue Pin
brdavid27-Sep-04 2:14
brdavid27-Sep-04 2:14 
GeneralRe: Urgent Database issue Pin
Yulianto.28-Sep-04 18:20
Yulianto.28-Sep-04 18:20 
GeneralRe: Urgent Database issue Pin
brdavid3-Oct-04 11:01
brdavid3-Oct-04 11:01 
GeneralRe: Urgent Database issue Pin
Yulianto.3-Oct-04 15:26
Yulianto.3-Oct-04 15:26 
Generalpassword in c++ Pin
Anonymous25-Sep-04 5:30
Anonymous25-Sep-04 5:30 
GeneralRe: password in c++ Pin
HalfWayMan25-Sep-04 8:15
HalfWayMan25-Sep-04 8:15 

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.