Use external Dll in windows service.

Nagendra

New member
Joined
Apr 28, 2009
Messages
2
Programming Experience
1-3
Hello Everyone.
I am making use of a external dll in my vb.net program. When i run the program as a application, everything works fine. But when i use the same dll in windows service program, written in vb.net i get System.DllNotFound exception. The code to use the external dll is as follows:

Private Declare Function MyFunction Lib "MyDll" (ByVal param as Integer) As Integer

MyDll.dll is registered and is stored in the following path :
D:/Applic/NewApp

Could you please tell me the correct usage of external dll in windows service.

Thanking You.
 
"Registered"? That implies COM but you're not using a COM component. You're calling exported functions, in which case the DLL must be either in the same folder as the EXE or else in the system32 folder. It's obviously not in the system32 folder so is that folder you mention the one containing the EXE? I'm guessing not if it's a Windows Service, although I'm not 100% sure what the restrictions are on installing services.
 
Its Working.

Thank you for your suggestion. I shifted the dll to system32 folder and its working great. Thanks a lot......
 
Back
Top