I am an experienced Navision programmer whereas my"normal windows" programming experience is lacking.
I am trying to register a dll. There is however an error saying the dll is "not a Com assembly". I do not understand this.
What will I need to do? A wrapper? How?
How can I tell if it is a valid Automation Server component?
There are DLLs (Dynamic Link Library) that you can register (Automations - COM/OLE) and those you can't. Nowadays one try to pogram DLLs with a defined interface and using Visual tools such as Visual Basic always produce a COM-Object.
What you need to do is (as you said) build a wrapper that link and make the functionality of the DLL public. You can build this wrapper in any programming language you want (except C/SIDE :?), and you can decide if you want the wrapper to be an OCX, COM-DLL (Automation) or perhaps EXE. Any of these three program types can easily be implemented in Navision.
Well, how can you tell if its a valid Automation object. Unfortunately its not written on it, but in it. I'd say that any DLL that can be registered is a valid object, can't really think of another way.
thank you very much.
If the dll I am trying to use does not register with RegSvr32 how do I reference this dll in the wrapper I am programming in e.g. Visual Studio .Net ?
"Expose project to COM".
This property is important for you. I think that is what you forgot to do. I don't know where you can find this setting but you could try right clicking on the project in the project explorer and choose 'properties'. Then you get quite allot of project settings and i think it has to be somewhere there.
I believe I know how to make the wrapper a com component as I think you suggest. My problem is the dll that I am trying to "wrap".
I am not able to use "Add Reference" to the project if the dll is not a com component.
Navision -> Wrapper -> notCom.dll
It is the reference from the wrapper to the notCom.dll that I am unable to figure out. The notCom.dll cannot be registered using RegSvr32.
thank you for your efforts
For API dll's it is important to know the interface of the DLL. You will need documentation for this DLL then, otherwise i think you are lost.
To declare a API function from a DLL in VB6 you should use (think .NET is almost simular):
Private Declare Sub <functionname> Lib "<dll path + name>" (<parameterlist>)
After doing this correct you should be able to call this function from your wrapper.
May i recomend you to visit this site:
There are a lot of .NET gurus there wich i think they can answer your question much better as it is not Navision related.
Thank you vey much. I think this was the hint I need to move along. Now I have something to go on. I know this is not Navision related and will search in other places for further info.
Thank you for the link.