|
Hi Zac,
Excellent!
regards,
George
|
|
|
|
|
Hi Zac,
I have found some new question about FARPROC. I found that in the definition in windef.h, FARPROC is dealing with a macro called far/near, for example, the following code segment,
<br />
#define far<br />
#define near<br />
#if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))<br />
#define pascal __stdcall<br />
#else<br />
#define pascal<br />
#endif<br />
Do you know what means far and near?
regards,
George
|
|
|
|
|
In Win32, FAR and NEAR are defined as nothing. In Win16, they were used to define the type of pointer (that is, where the pointer was in memory).
In other words, the following declarations are the same in Win32:
int FAR * myInt;<br />
int NEAR * myInt;<br />
int* myInt;
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Thank you Zac,
What do you mean "where the pointer was in memory"?
regards,
George
|
|
|
|
|
Back in the Win16 days, the hardware was 32-bits, but the OS was written for 16-bits. Thus, the actual area of memory you could address with a typical pointer was addressed in 16-bit address space. The OS simulated 32-bit pointers by using NEAR and FAR to specify whether it was in the lower or upper realm of memory. (In a nutshell). Neither of them have any meaning in portable code nor in Win32.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Cool, Zac!
You have answered my question.
regards,
George
|
|
|
|
|
Hi all
Now I want to lock the mouse in a dialog box. ClipCursor(&rect) is used in CMyDialog::InitialDialog(), and the mouse is locked in the dialog. However, if I move the dialog with dragging the title bar, the mouse is not locked this time. So I think WM_MOVE should be responsed, and ClipCursor is used again in CMyDialog::OnMove(), however, mouse is locked after moving in debug mode, but when I run the program free, the mouse is free as before, why is this? Should I set capture in the dialog?
CMyDialog::InitialDialog()
{
......
GetWindowRect(&rect);
ClipCursor(&rect);
}
CMyDialog::OnMove()
{
......
GetWindowRect(&rect);
ClipCursor(&rect);
}
|
|
|
|
|
zouchao1112 wrote: Now I want to lock the mouse in a dialog box.
Why not use SetCapture() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
SetCapture( ):
Causes all subsequent mouse input to be sent to the current CWnd object regardless of the position of the cursor.
From MSDN
It only captures the input of mouse, but do not confine the mouse move
|
|
|
|
|
|
|
Hi all,
i need help about a problem:
i wanted to chance the dialog style of SHBrowseForFolder, i need to use BIF_NEWDIALOG STYLE. The right shlobj.h file that allow me to use BIF_NEWDIALOG STYLE is in the platform sdk. So i have to use that file and add it in my project but i can't overwrite the old one placed in v98 directory. How can i do this?
I hope someone can help me....
thanks in advance
vasmvr
|
|
|
|
|
Change your include path to look in C:\Program Files\Microsoft SDK\include first.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks for your prompt answer but i can't do that, i need other way to do that...
I hope it exist
|
|
|
|
|
|
because it isn't a project settings and if someone want to compile in another computer where is not installed sdk the program don't compile. I want to avoid to install sdk in all computer.
thanks in advance
|
|
|
|
|
vasmvr wrote: ...if someone want to compile in another computer where is not installed sdk the program don't compile.
Right, so what's the problem? If the other machine does not have the Platform SDK installed, they aren't going to be able to compile the project anyway.
Whether the Platform SDK is present on a machine or not, you can still instruct the compiler to look there. If the path is not present, the compiler simply moves to the next one in line. But given that you are using code that is only present in a newer .h file, this is a non-issue.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i have a project shared by a lot of people working on it and i want to introduce BIF_NEWDIALOGSTYLE and add new .h file in the projects in transparent mode, so the other at the next get of the project can work without a problem with the latest code. And i don't want to overwrite old .h file because maybe it is used by someone....
i hope it is clear...
|
|
|
|
|
vasmvr wrote: i hope it is clear...
Somewhat, but I still think it is a mistake to not be using the latest Platform SDK. Trying to work around its presence is just asking for trouble.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
maybe it's a mistake but i can't do what you said, i have to find another solution...
thanks for your interest
|
|
|
|
|
I think what vasmvr wants to is to provide the problematic header file with his own code.
Regards,
Marcus.
|
|
|
|
|
Mixing and matching versions of the SDK is never a good idea. It only leads to a highly complicated codebase and bugs that are extremely difficult to track down. I realize you just want this flag out of the newer SDK, but trying to mix'n'match in this way only opens the door to much bigger problems. My suggestion is to try to use the newer SDK completely and fix any issues you have when that is done.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi together,
I need your help: I have to find out what kind of graphics card is installed on a PC (e.g. ATI or NVIDIA and what kind of model). More specifically, I need to know if the card supports the languages cg or glsl, but that can be derived from the graphics card model, of course. Can anybody give me a hint on how to do that?
Thank you very much in advance.
Regards,
Marcus.
|
|
|
|
|
You can use a simple diagnostic program called dxdiag to determine your computer's hardware, operating system, and graphics card.
To use the dxdiag program:
1. Select "Start"
2. Choose "Run."
3. Type "dxdiag" in the box and click "OK."
4. Click "Yes" to the prompt, and the program will begin running.
5. Select the "Display" tab and the Name listed under the "Device" section is the name of your graphics card.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Thank you very much for the detailed instruction. The information presented in the dialog is exacly what I was looking for, but I need it in a C++ program. I forgot to mention that, but that's why I posted my question to the C++ forum
Do you have any idea how to do that? Thanks again!
Regards,
Marcus.
|
|
|
|