Click here to Skip to main content
15,921,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Templates Pin
Michael Dunn9-Jan-03 19:51
sitebuilderMichael Dunn9-Jan-03 19:51 
GeneralRe: Templates Pin
Stan the man10-Jan-03 2:57
Stan the man10-Jan-03 2:57 
GeneralRe: Templates Pin
Michael Dunn10-Jan-03 7:08
sitebuilderMichael Dunn10-Jan-03 7:08 
GeneralRe: Templates Pin
Dave Bryant12-Jan-03 7:31
Dave Bryant12-Jan-03 7:31 
GeneralRe: Templates Pin
Vicar29-Jan-03 19:24
Vicar29-Jan-03 19:24 
QuestionCheck visibility of a child control? Pin
Moak9-Jan-03 15:32
Moak9-Jan-03 15:32 
AnswerRe: Check visibility of a child control? Pin
Moak10-Jan-03 6:43
Moak10-Jan-03 6:43 
GeneralI am in DLL Hell.. :( Pin
VanHlebar9-Jan-03 14:43
VanHlebar9-Jan-03 14:43 
Ok.. I dug out one of my old VC++ books Inside Visual C++ Version 4. I read the section on dlls after post many questions here and I still can't seem to get a pointer to my function. Following is the code I am using if anyone has any ideas it would be appreciated.

Thanks,
-Eric

Created this dll using the dllWizard as a shared MFC regular dll.<br />
This is the only exported function in the dll.<br />
__declspec(dllexport) CString SndMessage(CString strInMessage)<br />
{<br />
	CString strOutMessage = _T("Inside TestDll.dll->SndMessage() ");<br />
<br />
	strOutMessage += strInMessage;<br />
<br />
	return strOutMessage;<br />
}<br />
<br />
//This is the relevant code from the Dialog application to test it.<br />
This is in the Dialog header file as public.<br />
typedef CString (SNDMESSAGE)(CString);<br />
HINSTANCE hDllHandle;<br />
SNDMESSAGE *fpFunction;<br />
<br />
Inside my OnInitdialog().<br />
// TODO: Add extra initialization here<br />
hDllHandle = ::LoadLibrary(_T("TestDll.dll"));<br />
if(hDllHandle == NULL)<br />
    MessageBox(_T("Error loading TestDll.dll"));<br />
else<br />
{<br />
    fpFunction = (SNDMESSAGE *)::GetProcAddress((HMODULE)hDllHandle, "SndMessage");<br />
<br />
    if(fpFunction == NULL)<br />
    {<br />
	MessageBox(_T("Error obtaining address of SndMessage() in TestDll.dll"));<br />
	PostMessage(WM_QUIT);<br />
    }<br />
}<br />
<br />
void CTestingDllDlg::OnButtonTest() <br />
{<br />
	// TODO: Add your control notification handler code here<br />
	UpdateData(TRUE);<br />
<br />
	m_strOutText = (*fpFunction)(m_strInText);<br />
<br />
	UpdateData(FALSE);<br />
}<br />
<br />

GeneralRe: I am in DLL Hell.. :( Pin
Rick York9-Jan-03 15:15
mveRick York9-Jan-03 15:15 
GeneralRe: I am in DLL Hell.. :( Pin
VanHlebar9-Jan-03 16:43
VanHlebar9-Jan-03 16:43 
GeneralRe: I am in DLL Hell.. :( Pin
Chris Richardson9-Jan-03 17:57
Chris Richardson9-Jan-03 17:57 
GeneralRe: I am in DLL Hell.. :( Pin
Rickard Andersson209-Jan-03 21:45
Rickard Andersson209-Jan-03 21:45 
GeneralRe: I am in DLL Hell.. :( Pin
Rick York10-Jan-03 5:41
mveRick York10-Jan-03 5:41 
QuestionWhat is OLE object? Pin
E_LISE_LI9-Jan-03 14:10
E_LISE_LI9-Jan-03 14:10 
AnswerRe: What is OLE object? Pin
Michael Dunn9-Jan-03 14:30
sitebuilderMichael Dunn9-Jan-03 14:30 
Generalrepost Numbers won't display in HEX when using string class Pin
Perseus9-Jan-03 13:07
Perseus9-Jan-03 13:07 
GeneralRe: repost Numbers won't display in HEX when using string class Pin
Michael Dunn9-Jan-03 14:32
sitebuilderMichael Dunn9-Jan-03 14:32 
GeneralRe: repost Numbers won't display in HEX when using string class Pin
Perseus9-Jan-03 14:41
Perseus9-Jan-03 14:41 
GeneralResource for resources Pin
Aaron Schaefer9-Jan-03 12:09
Aaron Schaefer9-Jan-03 12:09 
GeneralRe: Resource for resources Pin
Taka Muraoka9-Jan-03 12:34
Taka Muraoka9-Jan-03 12:34 
GeneralRe: Resource for resources Pin
Aaron Schaefer9-Jan-03 12:35
Aaron Schaefer9-Jan-03 12:35 
GeneralSplash Screen, title and icon Pin
MemLeak9-Jan-03 10:59
MemLeak9-Jan-03 10:59 
GeneralRe: Splash Screen, title and icon Pin
super9-Jan-03 19:12
professionalsuper9-Jan-03 19:12 
QuestionMemory problems? or not? Pin
jimNLX9-Jan-03 10:30
jimNLX9-Jan-03 10:30 
AnswerRe: Memory problems? or not? Pin
Alvaro Mendez9-Jan-03 10:59
Alvaro Mendez9-Jan-03 10:59 

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.