Click here to Skip to main content
15,917,795 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to Convert HDC to CDC? Pin
Stephen Hewitt3-Mar-08 15:30
Stephen Hewitt3-Mar-08 15:30 
NewsRe: How to Convert HDC to CDC? Pin
Rajkumar R5-Mar-08 19:16
Rajkumar R5-Mar-08 19:16 
GeneralRe: How to Convert HDC to CDC? Pin
Stephen Hewitt3-Mar-08 15:32
Stephen Hewitt3-Mar-08 15:32 
GeneralRe: How to Convert HDC to CDC? Pin
led mike3-Mar-08 16:47
led mike3-Mar-08 16:47 
GeneralRe: How to Convert HDC to CDC? Pin
TooShy2Talk3-Mar-08 16:31
TooShy2Talk3-Mar-08 16:31 
GeneralRe: How to Convert HDC to CDC? Pin
ThatsAlok3-Mar-08 18:24
ThatsAlok3-Mar-08 18:24 
GeneralRe: How to Convert HDC to CDC? Pin
Hamid_RT3-Mar-08 20:58
Hamid_RT3-Mar-08 20:58 
GeneralExporting static member functions Pin
Wheatbread3-Mar-08 13:44
Wheatbread3-Mar-08 13:44 
I've succcessfully created a DLL full of classes that I've exported to use in another DLL. But I have a class that full of static member functions and the function names arent resolving

When I try to create a new DLL, importing the class definitions, I get unresolved external errors, but only for the static member functions. Why is that?

Shouldnt the class be imported when its declared?

Below is the class definitions

devlibrary.h - Included in my stdafx.h for both DLLs

#define DEV_DLL_EXPORT __declspec ( dllexport )
#define DEV_DLL_IMPORT __declspec ( dllimport )

#ifdef _DEVLIBRARY_DLL

#define DEVLIBRARY_CLASS DEV_DLL_EXPORT
#else
#define DEVLIBRARY_CLASS DEV_DLL_IMPORT
#endif

cpstinterface.h
class DEVLIBRARY_CLASS CPSTDriverInterface
{
static short GetCnlVarsCount();
static CCnlVar *GetAllCnlVar(short var_rank);
static CCnlVar *GetAllCnlVar(char *szProtVarName);
}

main.cpp

#include "cpstdriverinterface.h"
{
...

dwNumOfVars = CPSTDriverInterface::GetCnlVarsCount();
...
}

Error

error LNK2001: unresolved external symbol "__declspec(dllimport) public: static short __stdcall CPSTDriverInterface::GetCnlVarsCount(void)" (__imp_?GetCnlVarsCount@CPSTDriverInterface@@SGFXZ)
GeneralRe: Exporting static member functions Pin
Mark Salsbery3-Mar-08 14:26
Mark Salsbery3-Mar-08 14:26 
GeneralRe: Exporting static member functions Pin
Wheatbread3-Mar-08 14:54
Wheatbread3-Mar-08 14:54 
GeneralRe: Exporting static member functions Pin
Cedric Moonen3-Mar-08 20:41
Cedric Moonen3-Mar-08 20:41 
GeneralRe: Exporting static member functions Pin
Mark Salsbery3-Mar-08 20:43
Mark Salsbery3-Mar-08 20:43 
GeneralFor curious Pin
Hamid_RT3-Mar-08 20:54
Hamid_RT3-Mar-08 20:54 
GeneralRe: For curious Pin
Mark Salsbery3-Mar-08 21:22
Mark Salsbery3-Mar-08 21:22 
Question[OT] Re: For curious Pin
David Crow4-Mar-08 2:46
David Crow4-Mar-08 2:46 
GeneralRe: [OT] Re: For curious Pin
Mark Salsbery4-Mar-08 5:18
Mark Salsbery4-Mar-08 5:18 
GeneralRe: For curious Pin
Hamid_RT4-Mar-08 4:11
Hamid_RT4-Mar-08 4:11 
GeneralRe: Exporting static member functions Pin
Wheatbread4-Mar-08 2:55
Wheatbread4-Mar-08 2:55 
GeneralRe: Exporting static member functions Pin
Mark Salsbery4-Mar-08 5:19
Mark Salsbery4-Mar-08 5:19 
GeneralRedistribution FIle for VS 2008 Pin
Tjie Pouw3-Mar-08 13:27
Tjie Pouw3-Mar-08 13:27 
GeneralRe: Redistribution FIle for VS 2008 Pin
uusheikh3-Mar-08 18:16
uusheikh3-Mar-08 18:16 
QuestionUsing multiple Dialogs withing a Dialog application Pin
jonsey298473-Mar-08 9:04
jonsey298473-Mar-08 9:04 
GeneralRe: Using multiple Dialogs withing a Dialog application Pin
Mark Salsbery3-Mar-08 9:33
Mark Salsbery3-Mar-08 9:33 
GeneralRe: Using multiple Dialogs withing a Dialog application Pin
jonsey298473-Mar-08 11:28
jonsey298473-Mar-08 11:28 
GeneralRe: Using multiple Dialogs withing a Dialog application Pin
Mark Salsbery3-Mar-08 11:38
Mark Salsbery3-Mar-08 11:38 

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.