Romeo,
Please include the code that I posted here inside #pragma BEGINDUMP ... ENDDUMP
Romeo,
Please include the code that I posted here inside #pragma BEGINDUMP ... ENDDUMP
Antonio,
Do you know if you can call a harbour DLL from a C# .Net exe ? If so can you provide an example?
Antonio,
I'm not sure that I have the Harbour DLL setup properly. I receive the following error
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in WindowsFormsApplication1.exe
Additional information: Unable to find an entry point named 'OneParam' in DLL 'Mydll.dll'.
This is the code we are using for the DLL
// Build a DLL from this code using: buildhd.bat mydll
// Please review TESTMYDL.prg to see how to use this DLL.
//----------------------------------------------------------------------------//
function Main()
MsgInfo( "Inside DLL main()" )
return nil
//----------------------------------------------------------------------------//
function OneParam( x )
MsgInfo( x )
return nil
//----------------------------------------------------------------------------//
__declspec( dllexport ) LONG pascal DOPROC( char * cProcName, char * cParam )
{
PHB_ITEM pItem = hb_itemPutC( NULL, cParam );
if( cProcName )
{
hb_itemDoC( cProcName, 1, ( PHB_ITEM ) pItem, 0 );
hb_itemRelease( pItem );
}
else
MessageBox( 0, "inside the DLL", "DOPROC", 0 );
return 0;
}
BOOL WINAPI DllEntryPoint( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
HB_SYMBOL_UNUSED( hinstDLL );
HB_SYMBOL_UNUSED( fdwReason );
HB_SYMBOL_UNUSED( lpvReserved );
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
MessageBox( 0, "DLL properly loaded", "DLL entry", 0 );
hb_vmInit( 0 );
break;
case DLL_PROCESS_DETACH:
MessageBox( 0, "DLL unloaded", "DLL exit", 0 );
break;
}
return TRUE;
}
//----------------------------------------------------------------------------//
You are not exporting OneParam() from the DLL so you can not call OneParam() directly from your EXE.
You have to call DOPROC() from your EXE, as it is the exported function of the DLL
NO more help ?
Hi dear Perry Nichols,
please can you kindly send me at romeox@tiscali.it those files:
MYDLL.PRG
TESTMYDLL.PRG
BUILDHD.BAT
I wrong samethins in my files, and it doesnot work !
FWH 16.02
many thanks
OK, i retrive my error.
it works now !
tks
very good ![]()