Home » U++ Library support » RichText,QTF,RTF... » UWord and Windows fole association
Re: UWord and Windows fole association [message #8921 is a reply to message #8918] |
Sat, 07 April 2007 22:55 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
luzr wrote on Sat, 07 April 2007 19:40 | AFAIK, this has to be supported by application (and it is not by UWord a the moment).
AFAIK, opening CommandLine would do.
Mirek
|
After addressing me on CommandLine and some experiment I've modified a bit UWord to open a file by clicking on it (after associating it with windows XP). I've just modified a bit the main with CommandLine and moved Load() from protected to pubblic (I hope there is no drawback for this).
Luigi
class UWord : public TopWindow {
protected:
...
public:
void Load(const String& filename);
typedef UWord CLASSNAME;
static void SerializeApp(Stream& s);
UWord();
};
...
GUI_APP_MAIN
{
SetLanguage(LNG_ENGLISH);
String fn;
UWordFs().Type("QTF files", "*.qtf")
.AllFilesType()
.DefaultExt("qtf");
PdfFs().Type("PDF files", "*.pdf")
.AllFilesType()
.DefaultExt("pdf");
LoadFromFile(callback(UWord::SerializeApp));
// -------- new ----------------
int argc = CommandLine().GetCount();
const Vector<String>& argv = CommandLine();
if(argc < 1) {
new UWord;
}
else {
fn = argv[0];
//new UWord(fn);
(new UWord)->Load(fn);
}
// --------- end new -----------
Ctrl::EventLoop();
StoreToFile(callback(UWord::SerializeApp));
}
[Updated on: Sun, 08 April 2007 08:38] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun May 12 21:50:55 CEST 2024
Total time taken to generate the page: 0.01463 seconds
|