亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

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

        字號:

        1、定義結(jié)構(gòu)及外部函數(shù)
            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、函數(shù)主體
            CONSTANT Long RPC_S_OK = 0
            CONSTANT Long RPC_S_UUID_LOCAL_ONLY = 1824
            Long ll_rtn
            uuid u
            ll_rtn = uuidcreate(u) //Create a new UUID
            IF 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_uuid
            ELSE
             RETURN ""
            END IF
            注:發(fā)布時候可能需要rpcrt4.dll
            附:另外一種生成guid的方法
            oleObject PBObject
            string ls_GUID
            long ll_result
            PBObject = CREATE oleObject
            ll_result = PBObject.ConnectToNewObject &
             ("PowerBuilder.Application")
            IF ll_result < 0 THEN
             messagebox("","連接失?。号cPowerBuilder.Application連接出錯!")
             Destroy PBObject
             return ""
            ELSE
             ll_result = PBObject.GenerateGUID(REF ls_GUID)
            END IF
            Destroy PBObject
            return Mid(ls_GUID,2,len(ls_GUID) - 2)