Read file data when opening from...
-
I have developed a text editing software and I was wondering how to accomplish the following. I have set all .rtf files to open with my program by default in Windows I would like to know how to read the data from the .rtf file while my program opens Thanks, Taen Karth
You'll need to read this: http://www.google.com.au/search?hl=en&q=rtf+file+format&meta=[^] and write some code that reads that format. Christian Graus - Microsoft MVP - C++
-
You'll need to read this: http://www.google.com.au/search?hl=en&q=rtf+file+format&meta=[^] and write some code that reads that format. Christian Graus - Microsoft MVP - C++
I don't think I quite explained it well enough. I am using a RichtextBox control and VB.NET 2005. I can read a .rtf fle into the richtextbox control using one simple command (.loadfile). There has to be a more straight forward way to accomplish this. Thanks, Taen Karth
-
I don't think I quite explained it well enough. I am using a RichtextBox control and VB.NET 2005. I can read a .rtf fle into the richtextbox control using one simple command (.loadfile). There has to be a more straight forward way to accomplish this. Thanks, Taen Karth
There's a single command which loads the RTF and you want something more simple ? I don't understand ? Christian Graus - Microsoft MVP - C++
-
There's a single command which loads the RTF and you want something more simple ? I don't understand ? Christian Graus - Microsoft MVP - C++
Obviously... When the programs opens it needs to load the file that called it as the default app to open in... My questions is how do you capture the file that opened it. When windows sets a program as default editor for a file type...when that file type is clicked and it opens the program how does the program know what called it? Thanks, Taen Karth
-
Obviously... When the programs opens it needs to load the file that called it as the default app to open in... My questions is how do you capture the file that opened it. When windows sets a program as default editor for a file type...when that file type is clicked and it opens the program how does the program know what called it? Thanks, Taen Karth
I'm not sure it does. Or do you mean how does it know what file was being passed to it ? I'd say the filename is passed as a parameter. Christian Graus - Microsoft MVP - C++
-
I'm not sure it does. Or do you mean how does it know what file was being passed to it ? I'd say the filename is passed as a parameter. Christian Graus - Microsoft MVP - C++
Yeah that is exactly what I mean. How does it discern the parameter and file that was passed to it and how do you code using it. I assume that the parameter it passes is the file system path to the file...which would enable me to use the .loadfile element of the richtextbox control to load the data. Just not sure how to capture the parameter... Thanks, Taen Karth
-
Yeah that is exactly what I mean. How does it discern the parameter and file that was passed to it and how do you code using it. I assume that the parameter it passes is the file system path to the file...which would enable me to use the .loadfile element of the richtextbox control to load the data. Just not sure how to capture the parameter... Thanks, Taen Karth
Ah, OK. I still can't get that from the wording of the original question :-) Your program entry point is a static void main method. That method is passed an array of arguments. You can check that array, the first argument passed in there is going to be the file path, so you can capture it there, and use it accordingly. Christian Graus - Microsoft MVP - C++
-
Ah, OK. I still can't get that from the wording of the original question :-) Your program entry point is a static void main method. That method is passed an array of arguments. You can check that array, the first argument passed in there is going to be the file path, so you can capture it there, and use it accordingly. Christian Graus - Microsoft MVP - C++
hehe...sorry for the confusion but I, for the life of me, could not understand the logic of what was supposed to be happening. Now I understand it in theory and I am still too green to understand completely what you are telling me above. I have no Static Void method in my project. If this is just an invisible method?:wtf: that is assumed, how do I capture it? Thanks, Taen Karth
-
hehe...sorry for the confusion but I, for the life of me, could not understand the logic of what was supposed to be happening. Now I understand it in theory and I am still too green to understand completely what you are telling me above. I have no Static Void method in my project. If this is just an invisible method?:wtf: that is assumed, how do I capture it? Thanks, Taen Karth
The syntax may be different for VB. Man, I hate VB. It seems this is another thing that VB does by 'magic', instead of via code. http://www.devx.com/vb2themax/Tip/18748[^] It looks like you have to add the code to make things work in a more 'normal' way, via a main method. Christian Graus - Microsoft MVP - C++
-
The syntax may be different for VB. Man, I hate VB. It seems this is another thing that VB does by 'magic', instead of via code. http://www.devx.com/vb2themax/Tip/18748[^] It looks like you have to add the code to make things work in a more 'normal' way, via a main method. Christian Graus - Microsoft MVP - C++
AHA! That's the stuff! I remember reading that before now. Thanks for bearing with me...:doh: and have a nice week!:-D Thanks, Taen Karth
-
AHA! That's the stuff! I remember reading that before now. Thanks for bearing with me...:doh: and have a nice week!:-D Thanks, Taen Karth
My pleasure - glad to help. Christian Graus - Microsoft MVP - C++