-
1 Attachment(s)
Compiler Errors
When I compile my project it gives me these errors, and i have no clue as to what they mean or how to solve them! Can somebody help me?
dllstuff.c
C:\key32\dllstuff.c(4) : error C2143: syntax error : missing '{' before 'constant'
C:\key32\dllstuff.c(4) : error C2059: syntax error : '<Unknown>'
C:\key32\dllstuff.c(6) : error C2059: syntax error : 'else'
C:\key32\dllstuff.c(17) : error C2014: preprocessor command key32\dllstuff.c(18) : error C2143: syntax error : missing '{' before '__stdcall'
C:\key32\dllstuff.c(19) : fatal error C1019: unexpected #else
Error executing cl.exe.
I am trying to install system wide hooks with the application
I enclose the project in this message!
[email protected]
Cheers for any help or insight
Andy
I'm using MS VC++ 6.0
:confused:
-
Nobody will have so much time to contact you and solve your problem so can you post your whole code here so that we know what you are doing!
-
Does your code absolutely HAVE to be 16-bit compatible?
-
16-bit
I'm not entirely sure if it has to be 16 bit,
basically what i'm trying to do is install system wide hooks, and to do this you need it in some dll!!
I'm am working from loads of different examples, and this is what i have cobbled together, it tems from a microsoft hooks example!
So the answer is i don't really know, but if you have a suggestion i would be very greatful!
When i have a chance i will post the entire project so people can have more of an idea of what i'm trying to achieve!
-
The code you attached has the same code in it twice with some differences. The first part you have pre-processor directives with variable types in front of them???. You also have pre-processor directives without the # before the if and else.
If you fix that it will take away the 5 errors, but it it will give you a LINK error, not sure about that.
-
I don't know how old that code is, but what compiler are you trying to use?
-
I'm just using the standard compiler that comes with microsoft visual studio 6.
As for the age of the code, i can't be sure, it is from a microsoft example from msdn!!
should i start again? it is a first attempt at hooks, and indeed visual c++ programming. I only really have a grounding in c++ for console applications
-
If it's from MS then I think you found an old sample :D
WIN32 is always defined for VC++6.
-
so is it possible to adapt the code i have to work or should i be approaching it differently?
-
I think you should be approaching very differently. For a start, LibMain has disappeared, replaced by DllMain. Segments and offsets are also gone.
I was never around for 16-bit windows programming so I don't know how to convert it. Vlatko had a good example on hooking (as does Steve's mom:D)
-
you wouldn't happen to have any links would you??
I am in desperate need to get this thing working!
cheers for you help
Andy
-