Didn't we have recently deleted maindll.c just for this purpose? Shouldn't we readd it with your additions below? We could even put it into a lib named 'maindll' to make it easy to use (if it works as a lib).
Brgds, Viktor On 2010 Mar 10, at 20:35, 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 _______________________________________________ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour