| > I read it,But i can't use it. my api will point to
> which library. can u help me and explain me how to
> do.
> give me a simple example,i am sur that there is much
> like me.
> I just want to know when the mirror is finished,
> Please help me because itried several possibilities
> and no one worked!
I've never used c++ but I did a test in C# which was successful. This is not
a working code example but may give you an idea:
using System;
using System.Runtime.InteropServices;
//Callback delegate
public delegate int CallbackInt();
public delegate void CallbackVoid();
//Set up callbacks to HTTrack's non-COM DLL
const string sHttrackLib = "libhttrack.dll";
[DllImport(sHttrackLib, CallingConvention=CallingConvention.Cdecl)]
public static extern int hts_uninit();
htsCallBack = new CallbackVoid(httrack_wrapper_uninit);
returnVal = HttrackLib.htswrap_add( "free", htsCallBack );
OutputMessage( "Wrapper add: \"free\": " + returnVal.ToString() + "\n" );
CallbackInt htsCallBackInt = new CallbackInt(httrack_wrapper_end);
returnVal = HttrackLib.htswrap_add( "end", htsCallBackInt );
OutputMessage( "Wrapper add: \"end\": " + returnVal.ToString() + "\n" );
//The callback functions
//Two used when HTTrack finishes
public int httrack_wrapper_end()
{
OutputMessage( "End of mirror.\n" );
return 1;
}
public void httrack_wrapper_uninit()
{
OutputMessage( "wrapper_uninit: Engine exited.\n" );
}
| |