Click here to Skip to main content
15,890,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalerror while importing the static class member from dll Pin
Prasanth M V18-Feb-08 21:23
Prasanth M V18-Feb-08 21:23 
GeneralRe: error while importing the static class member from dll Pin
Iain Clarke, Warrior Programmer18-Feb-08 21:50
Iain Clarke, Warrior Programmer18-Feb-08 21:50 
GeneralRe: error while importing the static class member from dll Pin
Prasanth M V18-Feb-08 22:00
Prasanth M V18-Feb-08 22:00 
QuestionRe: error while importing the static class member from dll Pin
CPallini18-Feb-08 22:08
mveCPallini18-Feb-08 22:08 
GeneralRe: error while importing the static class member from dll Pin
Prasanth M V18-Feb-08 22:24
Prasanth M V18-Feb-08 22:24 
GeneralRe: error while importing the static class member from dll Pin
Rajesh R Subramanian18-Feb-08 22:35
professionalRajesh R Subramanian18-Feb-08 22:35 
GeneralRe: error while importing the static class member from dll Pin
Prasanth M V18-Feb-08 23:42
Prasanth M V18-Feb-08 23:42 
QuestionRe: error while importing the static class member from dll Pin
CPallini18-Feb-08 22:38
mveCPallini18-Feb-08 22:38 
The following is a working sample:
DLL header
#ifdef CPPDLL_EXPORTS
#define CPPDLL_API __declspec(dllexport)
#else
#define CPPDLL_API __declspec(dllimport)
#endif

class CPPDLL_API CCppDll {
public:
	CCppDll(void);
	~CCppDll(void);
	// TODO: add your methods here.

	static int nValue;
};


DLL source
// DLLMain stuff omitted
CCppDll::CCppDll()
{
	return;
}
CCppDll::~CCppDll()
{
	return;
}
int CCppDll::nValue = 0;


Application source
#include "stdafx.h"
#include "..\\..\\CppDLL\\CppDLL\CppDLL.h"

int _tmain(int argc, _TCHAR* argv[])
{
	CCppDll::nValue =5;
}


It works fine on my system (VS 2005, Win XP).

Have you checked again your client project settings? What about the little test with Dependency Walker?

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


GeneralRe: error while importing the static class member from dll Pin
Prasanth M V19-Feb-08 0:07
Prasanth M V19-Feb-08 0:07 
AnswerRe: error while importing the static class member from dll [modified] Pin
Rajkumar R19-Feb-08 0:15
Rajkumar R19-Feb-08 0:15 
Questionvfw.h and capDlgVideoDisplay Pin
Tomice18-Feb-08 21:05
Tomice18-Feb-08 21:05 
GeneralRe: vfw.h and capDlgVideoDisplay Pin
Mark Salsbery19-Feb-08 8:18
Mark Salsbery19-Feb-08 8:18 
GeneralSaving a bitmap image in visual C++ 2003 Pin
MozhdehQeraati18-Feb-08 20:34
MozhdehQeraati18-Feb-08 20:34 
GeneralRe: Saving a bitmap image in visual C++ 2003 Pin
Hamid_RT18-Feb-08 20:43
Hamid_RT18-Feb-08 20:43 
GeneralRe: Saving a bitmap image in visual C++ 2003 Pin
MozhdehQeraati18-Feb-08 21:01
MozhdehQeraati18-Feb-08 21:01 
AnswerRe: Saving a bitmap image in visual C++ 2003 Pin
Rajkumar R18-Feb-08 21:03
Rajkumar R18-Feb-08 21:03 
GeneralRe: Saving a bitmap image in visual C++ 2003 Pin
MozhdehQeraati18-Feb-08 21:22
MozhdehQeraati18-Feb-08 21:22 
GeneralRe: Saving a bitmap image in visual C++ 2003 Pin
Prasanth M V18-Feb-08 21:56
Prasanth M V18-Feb-08 21:56 
QuestionRe: Saving a bitmap image in visual C++ 2003 Pin
Rajkumar R18-Feb-08 22:12
Rajkumar R18-Feb-08 22:12 
GeneralGINA Pin
MozhdehQeraati18-Feb-08 20:28
MozhdehQeraati18-Feb-08 20:28 
Generaltypedef Pin
George_George18-Feb-08 20:25
George_George18-Feb-08 20:25 
AnswerRe: typedef Pin
Rajkumar R18-Feb-08 20:45
Rajkumar R18-Feb-08 20:45 
GeneralRe: typedef Pin
George_George18-Feb-08 20:50
George_George18-Feb-08 20:50 
GeneralRe: typedef Pin
Prasanth M V18-Feb-08 21:38
Prasanth M V18-Feb-08 21:38 
GeneralRe: typedef Pin
George_George18-Feb-08 21:43
George_George18-Feb-08 21: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.