国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

pb中使用winapi生成唯一的永不重復字符串(UUID)

2024-07-21 02:10:01
字體:
來源:轉載
供稿:網友

1、定義結構及外部函數

global type uuid from structure ulong  data1 uint  data2 uint  data3 character  data4[8]end type

function ulong uuidcreate(ref uuid lpuuid) library "rpcrt4"function ulong uuidtostring (ref uuid lpuuid, ref long lpuuidstring)  library "rpcrt4" alias for "uuidtostringa"function ulong rpcstringfree(long lpuuidstring) library "rpcrt4"  alias for "rpcstringfreea"

2、函數主體

constant long  rpc_s_ok = 0constant long  rpc_s_uuid_local_only = 1824

long ll_rtnuuid ull_rtn = uuidcreate(u)  //create a new uuidif ll_rtn = rpc_s_ok or ll_rtn = rpc_s_uuid_local_only then     long ll_pointer     string ls_uuid     ll_rtn = uuidtostring(u,ll_pointer)     ls_uuid = upper(string (ll_pointer,"address")) //convert it to a string

     rpcstringfree(ll_pointer)//remove the string from the memory     return ls_uuidelse     return ""end if

注:發布時候可能需要rpcrt4.dll



附:另外一種生成guid的方法

oleobject pbobjectstring ls_guidlong ll_result

pbobject = create oleobject

ll_result = pbobject.connecttonewobject &   ("powerbuilder.application")if ll_result < 0 then messagebox("","連接失敗:與powerbuilder.application連接出錯!") destroy pbobject   return ""else   ll_result = pbobject.generateguid(ref ls_guid)end ifdestroy pbobject

return mid(ls_guid,2,len(ls_guid) - 2)

第二種方法在程序發布時候需要在客戶端進行配置:

pbapl80.dllpbaen80.tlbrpcrt4.dll

修改注冊表如下

windows registry editor version 5.00

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; pbappl.reg;; registration information for powerbuilder.application.8;; all rights reserved.  no portion of this material may be copied in any way; without prior written consent from powersoft corporation.;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; version independent progid entries

[hkey_classes_root/powerbuilder.application]@="powerbuilder automation"

[hkey_classes_root/powerbuilder.application/clsid]@="{88880001-8888-1000-8000-080009ac61a9}"

[hkey_classes_root/powerbuilder.application/curver]@="powerbuilder.application.8"

[hkey_classes_root/powerbuilder.application/notinsertable]@=""

; version specific progid entries[hkey_classes_root/powerbuilder.application.8]@="powerbuilder 8.0 automation"

[hkey_classes_root/powerbuilder.application.8/clsid]@="{88880001-8888-1000-8000-080009ac61a9}"

[hkey_classes_root/powerbuilder.application.8/notinsertable]@=""

; clsid entries[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}]@="powerbuilder automation"

[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}/inprocserver32]@="d://program files/ ybase/ hared//powerbuilder//pbvm80.dll""threadingmodel"="apartment"

[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}/notinsertable]@=""

[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}/progid]@="powerbuilder.application.8"

[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}/programmable]@=""

[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}/typelib]@="{88880002-8888-1000-8000-080009ac61a9}"

[hkey_classes_root/clsid/{88880001-8888-1000-8000-080009ac61a9}/versionindependentprogid]@="powerbuilder.application"

; type library registration entries[hkey_classes_root/typelib/{88880002-8888-1000-8000-080009ac61a9}]

[hkey_classes_root/typelib/{88880002-8888-1000-8000-080009ac61a9}/1.0]@="powerbuilder automation type library"

[hkey_classes_root/typelib/{88880002-8888-1000-8000-080009ac61a9}/1.0/0]

[hkey_classes_root/typelib/{88880002-8888-1000-8000-080009ac61a9}/1.0/0/win32]@="d://program files/ ybase/ hared//powerbuilder//pbaen80.tlb"

[hkey_classes_root/typelib/{88880002-8888-1000-8000-080009ac61a9}/1.0/9]

[hkey_classes_root/typelib/{88880002-8888-1000-8000-080009ac61a9}/1.0/9/win32]@="d://program files/ ybase/ hared//powerbuilder//pbaen80.tlb"
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宝坻区| 汽车| 区。| 涞源县| 寿宁县| 凤冈县| 静海县| 德昌县| 信阳市| 余庆县| 南乐县| 自治县| 山西省| 宝山区| 云南省| 云霄县| 兴城市| 河池市| 搜索| 临泉县| 高邑县| 彭山县| 澳门| 全椒县| 宣武区| 云龙县| 万荣县| 延安市| 哈密市| 丹寨县| 赤壁市| 陇南市| 美姑县| 武强县| 隆回县| 岗巴县| 浪卡子县| 乃东县| 博白县| 麟游县| 策勒县|