473,396 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Opening Program and Passing Data

compman9902
105 100+
Hello, and thank toy for reading this post.
Thus far, this website has helped me a lot,
(I have finally finished my encryptor: "site removed by moderator", go to the downloads link) and I will continue asking for help (so my rank may finally increase).
Right now the topic at hand for me is opening file dialogs. Right now, the issue at hand is opening up a fully functional G.U.I. file prompt (both for opening and saving files please) that has a filter for Windows Text (.TXT) files.
Also, it would be helpful if someone could give me some code for opening up notepad and displaying a string variable file in it (The string variable being a variable that is a string containing the file path). So the user dosn't have to press open and all that stuff, it comes pre-opened. Well, I have writen no code and I really hope that someone (or more) can help me with these issues.


My information:

Operating System: Windows XP Home Edition (Service Pack Two)
Compiler/I.D.E. :Bloodshed DEV-C++ Version 4.9.9.2

Thank You
--Parker Woods
Apr 3 '07 #1
9 2287
sicarie
4,677 Expert Mod 4TB
Hello, and thank toy for reading this post.
Thus far, this website has helped me a lot,
(I have finally finished my encryptor: "site removed by moderator", go to the downloads link) and I will continue asking for help (so my rank may finally increase).
Right now the topic at hand for me is opening file dialogs. Right now, the issue at hand is opening up a fully functional G.U.I. file prompt (both for opening and saving files please) that has a filter for Windows Text (.TXT) files.
Also, it would be helpful if someone could give me some code for opening up notepad and displaying a string variable file in it (The string variable being a variable that is a string containing the file path). So the user dosn't have to press open and all that stuff, it comes pre-opened. Well, I have writen no code and I really hope that someone (or more) can help me with these issues.


My information:

Operating System: Windows XP Home Edition (Service Pack Two)
Compiler/I.D.E. :Bloodshed DEV-C++ Version 4.9.9.2

Thank You
--Parker Woods
So you are trying to carete a GUI? I'm not sure I understand your question there.

As for notepad, I think you can use 'system("notepad") to start it, but I'm not sure about pasting the string in there - you might be able to pass it as a command line option...
Apr 3 '07 #2
compman9902
105 100+
So you are trying to carete a GUI? I'm not sure I understand your question there.

As for notepad, I think you can use 'system("notepad") to start it, but I'm not sure about pasting the string in there - you might be able to pass it as a command line option...
I'm not trying to create a GUI, just a console program. But my users and I both agree that it would be easier for a file dialog instead of manually typing in the file path.
As for the notepad thing, I've tried this:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. system("notepad " << filePath);
  3. and
  4. system("notepad filePath")
  5.  
and it didn't seem to work. Any suggestions are greatly appreciated. Also, whats not to get about the question?
Apr 3 '07 #3
sicarie
4,677 Expert Mod 4TB
I'm not trying to create a GUI, just a console program. But my users and I both agree that it would be easier for a file dialog instead of manually typing in the file path.
As for the notepad thing, I've tried this:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. system("notepad " << filePath);
  3. and
  4. system("notepad filePath")
  5.  
and it didn't seem to work. Any suggestions are greatly appreciated. Also, whats not to get about the question?
Right, just appending the path won't work - I'd recommend looking through the Win32 API to see if there's an easy way to do this, or if it's even in there.
Right now, the issue at hand is opening up a fully functional G.U.I. file prompt (both for opening and saving files please) that has a filter for Windows Text (.TXT) files.
You want to create a prompt on a text screen, or make a GUI? It seems like you want to have a prompt on some command prompt for a user to input a filename, and then have that file be opened in notepad. I'm sorry, I'm probably over-complicating this in my head...
Apr 3 '07 #4
sicarie
4,677 Expert Mod 4TB
Maybe a simple explanation of how you would like the program to proceed would help - I'm not sure at what point you want notepad to open, if it's when the user inputs a file, or if you want to try to use that to capture the filename.
Apr 3 '07 #5
compman9902
105 100+
Maybe a simple explanation of how you would like the program to proceed would help - I'm not sure at what point you want notepad to open, if it's when the user inputs a file, or if you want to try to use that to capture the filename.
Okay. Thank you for you help, but you are over-complicating things. Heres what I want.
The program opens, then it asks for a text file path, but it retrieves it by using the GUI interface of the common open file dialog. Then, it completes its processes with the text file, then it saves it to a certain path using the common file dialog. Then, it asks if you would like to read it using the "system(notepad)" command.
Apr 8 '07 #6
sicarie
4,677 Expert Mod 4TB
Okay. Thank you for you help, but you are over-complicating things. Heres what I want.
The program opens, then it asks for a text file path, but it retrieves it by using the GUI interface of the common open file dialog. Then, it completes its processes with the text file, then it saves it to a certain path using the common file dialog. Then, it asks if you would like to read it using the "system(notepad)" command.
Yeah, I was trying to get a more clear explanation. I've edited the thread so that jj555 wasn't hijacking it, as his question was a bit different, and edited the title of the thread (let me know if you don't think it is adequately descriptive enough). Off the top of my head I don't have much experience with the common open file dialog, if that accepts paramaters, if one of those can be data, etc... I'm sure there's a way to do it (and meanwhile, if anyone does know, please post!), so I'll look into it - just wanted to put an update on the splitting/re-titling of the thread (and bump this back to the top).
Apr 8 '07 #7
compman9902
105 100+
Yeah, I was trying to get a more clear explanation. I've edited the thread so that jj555 wasn't hijacking it, as his question was a bit different, and edited the title of the thread (let me know if you don't think it is adequately descriptive enough). Off the top of my head I don't have much experience with the common open file dialog, if that accepts paramaters, if one of those can be data, etc... I'm sure there's a way to do it (and meanwhile, if anyone does know, please post!), so I'll look into it - just wanted to put an update on the splitting/re-titling of the thread (and bump this back to the top).
Okay, thank you.
I still need help on this so PLEASE post.
Apr 9 '07 #8
weaknessforcats
9,208 Expert Mod 8TB
You cannot use a GUI on a console application.

By definition, rthe console is character based since it's is an actual console with a keyboard.

If you need a GUI, you will need to write a Windows program. See "Programming Windows" by Charles Petzold.
Apr 9 '07 #9
dfound
52
Hi, I don't know whether it will work , but try this.


char command[100];//you can vary size
strcpy(command,"notepad "); // there is a space after notepad
strcat(command,filepath);
system(command);


I had tried the above to open a file containing window.
I used "explorer " instead of "notepad"
It might work. .... :-)
Apr 9 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Evan Kontos | last post by:
I am using the window.open function to open a small window and I am using GET to get values back from that window. I want to be able to open another from the second window but I get an error...
1
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0....
11
by: Susan Bricker | last post by:
Hi. I am trying to open a form using 'openargs' parameter of the docmd.openform action. The problem is that I would like to pass the form some character (string) and integer data. My plan was to...
3
by: MrNobody | last post by:
I found an explanation of using Process.Start to open web pages but it has the following comments: // url's are not considered documents. They can only be opened // by passing them as arguments....
7
by: Jake Thompson | last post by:
Hello I created a DLL that has a function that is called from my main c program. In my exe I first get a a pointer to the address of the function by using GetProcAddress and on the dll side I...
11
by: aldrin | last post by:
I'm trying to run this code under windows xp sp2 using codeblocks v1.0 compiler with great difficulty.There is no problem with running this under KDevelop in linux. Any help would be greatly...
7
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to...
6
by: André | last post by:
Hi, I made a webform for a survey, with multiple-choice questions. The results of each question is put into a table e.g.: values frequency 1 6 2 3 3 32 4 ...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.