943,929 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1366
  • C++ RSS
Feb 5th, 2007
0

Program Design

Expand Post »
Hello, I am learning the ropes here. I have a non-code question, strictly conceptual. How (generally speaking) do I design my project in Visual Studio C++ to acheive the flow in the block diagram, and specifically how do I access Var A and Var B from Main.cpp if they are all modularly constructed?

1. Main.cpp and programs 1 and 2 should start from a single executable and run by themselves endlessly until terminated

2. Main.cpp has to be able to access Var A and B (which are being constantly recalculated) on the fly.

I want to take advantage of parallel programaming for my project.

Thanks in advance,

M.
Attached Thumbnails
Click image for larger version

Name:	Schematic.JPG
Views:	21
Size:	42.7 KB
ID:	2790  
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
megabutt is offline Offline
18 posts
since Feb 2007
Feb 5th, 2007
0

Re: Program Design

Either output the variable contents into a text file for your program to read or use a Dll to share the variables.
Last edited by kenjutsuka; Feb 5th, 2007 at 8:25 pm.
Reputation Points: 22
Solved Threads: 1
Light Poster
kenjutsuka is offline Offline
45 posts
since Oct 2006
Feb 7th, 2007
0

Re: Program Design

Thanks for the reply:

In the first option, if the programs wrote to a text file would I have to have three seperate executables? Also, is writing to a text file a fast process (under a few milliseconds) or would it hamper speed?

In the second option, could the DLL(s) run all the time in parallel to my main.cpp program and could they be coded to constantly calculations, etc. ?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
megabutt is offline Offline
18 posts
since Feb 2007
Feb 7th, 2007
1

Re: Program Design

If you want to calculate a value and have it usable among many executables, you will need a Dll to do it within an expectable timeframe (of your mentioned milliseconds). It would be easiest to have all the important functions and variables located in the Dll to be called by your executables. Here is a good tutorial to creating a Dll that can be shared between different processes.

Here is a diagram...
http://img358.imageshack.us/img358/2...owchartyf3.png
Reputation Points: 22
Solved Threads: 1
Light Poster
kenjutsuka is offline Offline
45 posts
since Oct 2006
Feb 7th, 2007
0

Re: Program Design

Thanks for the effort in the reply - that really helps. To clarify what you are saying, I would need to wrtite 3 C++ progs and use a DLL to share their run time info about Var A and B. Is thgat correct so far?

If I have that clear, tell me how I would launch all three from a single executable. I don't want the end user to have to start multiple progs every time.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
megabutt is offline Offline
18 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Qs about C++ variable types
Next Thread in C++ Forum Timeline: Is thank you enough?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC