Click here to Skip to main content
15,912,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need example of forward declare Pin
Anonymous8-Nov-02 2:24
Anonymous8-Nov-02 2:24 
GeneralRe: Need example of forward declare Pin
dabs7-Nov-02 5:57
dabs7-Nov-02 5:57 
GeneralStyle fro CHeaderCtrl Pin
Telefonen7-Nov-02 5:01
Telefonen7-Nov-02 5:01 
GeneralRe: Style fro CHeaderCtrl Pin
Daniel Ferguson7-Nov-02 6:47
Daniel Ferguson7-Nov-02 6:47 
GeneralResizing the desktop area Pin
MiamiCoder7-Nov-02 4:46
MiamiCoder7-Nov-02 4:46 
GeneralRe: Resizing the desktop area Pin
Chris Richardson7-Nov-02 7:08
Chris Richardson7-Nov-02 7:08 
GeneralRe: Resizing the desktop area Pin
Anonymous7-Nov-02 10:20
Anonymous7-Nov-02 10:20 
Generaldll Pin
7-Nov-02 3:59
suss7-Nov-02 3:59 
Hi,

I wanna load some overloeded function exported from a dll by using LoadLibrary and GetProcAddress.
This is the way the exported function is declared in the dll:
BOOL CDllClass::CoolFunction(const char* pszChar,DWORD dwProperty)
{
...
}

BOOL CDllClass::CoolFunction(LPCWSTR pszChar,DWORD dwProperty)
{
...
}

The CDllClass is exported with __declspec(dllexport)


I try to load CoolFunction in this way:
typedef BOOL (CALLBACK* LPFNFUNC)(const char*,DWORD);

...

HMODULE m_hDll = LoadLibrary("mydll.dll");
if (!m_hDll)
{
	AfxMessageBox("Error: Cannot find mydll.dll");
	return;
}

LPFNFUNC fnMyFunc = (LPFNFUNC)GetProcAddress(m_hDll,"CoolFunction");
if (fnMyFunc == NULL)
{
	AfxMessageBox("Error: fnMyFunc == NULL");
	return;
}


Problem: GetProcAddress returns NULL.

Question: How does GetProcAddress know which overloeded function to load? Is there some other problem in this code snippet?
Thanks

R.
GeneralRe: dll Pin
Anonymous7-Nov-02 4:38
Anonymous7-Nov-02 4:38 
GeneralRe: dll Pin
Stephane Rodriguez.7-Nov-02 4:57
Stephane Rodriguez.7-Nov-02 4:57 
Generalget default printer name Pin
vgkotha7-Nov-02 3:25
vgkotha7-Nov-02 3:25 
GeneralRe: get default printer name Pin
Navin7-Nov-02 3:51
Navin7-Nov-02 3:51 
GeneralRe: get default printer name Pin
Chad Koehler7-Nov-02 5:32
Chad Koehler7-Nov-02 5:32 
QuestionHow can I avoid a window get the focus ? Pin
Cris7-Nov-02 2:43
Cris7-Nov-02 2:43 
AnswerRe: How can I avoid a window get the focus ? Pin
includeh107-Nov-02 2:53
includeh107-Nov-02 2:53 
GeneralRe: How can I avoid a window get the focus ? Pin
Cris7-Nov-02 7:30
Cris7-Nov-02 7:30 
GeneralRe: How can I avoid a window get the focus ? Pin
includeh107-Nov-02 8:30
includeh107-Nov-02 8:30 
GeneralRe: How can I avoid a window get the focus ? Pin
Cris8-Nov-02 0:17
Cris8-Nov-02 0:17 
GeneralRe: How can I avoid a window get the focus ? Pin
includeh108-Nov-02 1:25
includeh108-Nov-02 1:25 
GeneralRe: How can I avoid a window get the focus ? Pin
Cris8-Nov-02 1:36
Cris8-Nov-02 1:36 
GeneralCListCtrl Oddity Pin
Richard Green7-Nov-02 2:02
Richard Green7-Nov-02 2:02 
GeneralLowLevelMouseProc Pin
Gleb7-Nov-02 0:58
Gleb7-Nov-02 0:58 
GeneralRe: LowLevelMouseProc Pin
Stephane Rodriguez.7-Nov-02 1:52
Stephane Rodriguez.7-Nov-02 1:52 
GeneralRegisterWindowMessage vs. WM_USER Pin
Alexinuk7-Nov-02 0:30
Alexinuk7-Nov-02 0:30 
GeneralRe: RegisterWindowMessage vs. WM_USER Pin
jhwurmbach7-Nov-02 1:21
jhwurmbach7-Nov-02 1:21 

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.