2017-03-22 7 views

答えて

0

?DLL_PATH_FROM_PROGID("s.b") 
FUNCTION DLL_PATH_FROM_PROGID(PAR_PROGID_STR) 
LOCAL L_WSSH_OBJ As wscript.Shell 
L_WSSH_OBJ = CreateObject("wscript.shell") 
LOCAL L_CLSID_STR 
L_CLSID_STR = CLSID_FROM_PROGID(PAR_PROGID_STR) 
L_PATH_TO_DLL_STR = L_WSSH_OBJ.RegRead("HKEY_CLASSES_ROOT\CLSID\" + L_CLSID_STR + "\InProcServer32\") 
L_ThreadingModel_STR = L_WSSH_OBJ.RegRead("HKEY_CLASSES_ROOT\CLSID\" + L_CLSID_STR + "\InProcServer32\ThreadingModel") 
RELEASE loWSH 
RETURN ALLTRIM(L_PATH_TO_DLL_STR) 
ENDFUNC 

&& ?CLSID_FROM_PROGID("s.b") 
FUNCTION CLSID_FROM_PROGID(PAR_PROGID_STR) 
*!* '--- Here's the registry path where we'll look up the CLSID which corresponds to the ProgID 
LOCAL L_CLSID_PATH_STR, L_CLSID_STR 
L_CLSID_PATH_STR = "HKEY_CLASSES_ROOT\" + PAR_PROGID_STR + "\CLSID\" 
*!* '--- Create a WScript.Shell object 
*!* Set oReg = WScript.CreateObject("WScript.Shell") 
LOCAL L_WSSH_OBJ As wscript.Shell 
L_WSSH_OBJ = CreateObject("wscript.shell") 
*!* '--- Read the CLSID from the registry 
*!* '--- If it doesn't exist, it will fail 
*!* On Error Resume Next 
*!* clsid = oReg.RegRead(clsidPath) 
L_CLSID_STR = ALLTRIM(L_WSSH_OBJ.RegRead(L_CLSID_PATH_STR)) 
&& : L_CLSID_STR = COMCLASSINFO(MyO,4) && after MyO=CreateObject("s.b") 
*!* If Err.Number <> 0 Then 
*!* WScript.Echo "Error: Cannot open registry for speficied ProgID." 
*!* WScript.Echo "Error: Please recheck your ProgID." 
*!* WScript.Quit 
*!* End If 
RELEASE L_WSSH_OBJ 
RETURN L_CLSID_STR 
ENDFUNC 
関連する問題