|
-------------------Configuration: exc1 - Win32 Debug--------------------
- e; d8 Q* f% nCompiling...) N( W" y( E) x5 _% I- d
app.cpp* x! ?6 p# E/ ~! i% M1 e; f+ ]4 {
Linking...% M8 w% Z+ J9 a" F2 E; J+ n
Creating library DebUG/exc1.lib and object Debug/exc1.exp& N+ A# ]0 f0 y- M* A
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library: N7 ~. q0 H1 G# D W) ~
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv& r' I$ l/ y3 ]* t
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
5 T( y1 ~. S9 a3 o+ w3 }; m5 l5 |' a: gnafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
! Q$ P% r9 E' o" @* `nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
1 g8 W2 Q$ |+ Z8 G1 v4 T: W* qnafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
7 R$ J9 V9 @: l7 r: k& o2 ^Debug/exc1.dll : fatal error LNK1120: 3 unresolved externals
1 L. h# m/ f$ _! j0 s0 O执行 link.exe 时出错.: H* Z- c. o* K. b
* |/ a% r8 K, Q' I, y6 l, X, ^
exc1.dll - 1 error(s), 0 warning(s)+ p2 S! \; K2 s/ K
& r2 U4 t% F& w& ?/ r
( G& `4 x% }: `9 y& a7 x; Y原例子程序:" w4 D. O. o5 o2 m4 H- s1 q! L
file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image002.jpgMain.h文件中放置了应用文件所需的头文件、宏定义、函数与结构声明等。用户应用文件只需包含文件Main.h,就能够包含需要的所有资源。Main.cpp文件中放置工程出口(User Exit)函数,并在该函数中注册一个应用。通常情况下,User Exit函数中不含有详细代码。
+ v4 [- {% c+ P/ Q; f4 ~: j$ wfile:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image004.jpg在Main.h中添加以下代码:#ifndef MAIN_H_INCLUDED#define MAIN_H_INCLUDED #include <uf.h>#include <uf_cfi.h>#include <uf_defs.h>#include <uf_exit.h>#include <uf_mb.h> #include <uf_styler.h>#include <uf_ui.h>#include <uf_assem.h>#include <uf_attr.h>#include <uf_layer.h>#include <uf_object_types.h>#include <uf_modl.h>#include <uf_disp.h>#include <uf_sket.h>#include <uf_facet.h>#include <uf_draw.h>#include <uf_part.h>#include <uf_obj.h>#include "Resource.h" #include "Application.h"//声明一个激活应用的列表结构static UF_MB_action_t act_table[] = { {"Test", [url=]NULL,[/url][微软用户1] Test, NULL }, {NULL, NULL, NULL[url=], 0[/url][微软用户2] }/* This is a NULL terminated list */};#endiffile:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image006.jpg在Main.cpp中添加如下代码:#include "stdafx.h"#include "Main.h"extern "C" DllExport void ufsta (char*param, int *retcode, int rlen){//注册菜单按钮 AFX_MANAGE_STATE(AfxgetStaticModuleState); //防止全局变量不同步而可能导致的编译出错 int error_code; if ((UF_initialize()) != 0) return; if ( (error_code = UF_MB_add _actions (act_table) )!= 0 )//注册UG应用 { charfail_message[133]=""; UF_get_fail_message(error_code, fail_message); AfxMessageBox(fail_message); } UF_terminate(); return;}file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image008.jpg在Application.h中添加如下代码,用来声明应用函数Test:UF_MB_cb_status_t Test(UF_MB_widget_t widget,UF_MB_data_t client_data, UF_MB_activated_button_p_t button);file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image010.jpg在Application.cpp中添加如下代码,实现应用函数Test:#include "stdafx.h"#include "Main.h" UF_MB_cb_status_t Test(UF_MB_widget_t widget,UF_MB_data_t client_data, UF_MB_activated_button_p_t button){/*Make sure User Function is available*/if(UF_initialize()!=0) return(UF_MB_CB_CONTINUE);uc1601("hello world",1);UF_terminate();return(UF_MB_CB_CONTINUE);}
* l$ f5 Y# a3 C7 j8 g9 e0 u
4 X( F5 j& P" M) h/ T0 F, c; w2 K( J4 X# K5 U
4 A$ u0 G3 U0 i
7 J5 A5 C5 h; q6 F
g `2 [% E2 T: `/ y7 s3 t$ Y q
* m m3 I2 E5 c0 _( v5 Y- y0 N: I( a
$ e6 g+ G ~; r% U2 @9 y, W
* w/ X! C3 |7 q! _8 b! w: ~. t, `( J2 ^! T9 f2 q5 ~/ j
|
|