Hi Przemyslaw,

Yes I did put a call to hb_vmInit( FALSE ); in my code and it was enough.

I'll add you code, though, and I fully second your idea to have an include
which has all the needed code to start-up the hvm.

Thanks a lot.

Maurilio.

Przemysław Czerpak wrote:
> On Wed, 10 Mar 2010, Maurilio Longo wrote:
> 
> Hi,
> 
>> it does not work :(
>> Question: do I have to startup the HVM or does it start up by itself as soon
>> as the .dll is loaded?
> 
> You haven't added any code to initialize HVM after loading DLL file.
> You are creating DLL which uses its own HVM and you have to initialize it.
> For single thread support it's quite simple and the code below should be
> enough. I haven't tested it.
> 
> best regards,
> Przemek
> 
> 
>    #include "hbvm.h"
>    #include <windows.h>
> 
>    extern void hb_winmainArgInit( HANDLE hInstance, HANDLE hPrevInstance, int 
> iCmdShow );
> 
>    #if defined( HB_OS_WIN_CE ) && ( defined( _MSC_VER ) || defined( __POCC__ 
> ) )
>    BOOL WINAPI HB_DLL_ENTRY_POINT( HANDLE hInstance, DWORD dwReason, PVOID 
> pvReserved )
>    #else
>    BOOL WINAPI HB_DLL_ENTRY_POINT( HINSTANCE hInstance, DWORD dwReason, PVOID 
> pvReserved )
>    #endif
>    {
>       hb_winmainArgInit( hInstance, 0, 0 );
>       HB_SYMBOL_UNUSED( pvReserved );
> 
>       switch( fdwReason )
>       {
>          case DLL_PROCESS_ATTACH:
>             hb_vmInit( HB_FALSE );
>             break;
>          case DLL_PROCESS_DETACH:
>             hb_vmQuit();
>             break;
>       }
>       return TRUE;
>    }
> 
>    #if defined( __DMC__ ) || defined( __WATCOMC__ )
>       HB_EXTERN_BEGIN
>       void hb_forceLinkMainWin( void ) {}
>       void hb_forceLinkMainStd( void ) {}
>       HB_EXTERN_END
>    #endif
> _______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour
> 

-- 
 __________
|  |  | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.


_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to