Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMDI CScrollView? Pin
murali_utr7-Mar-05 16:57
murali_utr7-Mar-05 16:57 
GeneralProblem of Getting image from a window Pin
kokehqyu7-Mar-05 16:05
kokehqyu7-Mar-05 16:05 
GeneralRe: Problem of Getting image from a window Pin
Christian Graus7-Mar-05 17:11
protectorChristian Graus7-Mar-05 17:11 
GeneralRe: Problem of Getting image from a window Pin
kokehqyu8-Mar-05 17:41
kokehqyu8-Mar-05 17:41 
GeneralUsing msado15.dll in VC++ Application Which build DLL ! Pin
lucdt7-Mar-05 13:46
lucdt7-Mar-05 13:46 
GeneralRe: Using msado15.dll in VC++ Application Which build DLL ! Pin
Serge Krynine7-Mar-05 16:02
Serge Krynine7-Mar-05 16:02 
GeneralRe: Using msado15.dll in VC++ Application Which build DLL ! Pin
lucdt7-Mar-05 16:09
lucdt7-Mar-05 16:09 
Question"_ _cplusplus" tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 12:08
Axonn Echysttas7-Mar-05 12:08 
Hi everybody : ). Before I begin, I must say I'm a newcommer to the world of Visual C++. Up until a few days ago I didn't know much about it, but I'm a fast learner, specially when I really have to do do something. And I really have a complex task that I need to accomplish. It's related to the SysTray. I won't get into that... anyway, the toughest part is this: creating a hook on Explorer.exe to monitor the messages it sends to the Systray's window.

What I need to make is a DLL to call from my VB application. I know how to do all that but here comes the problem. I have this VC++ DLL tutorial for a system-wide keyboard hook and I wanted to adapt this to VB.... Unfortunately, I didn't even get to adapting. Why? Because I got some compilation error that I am unable to correct. Here is the full source code of the module in cause (it's the header file of the DLL)

<br />
#define MAINHOOK_API _ _declspec(ddlexport)<br />
<br />
#define CCONV _stdcall<br />
#define NOMANGLE<br />
<br />
#define WH_KEYBOARD 2<br />
#define HC_ACTION 0<br />
<br />
typedef struct tagKBDLLHOOKSTRUCT {<br />
	DWORD vkCode;<br />
	DWORD scanCode;<br />
	DWORD flags;<br />
	DWORD time;<br />
	DWORD dwExtraInfo;<br />
} KBDLLHOOKSTRUCT, FAR *LPKBDLLHOOKSTRUCT, *PKBDLLHOOKSTRUCT;<br />
<br />
LRESULT CALLBACK KeyboardFunc (int nCode, WPARAM wParam, LPARAM lParam );<br />
<br />
#ifdef _ _cplusplus<br />
extern "C" {<br />
#endif<br />
  MAINHOOK_API int InstallFilterDLL(void);<br />
  MAINHOOK_API int UnInstallFilterDLL(void);<br />
#ifdef _ _cplusplus<br />
}<br />
#endif<br />
<br />


Of course you already saw probably what is the problem. Yeah, I know. Those "_ _cplusplus" tags. I don't know what they mean but my VC++6 doesn't seem to "know" them. In the book from where I took this code there wasn't any mention about "what kind" of C++ is this. The basic is that it doesn't compile. Here are the errors:

warning C4067: unexpected tokens following preprocessor directive - expected a newline
error C2485: 'ddlexport' : unrecognized extended attribute
error C2144: syntax error : missing ';' before type 'int'
error C2501: '_' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found"



So? Anybody has any idea what I'm up against? : ). Thanks a lot for all the time you guys spend helping people such as myself : ). If I *EVER* get good enough, I promise I'll return the favor. And I'm a man of my word. But for now, I really need help with this...

P.S. It's for a good cause... I`m developing a freeware Application that most of you will probably like... if it's ever gonna be completed.

-= E C H Y S T T A S =-
The Greater Mind Balance
AnswerRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Blake Miller7-Mar-05 12:30
Blake Miller7-Mar-05 12:30 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 20:51
Axonn Echysttas7-Mar-05 20:51 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 21:19
Axonn Echysttas7-Mar-05 21:19 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
ThatsAlok7-Mar-05 22:39
ThatsAlok7-Mar-05 22:39 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Anonymous7-Mar-05 23:21
Anonymous7-Mar-05 23:21 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
ThatsAlok7-Mar-05 23:37
ThatsAlok7-Mar-05 23:37 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas8-Mar-05 3:37
Axonn Echysttas8-Mar-05 3:37 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
ThatsAlok8-Mar-05 18:48
ThatsAlok8-Mar-05 18:48 
GeneralRe: &quot;_ _cplusplus&quot; tag error? Not VC++6 compatible? Pin
Axonn Echysttas9-Mar-05 1:54
Axonn Echysttas9-Mar-05 1:54 
Generalcustomizing MS Word Menubar Pin
rjnl7-Mar-05 11:29
rjnl7-Mar-05 11:29 
GeneralRe: customizing MS Word Menubar Pin
Sujan Christo7-Mar-05 17:46
Sujan Christo7-Mar-05 17:46 
Generalusing GetOpenFileName in service Pin
TheGreatAndPowerfulOz7-Mar-05 11:22
TheGreatAndPowerfulOz7-Mar-05 11:22 
GeneralShellExecuteEx and WaitForSingleObject Pin
lulacapixaba7-Mar-05 10:51
lulacapixaba7-Mar-05 10:51 
GeneralRe: ShellExecuteEx and WaitForSingleObject Pin
TheGreatAndPowerfulOz7-Mar-05 11:33
TheGreatAndPowerfulOz7-Mar-05 11:33 
GeneralRe: ShellExecuteEx and WaitForSingleObject Pin
lulacapixaba7-Mar-05 22:38
lulacapixaba7-Mar-05 22:38 
GeneralRe: ShellExecuteEx and WaitForSingleObject Pin
TheGreatAndPowerfulOz8-Mar-05 3:32
TheGreatAndPowerfulOz8-Mar-05 3:32 
GeneralRe: ShellExecuteEx and WaitForSingleObject Pin
lulacapixaba8-Mar-05 4:08
lulacapixaba8-Mar-05 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.