Click here to Skip to main content
16,006,440 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Can't define keyboard hook ... ( code attached ) Pin
Joseph Marzbani20-Sep-08 9:58
Joseph Marzbani20-Sep-08 9:58 
AnswerRe: Can't define keyboard hook ... ( code attached ) Pin
Hadi Dayvary20-Sep-08 10:08
professionalHadi Dayvary20-Sep-08 10:08 
GeneralRe: Can't define keyboard hook ... ( code attached ) Pin
Joseph Marzbani20-Sep-08 11:01
Joseph Marzbani20-Sep-08 11:01 
GeneralRe: Can't define keyboard hook ... ( code attached ) Pin
Bram van Kampen20-Sep-08 14:28
Bram van Kampen20-Sep-08 14:28 
GeneralRe: Can't define keyboard hook ... ( code attached ) Pin
Hamid_RT20-Sep-08 18:51
Hamid_RT20-Sep-08 18:51 
GeneralRe: Can't define keyboard hook ... ( code attached ) Pin
Joseph Marzbani21-Sep-08 13:48
Joseph Marzbani21-Sep-08 13:48 
Questioncalling a static member function Pin
steph520-Sep-08 9:12
steph520-Sep-08 9:12 
AnswerRe: calling a static member function [modified] Pin
Mark Salsbery20-Sep-08 10:15
Mark Salsbery20-Sep-08 10:15 
You can export the class from the project that implements the class:
class __declspec(dllexport) test
{
public:
	static void StaticMemberFunction();
};

void test::StaticMemberFunction()
{
   // do something
}

Then on the consumer side, import the class:
class __declspec(dllimport) test
{
public:
	static void StaticMemberFunction();
};
...
   // call the imported member function
   test::StaticMemberFunction();

Note that it's nicer to use a macro that expands to __declspec(dllexport)
or __declspec(dllimport) depending on the definition of a build-type macro:
// define BUILDINGDLL in the DLL project compiler preprocessor options
#if defined(BUILDINGDLL)
   #define MYIMPORTEXPORT __declspec(dllexport)  
#else
   #define MYIMPORTEXPORT __declspec(dllimport)  
#endif

Then both sides can share the same header file for the class, making
maintainability easier (if the class changes you don't have to remember
to change it in two places):
class MYIMPORTEXPORT test
{
public:
	static void StaticMemberFunction();
};

*EDIT*  I forgot to mention - you'll need to add the import library<br />
for the implementing module to the importing project's linker input settings.


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

modified on Saturday, September 20, 2008 4:33 PM

GeneralRe: calling a static member function Pin
steph520-Sep-08 15:02
steph520-Sep-08 15:02 
GeneralRe: calling a static member function Pin
Mark Salsbery21-Sep-08 15:08
Mark Salsbery21-Sep-08 15:08 
QuestionCFileFind Problem. Don't search the Subdirs. [Solved] Pin
fantasy121520-Sep-08 8:13
fantasy121520-Sep-08 8:13 
AnswerRe: CFileFind Problem. Don't search the Subdirs. Pin
Hamid_RT20-Sep-08 8:40
Hamid_RT20-Sep-08 8:40 
AnswerRe: CFileFind Problem. Don't search the Subdirs. Pin
Mark Salsbery20-Sep-08 8:45
Mark Salsbery20-Sep-08 8:45 
QuestionRe: CFileFind Problem. Don't search the Subdirs. Pin
fantasy121520-Sep-08 13:14
fantasy121520-Sep-08 13:14 
AnswerRe: CFileFind Problem. Don't search the Subdirs. Pin
Bram van Kampen20-Sep-08 15:16
Bram van Kampen20-Sep-08 15:16 
QuestionDoes an edit box has something like TranslateMessage in it's procedure? Pin
Joseph Marzbani20-Sep-08 6:05
Joseph Marzbani20-Sep-08 6:05 
AnswerRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
Mark Salsbery20-Sep-08 8:03
Mark Salsbery20-Sep-08 8:03 
AnswerRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
followait20-Sep-08 15:23
followait20-Sep-08 15:23 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
Mark Salsbery21-Sep-08 6:52
Mark Salsbery21-Sep-08 6:52 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
followait21-Sep-08 14:05
followait21-Sep-08 14:05 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
Mark Salsbery21-Sep-08 14:29
Mark Salsbery21-Sep-08 14:29 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
followait21-Sep-08 20:39
followait21-Sep-08 20:39 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
Joseph Marzbani21-Sep-08 13:52
Joseph Marzbani21-Sep-08 13:52 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
followait21-Sep-08 14:06
followait21-Sep-08 14:06 
GeneralRe: Does an edit box has something like TranslateMessage in it's procedure? Pin
Mark Salsbery21-Sep-08 14:30
Mark Salsbery21-Sep-08 14:30 

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.