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

How to make a COMponent to allow other apps access to my app's functions

I have written a complete application in VB.Net.  Assuming I have a form: 'frmNewFolders' which contains a Function which creates 5 new folders in the directory named: strDirectoryLocation (a private variable declared in that form).  (The value of the 'strDirectoryLocation' string is set elsewhere within the application.)

How do I create a dll in order to access that form's 'CreateFolders' function?
Does the private variable strDirectoryLocation need to be declared as a Public variable before it will be accessible to other applications?
If someone has already installed my application, if I send them the necessary dll file what must they do to get the dll file to be recognised by their system/available to their other applications?
0
Sigh_Man
Asked:
Sigh_Man
1 Solution
 
Bob LearnedCommented:
1) If you have a public class in a DLL, then all members that you want to expose to the world must be Public to be accessible.

2) If someone gets your DLL, then all they need to do is have a reference to that project.

3) If you are creating reusable code in DLL's for other developers to use, then use attributes (and code comments where available) to help them.  An example of an attribute would be the Description

<Description("This method gets an array of files from the specified full path.")> _
Public Function GetFolders(ByVal path As String) As String()
End Sub

Bob
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.

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