// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird [assembly: Guid("9E18ABD1-02A4-4c9d-8F00-A51EA55F601B")]
using System; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Data; using System.Text; using System.Runtime.InteropServices; using System.Diagnostics; namespace CatWeazelLIBNet { [GuidAttribute("C0BEE88F-01EC-4755-8B0A-A20E0563428A")] public interface ICatWeazel { [DispIdAttribute(1)] void Aboutbox(); [DispIdAttribute(2)] .... } [Guid("FD01AC61-673B-400a-BF2B-DF9E6EDCE421")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] public interface ICatWeazelEvents { [DispIdAttribute(20)] void iDBOperation(int Operation, int DBType, string TableName, string FieldList, string WhereStr, ref int Status); ..... } [GuidAttribute("38345F3F-ADDE-4089-B868-551EA7937528")] [ClassInterface(ClassInterfaceType.None)] [ComSourceInterfaces(typeof(ICatWeazelEvents))] public class CatWeazelNET : ICatWeazel { .... public iDBOperationEvent iDBOperation; public iDBRequestValueEvent iDBRequestValue; public iGetErrorTextEvent iGetErrorText; public UserEventEvent UserEvent; } [ComVisible(false)] public delegate void iDBOperationEvent(int Operation, int DBType, string TableName, string FieldList, string WhereStr, ref int Status); public delegate void iDBRequestValueEvent(int Operation, string Value, ref int Status); public delegate void iGetErrorTextEvent(int Func, ref string ErrText); public delegate void UserEventEvent(string Name, string Par1, string Par2, string Par3); }
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The Variable Logik is defined as automation server (global).
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Is the error in this Create line or on some other line?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
in Nav 5 the error occurs when I save the CodeUnit (and compile).
In Nav 2009 the error occurs, as soon as I want to run the CodeUnit.
No matter If the Create("Logik"); Line exists or not.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Have you signed the control and used the /codebase /tlb switches?
Epimatic Corp.
http://www.epimatic.com
regasm <DLL> /tlb
The control is signed and codebase says its only working for exes.
Here's a few other links that I used when making my wrapper class that helped me:
https://blogs.msdn.com/freddyk/archive/2008/11/09/edit-in-excel-part-4-out-of-4.aspx
http://www.codeguru.com/csharp/csharp/cs_misc/com/article.php/c9065/
http://msdn.microsoft.com/en-us/library/57kx88c8(VS.71).aspx
http://msdn.microsoft.com/en-us/library/2044hysa(VS.71).aspx
Epimatic Corp.
http://www.epimatic.com
and the only difference I see is:
InterfaceType(ComInterfaceType.InterfaceIsDual)] <- this lines.
For what are they?
What do they do?
As you can see I use different GUids for the interface and the class itself, I read somewhere on the internet that I shouldn't use InterfaceIsDual, but what it is, no one can tell.
Something which maybe interesting.
If I re-register (deregister, and register new) the part of the messagebox in Nav 09 beginning with 1.0 changes.
It seems that somehow another GUid is registered.
What I don't understand, in the registry the first Guid (which I have given in source) exists, the other one, doesn't.
You may want to check out this link to see if it can describe a few of the things going on: http://www.simple-talk.com/dotnet/visual-studio/build-and-deploy-a-.net-com-assembly/
Epimatic Corp.
http://www.epimatic.com