• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

call to a DLL located on a server

hi
i have this function it uses the c++ dll sks.dll,
this dll is located on my machine, can i put this dll on a server someplace and let my vb.net application use this dll without having it on the local machine??
i mean only 1 dll and all the clients use it on the remote server where i have his IP or name... (it's a local network)


Private Declare Function GetCurrentRoundNumber Lib "sks.dll" () As Integer
0
mte01
Asked:
mte01
  • 4
  • 3
1 Solution
 
possekeCommented:
Hi,

I'm just guessing here but, if I recall thi sone correct, this may work:

Private Declare Function GetCurrentRoundNumber Lib "\\SERVERNAME\DLLFOLDER\sks.dll" () As Integer
OR
Private Declare Function GetCurrentRoundNumber Lib "\\192.168.1.X\DLLFOLDER\sks.dll" () As Integer

Don't shoot me for being wrong, but I seem to have done this once like this ?!

Just try it!!

Greets,

Po$$e
0
 
mte01Author Commented:
Bam Bam...
noooo I’m not shooting you, it's just that this works... but hummm anyone can now access the shared folder and steal my precious DLL, how can I prevent them from such hideous act??
i can't shoot them.. What else can i do? Can i pass credentials with the DLL path??
Cheers
0
 
possekeCommented:
I'll comment this asap, but i have to go for an hour now so be patient ;)

Po$$e
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
possekeCommented:
Hi mte01,

Preventing from other people accessing your shared folder, that is something done with permissions. (NTFS or share permissions)
I'm no expert in that subject, but if you share the folder that contains the DLL, you can also grant or deny access to different persons.

Since you're working on a local network, set-up for permissions should not be a hard job!

But I'm sorry, that is one thing I can't fully explain, I just know you have to put permissions on the shared folder!!

Greetz,

Po$$e
0
 
mte01Author Commented:
thanks posseke
got me in another problem...


Private Const dllLocatio As String = "sks.dll"
Private Declare Function StopIssue Lib dllLocatio () As Integer


this is not being compiled, it's giving an error on the variable dllLocatio, it says that string constant expected, any idea why and how to get rid of that...
what i am going to do is to place the name of the dll in one place so i dont have to change it every time in like 100 place..
0
 
possekeCommented:
Hi,

what about this:

I'm afraid that what you are trying to do is not valid...the compiler just won't buy that kinda trick :d
I have never done this like you are doing now, and I believe it is a bad practice too...

My suggestion to you is to manually alter it in the 100 places with the exact string of the DLL location, Copy-Paste is not so slow like you think :)

What else you could do is declare this function as public & shared in a new class.
This way, you only have to change the one class that contains the declaration, and import this class in every other one that needs to use this method...

Greets,

po$$e
0
 
mte01Author Commented:
ok thanks for the info.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now