C# version of the Archival Callback Handler

Problems with Archival Server

Re: C# version of the Archival Callback Handler

Postby admin » Thu Dec 11, 2014 12:16 am

Hi,
Does Archival Server UI configuration tool accept your component ProgID? If it does not there's a problem with component registration. The tool validates the component making sure it can create instance of it and checks if it exposes callback interface, such as IUArchivalNetworkNotifier.

After network event consumer ProgID is added into appropriate place in main Archival Server right pane, the Archival Server service needs to be restarted - File/Stop Archival Server, File/Start Archival Server. Sorry for not mentioning this in SDK docs.

Network event notifications occur when server connect or disconnect operation is completed (successfully or not).
admin
Site Admin
 
Posts: 935
Joined: Fri Aug 21, 2009 10:13 am

Re: C# version of the Archival Callback Handler

Postby ianjl » Wed Aug 08, 2018 10:51 am

[quote="admin"]Hi,
we've just created working C# callback COM object.
1. Make sure you use strong-named assembly. For this create a key pair that will be used to sign the .NET assembly with a strong name. ["sn -k key.snk" at the command prompt]. Add an assembly attribute to your object cs file. “[assembly:System.Reflection.AssemblyKeyFileAttribute(@"..\..\key.snk")]“
2. Generate a globally unique identifier for use with your callback COM object.
3. Use System.Runtime.InteropServices.GuidAttribute to generate an attribute for class COMObject, like this:
[GuidAttribute("165371DA-6089-4D61-89A2-D96A4CDB18AE")]
public class NetConsumer : UArchivalCallbacksLib.IUArchivalNetworkNotifier
4. Register the Assembly. ["regasm CSharpCOM.dll /tlb:CSharpCOM.tlb /codebase NetConsumer" at the command prompt, while in the directory that contains CSharpCOM.dll]. don't forget to use stong-name after /codebase.

In the example above COM object ProgID will be CSharpCOM.NetConsumer .

For those who are not able to add UArchivalCallbacks type library reference to your C# project make sure to first register UArchivalCallbacks.tlb file. We have utility for that if you need.[/quote]


Hi, I realise this thread is from a while back but I'm trying to make use of the C# callback COM object and I can't add the UArchivalCallbacks type library reference. You mention a utility above, could I possibly get a copy of that?

Thanks.
ianjl
 
Posts: 0
Joined: Mon Nov 20, 2017 11:38 am

Re: C# version of the Archival Callback Handler

Postby admin » Wed Aug 08, 2018 3:18 pm

Just use regtlibv12.exe that comes with .NET framework.
C:\Windows\Microsoft.NET\Framework\v4.0.30319/regtlibv12.exe

https://stackoverflow.com/questions/452 ... -windows-7
admin
Site Admin
 
Posts: 935
Joined: Fri Aug 21, 2009 10:13 am

Re: C# version of the Archival Callback Handler

Postby ianjl » Thu Aug 09, 2018 3:12 am

Thanks admin

I read that SO post yesterday but regtlibv12.exe wasn't installed on my machine so I moved on. Anyway, copied it from another PC and it al looks good now.
ianjl
 
Posts: 0
Joined: Mon Nov 20, 2017 11:38 am

Re: C# version of the Archival Callback Handler

Postby ianjl » Thu Aug 09, 2018 11:06 am

Hi admin

I got the COM object built and registered etc. but it's actually the IUArchivalRecordNotifier interface I am interested in.

So I have altered the NetConsumer class to implement the IUArchivalRecordNotifier interface and its methods. It builds and registers OK but when I start recording, I get the 'Class Not Registered' error and recording won't start.

I'm new to COM so apologies if I'm missing something really basic.
ianjl
 
Posts: 0
Joined: Mon Nov 20, 2017 11:38 am

Previous

Return to Archival Server

Who is online

Users browsing this forum: No registered users and 1 guest

cron