|
-------------------Configuration: exc1 - Win32 Debug--------------------8 W; z2 Q' N% Z
Compiling...9 N! Y. k8 D G2 o' q# I
app.cpp& M- L. i5 e# }! I0 g1 O0 o2 C
Linking...
1 e/ }4 j' @3 c# q0 q k3 o% F Creating library DebUG/exc1.lib and object Debug/exc1.exp, O" d( f) _8 W2 Y
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library( B) t6 T$ A! x; ]
nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
3 w: Z3 f* e U$ |' f. Ynafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc( `: ]& W3 w7 J* @
nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype/ ]5 q- x' A2 k3 J7 \8 A
nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
4 c7 l6 ^0 l6 C) s9 Anafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype' `" M5 `& u/ J; B8 b2 P5 w$ |; I
Debug/exc1.dll : fatal error LNK1120: 3 unresolved externals4 X4 `- G' S; |8 k5 s
执行 link.exe 时出错.
& T2 e. _8 C: k: D$ ^6 X* D q" I. L# W& l& M' I; R4 r# y: K0 L+ F
exc1.dll - 1 error(s), 0 warning(s)
0 i- B8 l' s& i! w* F2 D/ X8 H7 B5 n2 t/ e+ o* J- G/ r
7 f" }% G5 A8 O1 L
原例子程序:. E7 v/ a7 b8 r G& e5 m
file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image002.jpgMain.h文件中放置了应用文件所需的头文件、宏定义、函数与结构声明等。用户应用文件只需包含文件Main.h,就能够包含需要的所有资源。Main.cpp文件中放置工程出口(User Exit)函数,并在该函数中注册一个应用。通常情况下,User Exit函数中不含有详细代码。
8 `" g! ~( v7 z0 nfile:///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);} 6 t- `/ P! x: {7 g
5 N) S/ L4 Z1 U _; A4 v
* f4 B F" @# W$ o! |: ?4 y
* l; f2 U# D; b5 V
/ s3 H5 p; y" W, R
2 X) R) p. { H d! d R5 @
1 y' z3 A& ~; G5 P! F* T* `/ S, v+ g* m' r6 I7 G% }) d
6 W3 \9 L3 o6 j# r
2 {* u" {: s* e9 `3 ? |
|