Ok I have a Windows form which calls a DLL, both of which written by me.
I have a start form which is the main form which calls the DLL (frontend form).
The DLL processes data passed to it from the form and returns results.
I have a second form which is opened after the DLL is called, which shows the results passed back from the DLL (results form).
So I have a public function on the results form (although it doesn't actually do anything):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
public ref class Results : public System::Windows::Forms::Form
{
public:
Results(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
public:
void updateStatus(unsigned __int64 number, int field, char* status)
{
return;
}
| |
The function is defined in the dll header:
1 2 3 4 5
|
#ifdef EXPORTING_DLL
extern __declspec(dllexport) int startRecovery(int argc, char **argv, char* caseRoot, int(*updateStatus)(unsigned __int64 number, int field, char* status);
#else
extern __declspec(dllimport) int startRecovery(int argc, char **argv, char* caseRoot, int(*updateStatus)(unsigned __int64 number, int field, char* status));
#endif
| |
So in my frontend form I try to call the DLL:
startRecovery(8,arguments, path, *****);
My problem is where I have ****, I'm not sure how i reference the pointer for the updateStatus function.
Do I have to create an instance of the object (Resultsform ^frmRes = gcnew Resultsform)?
Either way I can't seem to figure how to pass the address for the function. Any ideas?