M
MR
help!
I have an unmanaged DLL that I do not have the source code, so i can't
recompile or make changes. the DLL requires a callback function. I would
like to implement the callback method in a managed class. The unmanaged DLL
gets the address of the callback in a struct (someStruct below) that is
passed as a parameter. I can't seem to figure out how to pass the
"unmanaged" address of a managed method to be uses as a callback.
I would appreciate some guidance here
thanks very much
(i am using VS C++ 2005)
// Initialize the callback structure for the Speak&Find object
ref class managedClass
{
SOMESTRUCT someStruct;
someStruct.onResultCallback = &onResult; // HOW DO I ASSIGN THE ADDRESS of
onResult
UnmanagedDLL.Init(&someStruct);
void managedClass:nResult (int, char*, long) // callback for some
unmanaged DLL
{
// some code here
}
}
I have an unmanaged DLL that I do not have the source code, so i can't
recompile or make changes. the DLL requires a callback function. I would
like to implement the callback method in a managed class. The unmanaged DLL
gets the address of the callback in a struct (someStruct below) that is
passed as a parameter. I can't seem to figure out how to pass the
"unmanaged" address of a managed method to be uses as a callback.
I would appreciate some guidance here
thanks very much
(i am using VS C++ 2005)
// Initialize the callback structure for the Speak&Find object
ref class managedClass
{
SOMESTRUCT someStruct;
someStruct.onResultCallback = &onResult; // HOW DO I ASSIGN THE ADDRESS of
onResult
UnmanagedDLL.Init(&someStruct);
void managedClass:nResult (int, char*, long) // callback for some
unmanaged DLL
{
// some code here
}
}