アプリ版:「スタンプのみでお礼する」機能のリリースについて

自分で作った dllを VBのソースで登録する方法があったら教えてください。

A 回答 (1件)

全くの未検証です。



ぼくは自分のPCの送るに二つのショートカット
C:\WINNT\System32\RegSvr32.exe
C:\WINNT\System32\RegSvr32.exe /u
を用意していて、エクスプローラで登録/解除したいDLLのファイルパスをパラメータに送っています。

ちょっとわけあって、今は実験できないPCでコードを組みましたので、サンプルは実行を一度もしてません。
でも、たぶんこんな感じではないかな?

Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long

sub test
  Dim lngRet As Long
  Dim strBuff As String * 260
  Dim strPath As String
  Dim strRegExe  As String
  
  'システムディレクトリを得る
  lngRet = GetSystemDirectory(strBuff, Len(strBuff))
  strPath = Left(strBuff, InStr(strBuff, vbNullChar) - 1)
  
  '登録の時
  strRegExe = strPath & "\RegSvr32.exe " & "DLLファイルパス"
  '解除の時
  strRegExe = strPath & "\RegSvr32.exe /u " & "DLLファイルパス"
  
  '実行
  Call Shell(strRegExe)
end sub
    • good
    • 0
この回答へのお礼

ありがとうございます!!!

お礼日時:2002/03/08 11:08

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!