AnnAutomation Property Example for Visual J++
Note: This topic is for Document/Medical only.
This example shows how you can use the AnnAutomation property to access the automation object through DLL functions.
// Declare LEAD ltannU.DLL functions.
/** @dll.import("ltann14n") */
private static native int L_AnnGetFontBold( int hObject, boolean pfFontBold [] );
/** @dll.import("ltann14n") */
private static native int L_AnnSetFontBold( int hObject, boolean fFontBold, int uFlags );
private void button1_click(Object source, Event e)
{
int hAnnObject = LEAD1.getAnnAutomation();
// Set the default font to bold, unless it already is
boolean bIsBold[] = { false };
L_AnnGetFontBold( hAnnObject, bIsBold );
if( bIsBold[ 0 ] )
MessageBox.show( "Already bold", "Notice", MessageBox.OK ) ;
else
L_AnnSetFontBold( hAnnObject, true, 0 );
}