|
Is it possible to fix the directory of the File Open/Save dialog and NOT allow the user to change it ?
For example:
c:\fixeddiretory
|
|
|
|
|
I guess your program could just ignore the path.
|
|
|
|
|
If you just want to let the user pick a file from a single directory, it might be better to just have your own dialog with a list that you populate yourself.
Software Zen: delete this;
|
|
|
|
|
Hey guys! i wna use glut functions like glutMouseFunc or glutKeyboardFunc outside of the int main(int argc, char **argv) . How can i do this??
Please help!!
AmanN
|
|
|
|
|
See two threads below.
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hi,
I have a problem with the output of CBitmap images to Adobe Distiller. I can see my bitmap in the view and the preview. Printing is also fine. But the output into pdf does not work. Text and other graphics like lines or boxes works fine, only bitmaps are not visible.
Is there anybody with a solution in the world?
Greetings from Hannover, Germany
Markus
Dr-Kuulun
|
|
|
|
|
I forgot my code:
CDC dc;
dc.CreateCompatibleDC(pDC);
CBitmap b;
b.LoadBitmap(IDB_BITMAP1);
dc.SelectObject(&b);
pDC->StretchBlt(100,100,200,200,&dc,0,0,48,48,SRCCOPY);
pDC->MoveTo(0,0);
pDC->LineTo(100,100);
The line is visible but not the bitmap.
Dr-Kuulun
|
|
|
|
|
Hi Dr-Kuulun
I run your code and this work.
I enter CDC *pDC=GetDC(); that I dont find in your code
CDC dc;
CDC *pDC=GetDC();
dc.CreateCompatibleDC(pDC);
CBitmap b;
b.LoadBitmap(IDB_BITMAP1);
dc.SelectObject(&b);
pDC->StretchBlt(100,100,200,200,&dc,0,0,48,48,SRCCOPY);
pDC->MoveTo(0,0);
pDC->LineTo(100,100);
|
|
|
|
|
Hey guys!!
How can I use the following GLUT functions without having to include them in main(int argc, char **argv) ??
glutMouseFunc(Mouse);<br />
glutMotionFunc(MouseActiveMotion);<br />
glutPassiveMotionFunc(MousePassiveMotion);<br />
glutEntryFunc(MouseEntry);<br />
glutKeyboardFunc(NormalKeys);<br />
glutSpecialFunc(KeyInput);
I'm trying to implement a camera using GLUT but the thing is I have to use this inside an OpenGL window that ive integrated in MFC. I have a separate class for my camera functions like void CCAMERA::Mouse(int button, int state, int x, int y)
But the compiler wont let me do this:
glutMouseFunc(Mouse); or this glutMouseFunc(CCAMERA::Mouse); or even when I instantiate my class as Camera and do this: glutMouseFunc(Camera.Mouse); , it wont let me.
Please help!
Thanks in advance guys
Aman N
|
|
|
|
|
|
Implement MouseMove in your view class
You might also need to implement WM_LBUTTONDOWN/UP etc.
Then you can call, your camera's methods from there.
There should be an example on the Internet for displaying MD3 files. Search in the gamedev articles. It shows how to set up a MFC project and create four different views(quite a useful article to look at in the beginning)
I found the link.
http://www.gamedev.net/reference/articles/article1358.asp
Bekir.
|
|
|
|
|
|
I have not looked at the sights you provided, but that is not an error. A warning might not be a bad idea for that, but come on (it's legal code).
INTP
Every thing is relative...
|
|
|
|
|
Is is actually disallowed in C as it can lead to undefined behaviour, see the two links I gave.
GCC takes a command line option to detect this as a warning.
thanks!
|
|
|
|
|
I assume you intended saying "It is actually disallowed...", but the rest of your statement does not support that nor does the standard.
The term "undefined behaviour" does not disallow a programmer from doing it. It just says its behaviour is undefined in the standard and is therefore compiler dependent. Meaning that you can not determine the result when using a different compiler, provided it worked on your current compiler.
A fully compliant compiler could compile that statement without giving any warning at all. But is should at the least give a warning and at the most consider it an error (becuase it is undefined behaviour).
INTP
Every thing is relative...
|
|
|
|
|
John R. Shaw wrote: A fully compliant compiler could compile that statement without giving any warning at all. But is should at the least give a warning and at the most consider it an error (becuase it is undefined behaviour).
So it may be the case that the C compilers shipped with VS6, VS2003, VS2005 all aren't fully compliant with the standard. What is puzzling is, they dont qualify your "at the least" part, forget about "at the most" part.
thanks!
-- modified at 0:55 Sunday 19th March, 2006
|
|
|
|
|
I would need to look it up, because I never understood why it would be classified as undefined behaviour.
My answer was very weak and I should not have attempted it [without research], becuase it actually applies to the "old argument" below, following my explination of what I ment.
I said "at the least" because if it is undefined behaviour then it would be compiler dependent (non-portable) and a warning should be generated to inform the programmer of this.
I said "at the most" because if it is undefined behaviour then it would be compiler dependent and an error would force the programmer not to write non-poratable code.
I believed it was consider undefined behaviour in the passed, which means the compiler vender could decide what behaviour to apply, and still be fully compliant. This may no longer be the case, as the behaviour may now be deifined.
Here is the old argument:
int i = 0;<br />
i = i++;
Should i now be equal to 0 or 1?
My answer and the answer Microsoft chose is 1, which I think is the only logical answer. But there where those who disagreed and said the answer should be 0, because they believed that was the intent of the progammer.
So if you throw out logic and just consider the intent, then the language would not be able to define the behaviour. I think the real problem was that different venders had already implimented different solutions, before the standared was complete.
When I originaly gave my answer of 1 to that question (years ago), I was informed that my answer was wrong, becuase it was undefined and therefore could be either 0 or 1.
VS6 may be fully compliant for C (?), but it is not fully compliant with the C++ standard.
VS2003, according to Microsoft, is a full ASCII/ISO C++ Standards compliant compiler.
INTP
Every thing is relative...
|
|
|
|
|
John R. Shaw wrote: I have not looked at the sights you provided, but that is not an error. A warning might not be a bad idea for that, but come on (it's legal code).
Actually, it does violate the standard:
"Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored."
The second sentence is the killer here. I think it's a silly statement, but perhaps that's just me. To me, it would be more intuitive to state that an object's value is not changed until the compiler reaches a sequence point - nice and clean and predictable, without preventing totally unambiguous code such as this example.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote: Actually, it does violate the standard
Actually, undefined behaviour is not a violation of the standard. It is what it says "undefined", that means it is up to the compiler [vender] to determine what its behaviour is.
Personaly, I think it should translate into:
data[i] = i;
++i; OR
data[i] = (temp = i + 1);
i = temp; but that is just my opinion.
INTP
Every thing is relative...
|
|
|
|
|
|
Trollslayer wrote: Did you change the warning level to 4? (Project->Settings->C/C++)
I just checked with both VS6 and VS 2003, both of them dont detect and warn for a[i] = i++. Do you have VS 2005 to check this out? GCC 3.4.3 does, if you want to check this out with GCC.
thanks!
|
|
|
|
|
|
Hello,
I'd like to release an application in several languages(english, french and spanish).
I know I can do it by traducing only my resource file. In fact, I've included all strings I use as resources.
But I don't want to duplicate my application directory for each language. I'd like to manage all languages only from one workspace under Visual C++ 6.
Can you please tell me how to do or point me to a document discussing it?
Thanks
Best regards,
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|
|
I have written programs that allow multiple languages, but I have not written one that supported multiple languages for the interface.
Given that, there is a book from Microsoft press that explains the subject. I forget its name but it was included in the VC6 MSDN library and the 2nd edition came out last year.
There is also an article some where on CP on the subject.
Essentially it breaks down to providing a DLL for each language that contains the strings for the required languages. In order to change the language all you have to do is change the DLL. In other words, your string resources are stored in a DLL. You still have to make sure that you give enough room in the text fields (at least in dialogs) for longer text strings or shorter text strings.
The biggest problem is working with Asian text, because you have to give extra room for the height. Outside of Asian characters I have not [yet] ran across double byte characters.
I do need to warn you, in the middle-east we may have a totally different problem, but I am not going to discuss that now.
INTP
Every thing is relative...
|
|
|
|
|
Thank you for replying.
However, I do not want to write an application that supports multiple language for the interface.
I'd just like to build one different version of my app for each language. Maybe it's a bit easier?
Best regards,
Allad
----
Navigator - Your best alternative to Windows Explorer
|
|
|
|