I am trying to make a basic program that un-registers then re-registers every DLL or OCX in a path provided. So far everything is working great, except when the program encounters a DLL that does not except the DllUnregisterServer or DllRegisterServer entry points. When my tool encounters such a DLL I get the following error.
"The program can't start because somefile.dll is missing from your computer. Try reinstalling the program to fix the problem."
Of course the file is not missing, or it would not have attempted to register it, so I tried registering it manually with RegSvr32 and got the following message.
"The module C:\MyPath\somefile.dll was loaded but the entry-point DllRegisterServer was not found.
Make sure that C:\MyPath\somefile.dll is a valid dll or ocx file and then try again."
So it would seem the issue is simply with that DLL, but I need some way to prevent the popup from with AutoIT. I have read various sections about error handling, but I am simply not understanding how to implement it.
The following is the portion of code that is giving the error, but it is simply a system error and the AutoIT script does in fact continue running. But this needs to run silently on a lot of users machines. A list of files is stored in the variable "$FilesToRegister"
For $i = 1 to $FilesToRegister[0] $aCall = DllCall($RegisterPath & $FilesToRegister[$i], "long", "DllUnregisterServer") If IsArray($aCall) = 1 Then $Msg = $aCall[0] If IsArray($aCall) = 0 Then $Msg = $aCall If @error Or $Msg <> 0 Then WriteLog(1,"UnReg FAILED " & @TAB & $Msg & @TAB & $RegisterPath & $FilesToRegister[$i]) Else WriteLog(1,"UnReg SUCCESS" & @TAB & "-0000000000" & @TAB & $RegisterPath & $FilesToRegister[$i]) EndIf Next






