|
George_George wrote: I think in nowadays, there is no 16-bit Windows. Right?
How could I possibly know? Whether something exists and whether it is used are two different things.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thank you DavidCrow!
A good answer!
regards,
George
|
|
|
|
|
|
Hi Sarath,
The link describes something like __stdcall. There is no information about FARPROC.
regards,
George
|
|
|
|
|
It is a typedef that, when you boil down all the macros, expands to the following:
typedef int (__stdcall* FARPROC)();
In other words, any function with the following signature could be pointed to by a FARPROC pointer:
int __stdcall f();
To make it portable, you would just remove the __stdcall part of the line. For example, if you want it to work in Linux, define CALLBACK as nothing:
#ifndef CALLBACK<br />
#define CALLBACK<br />
#endif // CALLBACK
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 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
|
|
|
|