Skip to main content

Cancelling a native DLL called from managed code

  • January 16, 2015
  • 2 replies
  • 0 views

Hi,

My program, Visual Cobol managed code, calls an unmanaged DLL containing print routines using PrintEasy by Easirun. The call functions with no Problem, but, the Statement:

cancel "LSdruck" doesn't remove LSdruck.dll from Memory resulting in a blank page being printed first on next call. A log Shows "newInstance" in the dll is only established on first call.

Is there a method of removing the dll from Memory other than the - not working - cancel Statement?

2 replies

Stephen Gennard
Forum|alt.badge.img

Hi,

My program, Visual Cobol managed code, calls an unmanaged DLL containing print routines using PrintEasy by Easirun. The call functions with no Problem, but, the Statement:

cancel "LSdruck" doesn't remove LSdruck.dll from Memory resulting in a blank page being printed first on next call. A log Shows "newInstance" in the dll is only established on first call.

Is there a method of removing the dll from Memory other than the - not working - cancel Statement?

Sorry but the .Net framework/CLR does have a mechanism for unloading native DLLs, so the .net runtime has no way of removing it on a CANCEL time or at Stop Run time.


Chris Glazier
Forum|alt.badge.img+2

Hi,

My program, Visual Cobol managed code, calls an unmanaged DLL containing print routines using PrintEasy by Easirun. The call functions with no Problem, but, the Statement:

cancel "LSdruck" doesn't remove LSdruck.dll from Memory resulting in a blank page being printed first on next call. A log Shows "newInstance" in the dll is only established on first call.

Is there a method of removing the dll from Memory other than the - not working - cancel Statement?

Although you cannot cancel the program you should be able to specify IS INITIAL in the program-id of the unmanaged program and each time it is called it will be in its initial state if that is what you are looking for