-
a strange line of code
I am using some code which has the following lines in it:
Code:
if (struct2->hwnd == ???)
{
return -1;
}
mingw gives a warning (not even an error) about trigraphs, but i dont know what that means. Can anybody give some info on the meaning of "== ???", and how i can replace it?
-
the code is trying to compare the value of struct2->hwnd to ???, and if they are equal, then return -1.
my guess is that ??? was intended to be replaced by something down the line and whomever coded it put it in as a place holder and didn't fix it. You will have to contact the author of the code, or edit it yourself.
-
What other variables of the type struct2->hwnd are in scope? It might refer to one of those.
That is an invalid line of code as is.
Trigraph translation:
Code:
??= #
??> }
??< {
??! |
They're for computers that don't support #'s and stuff. You just put ??= in.
-
Also related are digraphs:
Code:
<: [
:> ]
<% {
%> }
There are more digraphs and trigraphs, but those are the only ones I've memorized.
-
I have seen the trigraphs on msdn and ??? is not defined there.
the file where this code is from is vstgui.cpp
Code:
LRESULT CALLBACK MouseProc (int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode < 0)
return CallNextHookEx (MouseHook, nCode, wParam, lParam);
if (wParam == 522)
{
MOUSEHOOKSTRUCT* struct2 = (MOUSEHOOKSTRUCT*) lParam;
if (struct2->hwnd == ???)
{
return -1;
}
}
return CallNextHookEx (MouseHook, nCode, wParam, lParam);
}
Since this is pretty official stuff i cant believe the programmer just forgot to fill it.
-
-
Can you post the actual URL of where the code came from?
It looks like an HTML/Browser problem with generating the page, or perhaps a problem copying some fancy HTML character back to ASCII in your code.
-
sure i can post it, but i dont think it is a mistake with copy+past
http://ygrabit.steinberg.de/users/yg...mon/vstgui.cpp
-
The line in question is inside a conditional section. I think it is incomplete code. Have you tried downloading the SDK containing vstgui.cpp? Anyway, the aim of the code in question is to prevent the WM_MOUSEWHEEL notification reaching a specific window. So, as a quick fix, you can just comment it out and not use your mouse wheel.
-
After my initial trials using the code i found out this line of code is the least of my problems. The documentation for the usage of vst's is incomplete and incoherent at best. I am using msdn for some time now, and although i sometimes have problems finding the info i need, the documentation from steinberg isnt even remotely as good as msdn. After a couple of hours of frustrated trials i decided to let this rest for a while until i find the time and courage to start with it again.
The good thing about this all is that i appreciate msdn a lot more then before :D .
And thx to all who have replied in this thread :).