按键盘兄的提示,我试了一下,可是一直编译不过,
#define ymh_CB_COUNT ( 7 + 1 ) /* Add 1 for the terminator */
/*--------------------------------------------------------------------------
The following structure defines the callback entries used by the
styler file. This structure MUST be passed into the user function,
UF_STYLER_create_dialog along with ymh_CB_COUNT.
--------------------------------------------------------------------------*/
static UF_STYLER_callback_info_t ymh_cbs[ ymh_CB_COUNT] =
{
{UF_STYLER_DIALOG_INDEX, UF_STYLER_OK_CB , 1, ymh_ok_cb},
{UF_STYLER_DIALOG_INDEX, UF_STYLER_APPLY_CB , 0,
ymh_apply_cb},
{UF_STYLER_DIALOG_INDEX, UF_STYLER_CANCEL_CB , 0, ymh_cancle_cb},
{ymh_RADIO_0 , UF_STYLER_VALUE_CHANGED_CB, 0, ymh_danwei_cb},
{ymh_LIST_2 , UF_STYLER_ACTIVATE_CB , 1, ymh_tuzhguige_cb},
{ymh_ACTION_7 , UF_STYLER_ACTIVATE_CB , 1, ymh_action_7_act_cb},
{ymh_ACTION_8 , UF_STYLER_ACTIVATE_CB , 1, ymh_action_8_act_cb},
{UF_STYLER_NULL_OBJECT, UF_STYLER_NO_CB, 0, 0 }
};
static UF_MB_styler_actions_t actions[] = {
{ "tuzhi.dlg", NULL, ymh_cbs, UF_MB_STYLER_IS_NOT_TOP },
{ NULL, NULL, NULL, 0 } /* This is a NULL terminated list */
};
void DisplayDialog()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CLibDialog dlg;
dlg.DoModal();
}
extern "C" DllExport void ufsta( char *param, int *returnCode, int rlen )
{
int errorCode=UF_initialize();
DisplayDialog ();
if ( 0 == errorCode )
{
errorCode = UF_terminate();
}
if ( (error_code = UF_MB_add_styler_actions ( actions ) ) != 0 )
{
char fail_message[133];
UF_get_fail_message(error_code, fail_message);
printf ( "%s\n", fail_message );
}
}
extern "C" void ufusr_cleanup(void)
{
}
extern "C" int ufusr_ask_unload( void )
{
return( UF_UNLOAD_UG_TERMINATE );
}
这段程序是添加在主程序里,可是编译后出现以下错误:
ompiling...
yagai.cpp
D:\ugkaifa\program\yagaicanshu\yagaitest\yagai.cpp(81) : error C2146: syntax error : missing ';' before identifier 'ymh_cbs'
D:\ugkaifa\program\yagaicanshu\yagaitest\yagai.cpp(81) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
tuzhi.dll - 2 error(s), 0 warning(s)
我一直找不错错误,肯请键盘兄再指教一下,能不能给个例子,很急,谢谢!
ymhai@126.com |