vb.net equivalent of ActiveX?

R

Ron

Hello,

I need project2 to communicate with project1. I usd to do
this in VB6 where Project1 was an ActiveX app and Project2
was a regular exe.

Project1 runs 24/7. Project1 invokes project2 each day at
a specified time -say 4:00 am. Project2 pulls data from
various sources (takes about an hour). When project2 has
completed its tasks it will end itself. Before ending it
needs to pass information back to project1, results of
data pulls, how much data, etc. (Note: there is also a
project3 to be invoked simultaneously - I have spent
several weeks experimenting with multi-threading but
having too many problems).

So I know vaguely something about a class library project
(dll) where project1 could be a class library project with
a form and communicate with project2. Could someone tell
me/show me what/how is the best way for project2 to
communicate with project1? Similar to ActiveX project.

Thanks
 
S

Scott M.

You don't need something similar to ActiveX at all.

Each project will compile down to its own assembly. Depending on the
project type, you will get either a .dll (Class Library) or an .exe (Windows
Forms App / Console App).

Simply make a reference to the assembly that has the code you need to run
and your project will be able to make instances of the classes in that
assembly.
 
R

Ron

Thanks for your reply. Well, I tried creating another
simple exe project and tried to reference it in project1,
but got a message that only dll or com projects could be
referenced. So I created a simple class library project
with a form. Since I added a form to the class library
project I am getting an error when I try to run the
project. I tried setting the form as the startup object
but got the same error. Could you advise me how to
configure my class library project so I can run the form?
the form calls a simple public function in the class of
the class Library Do I need a sub Main and application.run
(myfrm)?

public class1
public function msg() as string
msg = "testing
End Function
End Class

Thanks,
Ron
 
S

Scott M.

That's correct, you can only reference a .dll, not an .exe. The application
that calls to another one should be the .exe. The classes that need to be
called should be in a .dll (class library project).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top