public static int OrthancPluginInitialize(ref OrthancPluginContext c) { TestPlugin.Context = c; IntPtr ptrPathApi = IntPtr.Zero; try { ptrPathApi = Marshal.StringToHGlobalAnsi("/hello"); Callbacks.OrthancPluginRestCallback callback = new PluginsCore.Callbacks.OrthancPluginRestCallback(Callback_OrthancPluginRestCallback); OrthancCPlugin.OrthancPluginRegisterRestCallback(ref TestPlugin.Context, ptrPathApi, callback); return 0; } catch (Exception ex) { Log.Message(ex.ToString()); OrthancCPlugin.OrthancPluginLogError(ref c, ex.ToString()); return -1; } finally { Marshal.FreeHGlobal(ptrPathApi); } }
public static int OrthancPluginInitialize(ref OrthancPluginContext c) { TestPlugin.Context = c; IntPtr ptrPathApi = IntPtr.Zero; try { ptrPathApi = Marshal.StringToHGlobalAnsi("/hello"); Callbacks.OrthancPluginRestCallback callback = new PluginsCore.Callbacks.OrthancPluginRestCallback(Callback_OrthancPluginRestCallback); OrthancCPlugin.OrthancPluginRegisterRestCallback(ref TestPlugin.Context, ptrPathApi, callback); return(0); } catch (Exception ex) { Log.Message(ex.ToString()); OrthancCPlugin.OrthancPluginLogError(ref c, ex.ToString()); return(-1); } finally { Marshal.FreeHGlobal(ptrPathApi); } }