Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Interaction between 2 programs ??

Posted on 2004-11-01
13
Medium Priority
?
172 Views
Last Modified: 2013-11-13
Hi Experts,

I have the following situation:

Program A will start program B, if I click a button Program B will do something, but also program A must get a value send by the button of program B.

If it is possible then I like have the posibility to start program B also form Program C or D.
In that case the information must be send to C or D instead of A.

Question:
1. Is it possible to let program B to findout by what program it was started, (or what the last active program or form within a program was).?
2. Is it possible to send information to this program to specific control or variable?

Thanks
Murph
0
Comment
Question by:theo kouwenhoven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
13 Comments
 
LVL 6

Expert Comment

by:Marv-in
ID: 12468764
all of this is posible, but what is the reason you need to split between different programs?
0
 
LVL 2

Expert Comment

by:koolnurd
ID: 12470040
Hi murphey2  

Why dont you use winsock and send a message to the programme B when you call it from A. this could have a specific no which recognise the source of the calling programme.

0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 12470557
Hi Marv-in,

I like to split up the program, because program B will be used in at least 3 other programs and maybe more programs in the future, but if there ia an other way........

About winsock.... yeah... don't know how to use that,
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.

 
LVL 5

Expert Comment

by:RogueSolutions
ID: 12470956
If program B is needed by other programs then you want to make it as an ActiveX DLL file.  Programs A, C, D, etc have a reference to B and can call it's methods, set properties, display forms, etc.
0
 
LVL 6

Expert Comment

by:Marv-in
ID: 12471695
if its across a network - winsock is the way to go
if its not then activex is the way to go

if you have a common database use it for passing information

you could also use command line parameters the shell function but thats a little sloppy and not as secure depending on what you are doing

0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 12473835
Sounds realy good !!!!


How can I create an ActiveX.DLL File from an application


0
 
LVL 5

Expert Comment

by:RogueSolutions
ID: 12474317

Is Program B already an application and do you have the source code for it?

0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 12476137
Yeah, Prog B is an application and Yeah I have the source code of it.

On this moment Application B is writing some stuf to a .txt file this file wat is read by Application A. This was not my idea,
it worked that way and because I have to write Prog C I like to change A and B to get a better interface.
0
 
LVL 5

Accepted Solution

by:
RogueSolutions earned 160 total points
ID: 12481310
In that case you have to open the VB project for program B and goto to the Project menu and select "Program B" properties at the bottom.

Switch the dropdown from Standard EXE to ActiveX DLL.

You'll now need to change the program's design so that it's features are 'exposed' as classes.  These classes are then what trigger the various functionality/forms/etc. that Program B needs to perform.

When you compile your new Prog B it will register itself (on your PC) and you can then create a Reference to it from Prog A, C, D, etc.

---

You'll need to go find help/books on how to create and work with DLL's.  Not something that can really be covered in detail here.
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 12481656
Sounds simple but.....

"features are 'exposed' as classes"

Can I find something on the web about that?

Regards,
Murph


0
 
LVL 5

Expert Comment

by:RogueSolutions
ID: 12481743

    "Can I find something on the web about that?"

The answer to that is always Yes!  

I don't have any handy links though, sorry.  
0
 
LVL 6

Assisted Solution

by:Marv-in
Marv-in earned 160 total points
ID: 12482022
You could take sort of a plugin aproach. In an activex dll you can have classes and forms. You only need one class defined as public [this is the one used to create the interface] and the rest can be private and interact witht the form.

Take a look at these 2 examples. They are very good templates to create a simple plugin interface

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=12319&lngWId=1
http://www.codeguru.com/vb/gen/vb_misc/plugins/article.php/c5605/
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 12486181
I looked to the two examples, but I don't understand a word from it !!!!!!

I will ask someone to solve thif for me, I don't have much time to finish this

Thanks I will split the points


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question