Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / to link from program to program..

Author
Message
fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 11th Feb 2009 06:49
Hey, I'd like to know is that a way to able to do the linking function. Basically I want to create a "menu" that can link to 2 optional program, and the users are able to go back to "menu" through a keyboard input,such as "esc" which without closing or open another windows. The function of the "menu" is let the users able to switch from one world to another.

Hope you can understand what i meant here..

Thanks for your kindly helps..
ShaunRW
DBPro Developer
16
Years of Service
User Offline
Joined: 7th Jan 2008
Location: Brisbane, Australia
Posted: 11th Feb 2009 07:41
execute file "Program.exe","",""
Is this what you're after?


fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 11th Feb 2009 15:59
Yes. But is there any way to open the execute in the same windows?

How to bring the variable(entities number) to the next exe?

Thanks..
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Feb 2009 16:05
One way is to save an the values to array then load it back in the new running program.

Dark Physics makes any hot drink go cold.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 11th Feb 2009 17:42
@IanM: I'll save you the trouble;

@fumade: You could always take a look at mr. Mold's Matrix1Utilities collection; the shared memory banks it offers could likely do what you want.

"We know some things about poodles, for example that they are alive, they can bark, they eat meat..."
- Extract from Objects first with Java.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Feb 2009 20:02 Edited at: 11th Feb 2009 20:03
I use IanM's memory banks with VB, they work very well. Add the Mutex commands, and you ensure that everything closes down amicably if anything goes wrong.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Feb 2009 21:26
I'm not sure that you guys have answered the whole question - using a shared memory bank covers the communication aspect of the problem, but not the 'without closing or open another window' part.

You can get the menu programs window handle and pass it to the new programs on the command line when you kick them off. but is there a way to get the new DBPro program to use that window? Or is there a hack to allow you to position the new window exactly over the old window (I remember someone did something like this to correctly render a screensaver in preview mode)?

fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 12th Feb 2009 04:57
IanM, again thanks to your helps..

I tried to understand the memory bank that you all told me.i wondering is that what i though is correct or not..??



thanks for your all kindly helps..
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Feb 2009 14:28
You need to open a bank for shared memory as well:


fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 12th Feb 2009 16:05
IanM, I'd like to confirm the code with u.

"mybank" is referred to account name i create for this entities memory only or can use wider?
"1" is the represent account number for mybank?
"4096" only for 1 memory(entities) if more than 1, have to use bigger num?

"1" is the one for my account number?
"0" is represent the "entities"?

Thanks...
fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 12th Feb 2009 16:51
i have another Question but it has out of this topic

How to create a remaining timing?

This is my failed sample..


Thanks..
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 12th Feb 2009 17:02
Regarding your last post; you should declare A and B as floats / doubles, or they will only hold the integer part of whatever you try to put in them, which you probably don't want when dividing by large numbers such as 1000.

Try to slap this in before your snippet


You could also replace A and B with A# respective B#; that will make them floats. I think it is only the single-precision type though.

"We know some things about poodles, for example that they are alive, they can bark, they eat meat..."
- Extract from Objects first with Java.
fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 12th Feb 2009 17:12
the mem bank have failed too..I followed the instruction..
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Feb 2009 18:35
'It doesn't work' is not a great bug report

Attached is a quick example to show that it does work.

Attachments

Login to view attachments
fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 12th Feb 2009 19:09 Edited at: 12th Feb 2009 19:37
what i meant is the entities at the 2nd program is 0...after i enter 10 at the menu program..

i just run some tried on it. if i use wait key command after the execute file, it will be ok. if not, the entities on the next program is 0.


but the program is i want to close the menu program..
fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 12th Feb 2009 20:14
Quote: "
Rudolpho:Regarding your last post; you should declare A and B as floats / doubles
"

i believe the float is not affect the situation, but is my code flow problem and i have solve it..>.<


thanks for your helps..
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Feb 2009 23:13
Check my code - I use the 'wait' flag on the execute statement, so that the first program waits for the executed program to finish before it moves on.

fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 13th Feb 2009 05:03
Oh..i c..

may i know, is that the "get dir$()" is necessary for the "other.exe" to run? can i just put on "" for the directory?

Thanks..
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Feb 2009 14:28
The biggest difference between you and me (for DBPro at least ) and in my opinion, the more experienced users of DBPro and the newcomers, is that we've tried and failed at more stuff than you have.

If I don't know something and I think I need to know it, I try it out and see for myself.

Admittedly, your first question is a good one to ask on the forums, but your last one ...

Quote: "is that the "get dir$()" is necessary for the "other.exe" to run?"


... this is something you can answer yourself with a few minutes work, rather than wait for an answer for almost half a day on the forums.

So try it out, and let us know

fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 14th Feb 2009 03:36
maybe u r right. so sorry to disappoint u again, i cant find any different btw the "" and get dir$() in the directory argument. but if there is no different,why u want to put a long command instead of "". maybe i not tried hard enough..
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 14th Feb 2009 10:26
Basically, you specify the path where the file to be executed resides. If it is in the CWD (current working directory) of the app that calls the command, you don't need to specify a path at all. Likewise, should it be in one of the subfolders of where your running program is located, you only need to specify the relative path (ie. execute file "stuff.exe", "executables", "", 0).
Finally, it works just as well to put the full path to the exe straight in the first string parameter (ie. execute file "executables\\stuff.exe", "", "", 0). I believe that whatever you specify as the path parameter is from where the executed file will have it's CWD set at startup though, so not thinking carefully about this and then loading stuff from the second program could potentially cause problems (as it might link to a subfolder that doesn't exist or contain the proper files).

fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 14th Feb 2009 11:26
Thanks Rudolpho,basically i understood this from the html code, want i really confuse is that the get dir$() is look same as the "". correct me if i am wrong, "" in there meant nth, that nth will not bring the execute file from anywhere starting from CWD then it will execute the file from CDW. while the get dir$() is getting the absolute path of the CWD. so both are the same, in order to make life easier, why have to trouble with the long command?!

Rudolpho, thanks for your detail explanation.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Feb 2009 12:42
Quote: "want i really confuse is that the get dir$() is look same as the ""."

You asked why I did that - I did that because I didn't know and didn't want to spend the time to find out if they would have different effects. It was quicker and easier for me to type the few extra characters than to create new projects to find out.

My earlier point was that if you want to know what the difference actually is, test it, try it, find out. That's what I do.

fumade
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location:
Posted: 14th Feb 2009 16:26 Edited at: 14th Feb 2009 16:33
IanM, thanks for your explanation. sometimes i just want to know more and detail for doing somethings, epically those i feel interest on it. so sorry to spam the topic with a lot of question, mayb i should tried harder before i post any questions. for your information, i did try on most of the things in order to solve my problems, maybe not hard enough.

Thanks for all of your concern and i really appreciate it...

Login to post a reply

Server time is: 2024-09-28 02:27:13
Your offset time is: 2024-09-28 02:27:13