C
C
ColdSpirit2016-01-22 14:01:30
C++ / C#
ColdSpirit, 2016-01-22 14:01:30

How to make an exported dll function without a header a member of a class?

Good afternoon.
There is a certain dll without a header, I load it with the LoadLibrary method , then I want to load the exported function from it with the GetProcAddress method, let's say the function declaration
int add( int, int );
in it is: int add( int, int );without wrapping it, and I could use it as a regular function like this:
int summ = someclass->add(5,6);
I tried to do it myself, but I got confused in references and pointers, so far I use typedef , and the function is stored as a class member (void *) , and I can call it only after casting to FUNC_ADD .
#upd:
I had no idea about passing this as a parameter. In general, it seems strange that such a powerful language cannot pull off such a trick.
Thanks for the replies =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-01-22
@ColdSpirit

You have no understanding of how a method differs from a function. It
has 3 input parameters, and
only 2.
So nothing will come of it without wrapping.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question