Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ style casting [modified] Pin
Jörgen Sigvardsson17-Jul-06 15:13
Jörgen Sigvardsson17-Jul-06 15:13 
GeneralRe: C++ style casting Pin
Zac Howland17-Jul-06 16:12
Zac Howland17-Jul-06 16:12 
GeneralRe: C++ style casting Pin
Zac Howland17-Jul-06 9:46
Zac Howland17-Jul-06 9:46 
QuestionBackground color Pin
goodoljosh198017-Jul-06 5:06
goodoljosh198017-Jul-06 5:06 
AnswerRe: Background color Pin
SimonSays17-Jul-06 6:05
SimonSays17-Jul-06 6:05 
GeneralRe: Background color Pin
goodoljosh198017-Jul-06 9:14
goodoljosh198017-Jul-06 9:14 
AnswerRe: Background color Pin
Hamid_RT17-Jul-06 18:14
Hamid_RT17-Jul-06 18:14 
QuestionExporting function objects from DLL Pin
napoleaninlondon17-Jul-06 4:52
napoleaninlondon17-Jul-06 4:52 
In a file i have declared a function object.I am unable to access the function with the overloaded operator in the client side.
For example:
i have in my dll file


<br />
class try_func  <br />
{<br />
public:<br />
	try_func();<br />
	virtual ~try_func();<br />
<br />
	bool operator()(int value)const;<br />
<br />
};<br />
<br />
<br />
try_func::try_func()<br />
{<br />
<br />
}<br />
<br />
try_func::~try_func()<br />
{<br />
<br />
}<br />
<br />
bool try_func::operator()(int value)const<br />
{<br />
	if(value< 20)<br />
		return true;<br />
	else<br />
		return false;<br />
}<br />
<br />
<br />
try_func export_func;<br />


And then in the client side i have tried the following variations
<br />
#include<iostream.h><br />
#include<windows.h><br />
<br />
typedef VOID (CALLBACK* LPFNDLLFUNC1)(VOID);<br />
<br />
<br />
HINSTANCE hDLL;              <br />
LPFNDLLFUNC1 MyFunc1;    <br />
<br />
int main()<br />
{<br />
	<br />
	hDLL = LoadLibrary("C:\\my_func_obj_dll\\Debug\\my_func_obj_dll.dll");<br />
<br />
	if (hDLL != NULL)<br />
	{<br />
		MyFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,"export_func");<br />
		if (!MyFunc1)<br />
		{<br />
			//Show error message<br />
			FreeLibrary(hDLL);       <br />
			return false;<br />
		}<br />
		else<br />
		{<br />
			MyFunc1();<br />
		}<br />
	}<br />
<br />
	return true;<br />
}<br />
<br />


Am i missing something here?
AnswerRe: Exporting function objects from DLL Pin
Cedric Moonen17-Jul-06 4:57
Cedric Moonen17-Jul-06 4:57 
GeneralRe: Exporting function objects from DLL Pin
napoleaninlondon17-Jul-06 5:04
napoleaninlondon17-Jul-06 5:04 
GeneralRe: Exporting function objects from DLL Pin
Cedric Moonen17-Jul-06 5:10
Cedric Moonen17-Jul-06 5:10 
GeneralRe: Exporting function objects from DLL Pin
napoleaninlondon17-Jul-06 5:18
napoleaninlondon17-Jul-06 5:18 
GeneralOT Pin
Eytukan17-Jul-06 6:25
Eytukan17-Jul-06 6:25 
GeneralRe: OT Pin
Cedric Moonen17-Jul-06 6:32
Cedric Moonen17-Jul-06 6:32 
GeneralRe: OT Pin
Eytukan17-Jul-06 7:11
Eytukan17-Jul-06 7:11 
GeneralHello Pin
Hamid_RT17-Jul-06 7:58
Hamid_RT17-Jul-06 7:58 
QuestionCrash after sending custom message (only in release mode) Pin
Matthijs Wessels17-Jul-06 4:47
Matthijs Wessels17-Jul-06 4:47 
QuestionRe: Crash after sending custom message (only in release mode) Pin
David Crow17-Jul-06 4:52
David Crow17-Jul-06 4:52 
AnswerRe: Crash after sending custom message (only in release mode) [modified] Pin
Matthijs Wessels17-Jul-06 5:01
Matthijs Wessels17-Jul-06 5:01 
GeneralRe: Crash after sending custom message (only in release mode) Pin
David Crow17-Jul-06 5:11
David Crow17-Jul-06 5:11 
GeneralRe: Crash after sending custom message (only in release mode) Pin
Matthijs Wessels17-Jul-06 5:13
Matthijs Wessels17-Jul-06 5:13 
GeneralRe: Crash after sending custom message (only in release mode) Pin
David Crow17-Jul-06 5:23
David Crow17-Jul-06 5:23 
GeneralRe: Crash after sending custom message (only in release mode) Pin
Matthijs Wessels17-Jul-06 7:18
Matthijs Wessels17-Jul-06 7:18 
GeneralRe: Crash after sending custom message (only in release mode) Pin
Matthijs Wessels17-Jul-06 5:22
Matthijs Wessels17-Jul-06 5:22 
AnswerRe: Crash after sending custom message (only in release mode) Pin
Steve S17-Jul-06 4:54
Steve S17-Jul-06 4:54 

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.