|
This thread is locked; no one can reply to it. |
1
2
|
Opening the Windows default "Open Dialog" in allegro? |
MiliBytes
Member #3,130
January 2003
|
Hi All!
Please help me, and can you explain most of the things I'm new in C programming!:-/ |
23yrold3yrold
Member #1,134
March 2001
|
Quote: I found this code but it doesn't work well: Be specific. What are the error messages? Are you including winalleg.h? I'm not even sure you can plop that into an Allegro program (especially if it's running fullscreen) and have it work, but if you could that would be pretty cool ... -- |
MiliBytes
Member #3,130
January 2003
|
OK! 3- And finally how to add that it can see all the files too? Oh and I got the code from: here |
Korval
Member #1,538
September 2001
|
Quote: I can't see any files "*.map" (not even other file type (only folders and drives). I don't have MSDN up at the moment, but I'm pretty certain that your string, "Block Ultra Map (*.map)" is not sufficient to tell Windows what extension to use. You'll have to look it up in MSDN to find out the real answer. Quote: And finally how to add that it can see all the files too? See above. |
A J
Member #3,025
December 2002
|
your 4th arg, the string with "block ultra map" here's what MSDN says: lpstrFilter The system does not change the order of the filters. It displays them in the File Types combo box in the order specified in lpstrFilter. If lpstrFilter is NULL, the dialog box does not display any filters. ___________________________ |
miran
Member #2,407
June 2002
|
This should do the trick: "Block Ultra Map (*.map)\0*.map\0\0",
Or am I wrong again? -- |
A J
Member #3,025
December 2002
|
wrong! i think its \0\0\0 on the end ___________________________ |
miran
Member #2,407
June 2002
|
MSDN said: Pointer to a buffer containing pairs of null-terminated filter strings. The last string in the buffer must be terminated by two NULL characters. I thought that meant 2 NULL character at the end... -- |
A J
Member #3,025
December 2002
|
good point, depends how you read it... now lets presume your correct.. i would keep seeking clarification, but for the moment, presume 3 nulls, and it will work.. after all whats another null cost ? ___________________________ |
miran
Member #2,407
June 2002
|
Yeah I guess you're right. When reading Microsoft's documentation you have to be extremely carefull. Actually you better not even try it unless you have some sort of degree in law or something... -- |
A J
Member #3,025
December 2002
|
oh please, you think you need to be smart to do law.... law is robotic, you need to have a memory for everything that has gone before, thats it. no thinking required. ___________________________ |
miran
Member #2,407
June 2002
|
I didn't say you need to be smart, what I meant was you need to know how to read lawyer talk to be able to understand MSDN and other Microsoft's documents... -- |
Bob
Free Market Evangelist
September 2000
|
There is a \0 automatically inserted at the end of litteral strings. -- |
miran
Member #2,407
June 2002
|
Didn't think of that. So that means you only need to add one \0 at the and the other is automatically inserted, right? -- |
A J
Member #3,025
December 2002
|
are you willing to rely on the compiler to do this ? ___________________________ |
spellcaster
Member #1,493
September 2001
|
Sure. -- |
Evert
Member #794
November 2000
|
Please write complete words - I for one find it very hard and tiresome to read otherwise. And if your compiler doesn't do this for you, well, it's broken and you really shouldn't use it. |
A J
Member #3,025
December 2002
|
could say the same for all the other compiler bugs too.. should i stop using any compiler the moment i find it doesn't do what i thought it should. btw, shouldn't you have written "should not".. as its very tiresome reading apostrophes. ___________________________ |
MiliBytes
Member #3,130
January 2003
|
Hey guess what "Miran" was right! But know how to add in the list (select file type) so the code end it up as:
|
miran
Member #2,407
June 2002
|
Replace "Block Ultra Map (*.map)\0*.map\0\0" with "Block Ultra Map (*.map)\0*.map\0All files (*.*)\0*.*\0\0" to add another entry in the file type selection listbox... -- |
Thomas Harte
Member #33
April 2000
|
Quote: oh please, you think you need to be smart to do law.... law is robotic, you need to have a memory for everything that has gone before, thats it. no thinking required. Provided you live in a country that uses the precedential system of law and has no codified criminal code, you mean? I know very few such countries. And what about the common-ish rule that you may commit a small crime to prevent a bigger one? Given that particularly in continental Europe there is only a very loose focus on the 'letter of the law' versus interpretation of what a particular statute is meant to prevent and allow, and also that the 'lawyer versus lawyer' model is rejected by a large number of such countries, there is no judgement or skill at all for such a decision? [My site] [Tetrominoes] |
Korval
Member #1,538
September 2001
|
Quote: could say the same for all the other compiler bugs too.. should i stop using any compiler the moment i find it doesn't do what i thought it should. If I can't rely on a compiler to put a '\0' at the end of a string literal, then that compiler is too buggy to be usable. If it can't do something as simple, basic, and common as that, there's no guarentee that the compiler won't choke on basic statements like while, for, if, and so forth. Most real compiler bugs are advanced features like optimization or high-end C++ stuff (templates, namespaces, etc). |
MiliBytes
Member #3,130
January 2003
|
Thank you all! |
spellcaster
Member #1,493
September 2001
|
Does the filechooser work as expected? I remember trying to use the windows filechooser some time ago, and I think it opened nicely, but didn't respond to any events ... What allegro version are you using? -- |
MiliBytes
Member #3,130
January 2003
|
Yes it seams to work... |
|
1
2
|