HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: How to create a CallBack.dll with Visual Basic
Author: Leto
Date: 08/29/2005 04:44
 
> 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" );
}
 
Reply Create subthread


All articles

Subject Author Date
How to create a CallBack.dll with Visual Basic

08/23/2005 20:31
Re: How to create a CallBack.dll with Visual Basic

08/24/2005 02:05
Re: How to create a CallBack.dll with Visual Basic

08/28/2005 20:46
Re: How to create a CallBack.dll with Visual Basic

08/29/2005 04:44
Re: How to create a CallBack.dll with Visual Basic

03/19/2007 09:51




f

Created with FORUM 2.0.11