Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up window or text box 2

Status
Not open for further replies.

itech2004

IS-IT--Management
Jan 23, 2004
103
US
I was hoping someone could guide me to the right place, I would like to create a program that will open a window and or a text box when a particular programs closes. Seems pretty simple but I'm a newbie, just need a little push to guide me in the correct direction.

On another note, new to programming I would like to know how does a programmer layout out code? Is there an outline of steps to follow? my problem is where do you start, how and why. This is hard to put into words. All the books I have on visual basics assumes you are a programmer and you know all of the syntax. I need a book or website on coding. Like I said I know what my programs should do, but how and where and why do I put the code.
 
Hi,

If you have the Source Code of the "paticular" program:

It is better not to poll (query in a loop if that "paticular" program was closed) in "your" program. It is better to Send a message from the "paticular" program to "your" programm when the "paticular" program is terminating.

That has performance reasons.
An other aspect are the type of executables you have.

If you have ActiveX-Components the coding very elegant.
If not you could use DDE or SendMessage.

SmallTalker
 
As for your first question: when SmallTalker is asking if you have the source code, he means is the "particular" program a program that you have written and could modify, or isn't it? You'll need to describe more exactly what this particular program is.

Also, you might like to look for a book called "code complete." I would call it required reading for a Software Engineering student.

HTH

Bob
 
What I mean by particular program, I mean something like a printshop program a non windows program.
 
Yes it does sound simple doesn't it?

Unfortunately you have picked something that involves monitoring what's going on in the operating system and the techniques for doing that are well beyond the basics level.

You say that you "... know what my programs should do ..." but you probably don't at the level that you can translate those requirements into code. Certainly the experienced programmer knows the syntax, but more significantly he (or she) is also capable of taking a specification like "Display all the items in the database that were purchased within the last year." and translate that directly into code with no (conscious at least) intermediate steps.

For the novice however, those intermediate steps need to be conscious:
- Drop a button on the form to start the action
- Drop a grid control onto the form to display the result
- When that button is clicked, open a connection to the database
- Define a recordset object
- Construct an SQL statement to retrieve the required data
- Ask the database to retrive the records into the recordset
- Specify the recordset as the data source for the datagrid
- etc., etc.,

... and even that is pretty "high-level". You may need to go even deeper and think about conditions to be tested (IF, CASE), handling problems (ERROR TRAPPING), values to be computed (ASSIGNMENT).

It's only after you have done all this that actual coding happens (or is even possible.) ... and "what", "where" "why" are apparent from the statement of the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top