Invoking interface functions via custom COM dll

Hi All,

I have created a custom COM dll say “WMInterface.dll” in VC++ using ATL Project. It is a unmanaged dll that is dependent on N no. of third party dll’s both managed and unmanaged. The WMinterface.dll contains interface functions that act as wrapper to functions exported from third party dll.

I have written a codeunit in Dynamics NAV 5.0 containing some functions and automation server variables created for my COM dll. Each of these functions access the thrid party functions by calling the interface functions exposed by my COM dll.


Say WM is an automation variable for WMInterface.dll and lets say there is an interface function called Init() exposed by this COM dll. Assume that Init() wraps Initialize() function of third party dll then a statement such as


would call the Initialize() function of third party dll.

In order to make the above functionality work i am currently facing the restriction of copying my COM dll as well as all my third party dll’s on which COM depends to Client folder of NAV i.e. where finsql.exe resides. I have to register my COM dll from this path only.

Is there any way to avoid this restriction such that i do not have to copy my dll’s to Client folder?

I tried setting the path of my COM dll through environment variables to the path where my third party dll resides i.e. other than Client folder.

But this doesn’t work.

Any idea?

Please help.

Thanks in advance,

There is a little trick for deploying the DLLs to the client when they are needed from within NAV. See this post for details.

Thanks for your help.

The link you provided will solve my problem of installig COM dll “WMinterface.dll” at run time. However this is not exactly i am looking for. The point is that the COM dll is dependent on many other third party dll’s and i really do not want to install all these dll’s in Client folder.

The requirement is something like COM dll will reside in a program folder which will be created by installing third party application. It will also be registered from that folder only. So far its fine. I am facing problem in invoking the interface function of third party dll via COM since COM is dependent on it. I am able to resolve this problem by copying all dll’s (COM and its dependent) to Client folder only. This is something which i do not like and hence wish to resolve it.

Is that possible?