User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 402,911 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,070 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 803 | Replies: 4
Reply
Join Date: Feb 2007
Posts: 18
Reputation: megabutt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
megabutt megabutt is offline Offline
Newbie Poster

Program Design

  #1  
Feb 4th, 2007
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 Images
File Type: jpg Schematic.JPG (42.7 KB, 15 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Posts: 45
Reputation: kenjutsuka is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
kenjutsuka's Avatar
kenjutsuka kenjutsuka is offline Offline
Light Poster

Re: Program Design

  #2  
Feb 5th, 2007
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 7:25 pm.
Foxconn C51XEM2AA nForce 590 SLI MCP
AMD Athlon X2 3800+ @ 3.0Ghz
Geil 4x512MB Dual Channel DDR2 800 @ 1GHz
2x250GB 7200RPM WD HD in Raid 0
BFG GeForce 7950GT 512MB @ 585 Core/ 780 Mem
Reply With Quote  
Join Date: Feb 2007
Posts: 18
Reputation: megabutt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
megabutt megabutt is offline Offline
Newbie Poster

Re: Program Design

  #3  
Feb 7th, 2007
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. ?
Reply With Quote  
Join Date: Oct 2006
Posts: 45
Reputation: kenjutsuka is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
kenjutsuka's Avatar
kenjutsuka kenjutsuka is offline Offline
Light Poster

Re: Program Design

  #4  
Feb 7th, 2007
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
Foxconn C51XEM2AA nForce 590 SLI MCP
AMD Athlon X2 3800+ @ 3.0Ghz
Geil 4x512MB Dual Channel DDR2 800 @ 1GHz
2x250GB 7200RPM WD HD in Raid 0
BFG GeForce 7950GT 512MB @ 585 Core/ 780 Mem
Reply With Quote  
Join Date: Feb 2007
Posts: 18
Reputation: megabutt is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
megabutt megabutt is offline Offline
Newbie Poster

Re: Program Design

  #5  
Feb 7th, 2007
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:47 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC