How to use external dll in nav 2013?

arcullarcull Member Posts: 191
edited 2014-01-23 in NAV Three Tier
Hi there. I would like to know what are the options of using external dlls in from NAV 2013. I have 3 cases:
1) a single classic dll with public symbols exported
2) a classic dll with corespoding import library file
3) a dll which is a com object (the ones we registered as automations in previous versions of NAV)

So the question are:
1) Can I call a dll method via dotnet interop (s sample code would be very nice)?
2) If the dll has a method which shows some gui interface, how will this run on service tier? It should run on client somehow...

Much thanks for your help.

Comments

  • thegunzothegunzo Member Posts: 274
    Hi @arcull

    1. yes you can for example look here http://www.dynamics.is/?p=1297
    2. no, if the dll includes gui it must be used on pages and therefore is not available to the server http://www.dynamics.is/?p=1311
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • arcullarcull Member Posts: 191
    Thanks thegunzo, but if I'm not wrong the link for dll usage you provided, is using a dedicated add-in dll like http://msdn.microsoft.com/en-us/library/dd983804.aspx. Suppose I have a third party classical dll with public symbols exported, how do I use it? Much thanks again.
  • BloodsteelBloodsteel Member Posts: 1
    According to MSDN you can create and use any .dll file by either registering it as a Global Library or by just putting it in the installation folder of NAV.
    I've tried it myself and seems to be working (no SN signing needed or anything).

    Here is a detailed guideline on how to do this:
    MSDN .NET Guide
  • arcullarcull Member Posts: 191
    Thanks Bloodsteel, but this is again an example of .net dll usage. What if I have C++ standard library not dotnet based, how do I used it in NAV? Much thanks again.
  • nhsejthnhsejth Member, Microsoft Employee Posts: 34
    NAV does not support use of native dlls. You can use native COM objects on the client but it's strongly recommended to use managed code only. If you have an unmanaged dll, you can wrap this dll into a managed assembly using pinvoke and load the managed interface using the DotNet object type. Please notice that the use of unmanged dll's tends to add instability to the system and you can risk that your application will be unstable. External components using any kind of GUI are not supported on the server. If custom GUI is required, the interface should be implemented using the Client extensibility add-in system that ensures a proper UI interaction with the NAV client.
    _________________
    Niels-Henrik Sejthen
    Senior Software Developer
    Microsoft Dynamics NAV

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • arcullarcull Member Posts: 191
    Thanks nhsejth for clarifying this. So the only option that remains is to write a wrapper dll in dotnet for the native dll I have, but I can forget about displaying any gui :(
Sign In or Register to comment.