Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass values to this method?

Tags:

c#

asp.net

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)

like image 844
Dolu bolu Avatar asked Nov 07 '22 04:11

Dolu bolu


1 Answers

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

This problem is a cryptic manifestation of a known issue with URLMON.dll. KB945701 - http://support.microsoft.com/default.aspx?scid=kb;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

https://forums.iis.net/t/1148764.aspx?Catastrophic+failure+Exception+from+HRESULT+0x8000FFFF+E_UNEXPECTED+

like image 83
Joey Phillips Avatar answered Nov 15 '22 10:11

Joey Phillips