Dll created by C #. Program code below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EdmLib;
namespace SetInventarNumber_library
{
public class SetSerNo
{
private void IEdmAddin_GetAddInInfo(EdmLib.EdmAddInInfo poInfo, EdmLib.IEdmVault5 poVault, EdmLib.IEdmCmdMgr5 poCmdMgr)
{
poInfo.mbsAddInName = "My first add-in";
poInfo.mbsCompany = "My";
poInfo.mbsDescription = "This is a very nice add-in.";
poInfo.mlAddInVersion = 1;
poInfo.mlRequiredVersionMajor = 5;
poInfo.mlRequiredVersionMinor = 2;
poCmdMgr.AddCmd( 1, "My first menu command");
}
private void IEdmAddIn5_OnCmd(EdmLib.EdmCmd poCmd, EdmLib.EdmCmdData ppoData)
{
EdmVault5 Vault;
Vault = (EdmVault5)poCmd.mpoVault;
Vault.MsgBox(poCmd.mlParentWnd, "Hello World!");
string str = UpSreNo(Vault);
Vault.MsgBox(poCmd.mlParentWnd, str);
}
//************************************************************************************************//
private string UpSreNo(EdmVault5 Vault)
{
IEdmSerNoGen6 Generator = Vault.CreateUtility(EdmUtility.EdmUtil_SerNoGen);
string next_number = Generator.GenerateSerNo("Инвентарный номер подлинника");
return next_number;
}
}
}
when added to the Add - in an administrative tool gives an error:
Please select at least one dll, which implements the interface IEdmAddin5
Andrey,
There are 2 things to check in the assembly properties for this error, make sure your assembly is COM visible:
Then make sure you have chosen not to embed interop types and the interop is copied locally:
After you compile you should get 2 dll's, select both when you are installing the add-in.