How do I create a Dll receptor file

I have written several VB dll's that run successfully inside of another VB Program.  What I want to do is create a 'receptor' dll that resides outside of the 'Master' VB Program and send info from one of my dll's (call it dll_A) to this 'receptor' dll.  Then I want to acces this info from dll_B.  Again, both dll_A and dll_B are running inside of a VB application.  This receptor dll must run outside the VB application.  Can someone please provide me with all the coding of a 'blank_receptor' dll that will get me started on this.

Thank you,
spc909
   
spc909Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JIEXACommented:
It seems that the 'receptor' is not a DLL, but a separate process. Server. You can organize the connectivity as you wish (sockets, shared memory, COM) and the server startup as you wish.
0
spc909Author Commented:
no . . . I'm looking for a dll

as an example the Swiss Ephemeris dll allows input from a 'users' dll and gives information back.  This is exactly what I am looking for . . . except the external dll would actually store the info in a variable.  The use of the term 'receptor' is just a name I gave it.

Thanks,
spc909
0
JIEXACommented:
Do you mean that you have a "master" DLL and "plugins" for that master? The phrase: "resides outside of the 'Master' VB Program" confused me totally.
If you're talking about "plugins", you need to invent your own strategy and call convention between master and plugins for your data types. No less.

You can also add some protection (to limit plugin power to crash or remove every file you have).

(I'm not aware of Swiss Ephemeris.)
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

spc909Author Commented:
Well I don't know what a plugin is so I can only start again.

I use a program that runs in Windows {program A).  This program allows me to program my own VB code and complile them (assorted dll's a, b, c, d, etc.) and they run inside of program A.  My dlls a, b, c,d, cannot communicate with each running inside of A, however, they can communicate with a dll outside of A, for instance, swissEPH.dll, that resides in the Sys32 of SysWOW64 directory.

What I don't know how to do is create a stand alone dll to accept input from another dll as described above.

spc909
0
JIEXACommented:
First, "standalone DLL". DLL runs under the hood of executable.
Second, the communication. If 2 DLLs run under the hood of the same process, they can just call routines of each other, passing necessary structures that you define. Otherwise, if they run under separate processes, you need to define the type of protocol they use, and somehow to control the flows of both processes: if you send something from your DLL, say, via TCP socket to the second DLL, how exactly the second DLL knows about it...

Please, try to define what do you need without using the term "DLL", just in terms of "Windows process". (DLL is just a process component.)
0
spc909Author Commented:
Thank you JIEXA,

That gets to the crux of the matter.  I did not know that my dlls could just communicate directly with each other.  So the last question is this:

In the below code then, what is the alias in the 3 functions doing and is it necessary.  If it is not necessary, what would the alternative look like.  I have also provided the 4th function which returns requested info to my dll . . . in case that helps to clarify something.  I just want to know "Why" alias is used here and is there an alternative.  Just need to understand it.

Private Declare Function swe_calc _
                Lib "swedll32.dll" _
                Alias "_swe_calc@24" (ByVal tjd As Double, _
                                      ByVal ipl As Long, _
                                      ByVal iflag As Long, _
                                      ByRef x As Double, _
                                      ByVal serr As String) As Long    ' x must be first of six array elements
Private Declare Function swe_deltat _
                Lib "swedll32.dll" _
                Alias "_swe_deltat@8" (ByVal jd As Double) As Double
Private Declare Function swe_julday _
                Lib "swedll32.dll" _
                Alias "_swe_julday@24" (ByVal Year As Long, _
                                        ByVal Month As Long, _
                                        ByVal Day As Long, _
                                        ByVal hour As Double, _
                                        ByVal gregflg As Long) As Double

Public Function Planet_Distance(y As Long, _
                                m As Long, _
                                d As Long, _
                                h As Double, _
                                tz As Double, _
                                corSys As Integer, _
                                Planet As Long) As Double
    Dim jul_day_UT As Double, jul_day_ET As Double, x(6) As Double
    Dim i          As Long, iflag As Long, serr As String
    jul_day_UT = swe_julday(y, m, d, h, 1) + tz / 24#
    jul_day_ET = jul_day_UT + swe_deltat(jul_day_UT)
    If corSys = 1 Then
        iflag = SEFLG_EQUATORIAL + SEFLG_TRUEPOS
    Else
        iflag = SEFLG_HELCTR + SEFLG_TRUEPOS
    End If
    i = swe_calc(jul_day_ET, Planet, iflag, x(0), serr)
    Planet_Distance = x(2)
End Function

Thank you,
spc909
0
JIEXACommented:
The "alias" here is the "accessor" of a function that its body resides in the DLL in binary executable form. The function name *there* can be very different because of "mangling" or anyway, VB and C/C++ have different policies about function names.
So, for example,
   Private Declare Function swe_calc _
                Lib "swedll32.dll" _
                Alias "_swe_calc@24" (ByVal tjd As Double, _
                                      ByVal ipl As Long, _
                                      ByVal iflag As Long, _
                                      ByRef x As Double, _
                                      ByVal serr As String) As Long
defines VB function "swe_calc _" that is actually alias to a binary function that resides in "swedll32.dll", and its name there is "_swe_calc@24", and the parameters it gets, for example, if it's written in C, are "(double,long,long,double*,const char *)" (I'm not very aware of call convention in VB for C...)

Since in your "business logic" -- Planet_Distance -- you use all the 3 defined aliases, no alias is optional.
You can (if it's good for you, your mileage may vary) move the business logic -- Planet_Distance -- to DLL (same one used before, if you control its source code, or another one that will load old DLL and use the 3 functions from there). It's a matter of taste, bug fixing comfort, and probably performance (each VB call to alias has some overhead).

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.