How to pass values to this method?


I have an dll in that class the following method

 [MethodImpl(MethodImplOptions.PreserveSig | MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
    bool SetIPAddress([MarshalAs(UnmanagedType.BStr)] ref string lpszIPAddress, int dwPortNumber, int dwPassWord);

How do I pass values to this method:

public FP_CLOCKLib._DFP_CLOCK   ff = new FP_CLOCKLib.FP_CLOCK();

reffered to create instance like "Catastrophic failure" when accessing an OCX library from C#

bool status = ff.SetIPAddress(ref ip, 5005, 0);

it threw error

System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at FP_CLOCKLib.FP_CLOCKClass.SetIPAddress(String& lpszIPAddress, Int32 dwPortNumber, Int32 dwPassWord)

asked on Stack Overflow Jul 14, 2018 by Dolu bolu • edited Jul 14, 2018 by Dima Kozhevin

1 Answer


This could be your issue, the following steps could help.

This problem is a cryptic manifestation of a known issue with URLMON.dll. KB945701 -;EN-US;945701

We performed the following fix which resolved the issue:

  1. Click Start
  2. click Run
  3. type regedit
  4. then click OK
  5. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701

Note If the FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 subkey does not exist, you must manually create it

  1. Right-click FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 , point to New, and then click DWORD Value
  2. Type w3wp.exe to name the new registry entry
  3. then press ENTER
  4. Right-click w3wp.exe
  5. then click Modify
  6. In the Value data box
  7. type 1
  8. then click OK
  9. Exit Registry Editor.
  10. Restart the system

answered on Stack Overflow Mar 20, 2019 by Joey Phillips • edited Mar 20, 2019 by Joey Phillips

User contributions licensed under CC BY-SA 3.0