[ruby-list:48827] UNLHA32の「Unlha」が見つからない

From: 染谷 康一 <kouichi_someya@...>
Date: 2012-07-11 06:49:39 UTC
List: ruby-list #48827
失礼します。
染谷と申します。

DLライブラリでUNLHA32のUNLHAを使おうとしましたが、以下のエラーで使うことができ
ません。

RuntimeError: can't find the symbol `lha'

以下のコードファイルを読み込んだ時に上記メッセージが表示されました。

(ここから)======================================================
#=============================================================================
=#
#== UNLHA32.dll を利用するためのリッピング・モジュール
#=============================================================================
=#
require 'dl'
require 'dl/import'

module UnLha32Lib
    extend DL::Importable

    #=========================================================================
=#
    #== ライブラリの読込み
    #=========================================================================
=#
    dlload 'unlha32.dll'

    #=========================================================================
=#
    #== DLLをロードし、API関数オブジェクトを呼出す
    #=========================================================================
=#
    extern "int Unlha(HWND, LPCSTR, LPSTR, const DWORD)"
end

module UnLha32Lib
    class << self

        def decompress(arcfname, dirflg = false)
            dirpath = File.join(".", File.basename(arcfname, ".lzh"))
            dirpath.gsub!("/", "\\")

            if dirflg == true then
                unless File.directory?(dirpath) then
                    fileutils.mkdir(dirpath)
                end
            end

            lhaparam = "e #{arcfname} -x1a1 -c #{dirpath}\\"
            result = Unlha(nil, lhaparam, nil, 0)
        end

    end
end
(ここまで)======================================================

コーディングが間違っているのか、またはDLLライブラリの指定が誤っているのか
分かりません。

大変申し訳ございませんが、ご教示願います。

以上


In This Thread

Prev Next