If your "function" is a method of a native C++ class in an external DLL,
then you can't call it directly.
One possible option is to create a managed wrapper class using VS2003's
Managed Extentions for C++ and populate the class with thunk methods that
invoke the associated native method(s).
Willy.
"Lance Johnson" <lj******@docs.com> wrote in message
news:O7**************@tk2msftngp13.phx.gbl...
Thanks for the reply. I believe this assumes it's just a regular
function.
However, the function in the external DLL is a member function. Is there
anything special I have to do for that to work because I'm not just
calling
a particular function but instead a function on an instance of some class.
Lance Johnson
"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl... you have to declare delegate
public delegate void TestCallback();
and pass it as a parameter to the function in DllImport.
[DllImport("Sample.dll")]
public static extern void SomeFunction(TestCallback callback);
--
Shak
(Houston)
"Lance Johnson" <lj******@docs.com> wrote in message
news:#O**************@tk2msftngp13.phx.gbl... > I'm using an external DLL that expects the address of a function for a
> callback. How can I go about getting the address of a function I have?
> Thanks for any help in this.
>
> Lance Johnson
>
>