Click here to Skip to main content
15,918,193 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: "_ _cplusplus" tag error? Not VC++6 compatible? Pin
Blake Miller7-Mar-05 12:30
Blake Miller7-Mar-05 12:30 
GeneralRe: "_ _cplusplus" tag error? Not VC++6 compatible? Pin
Axonn Echysttas7-Mar-05 20:51
Axonn Echysttas7-Mar-05 20:51 
Nope, not your imagination... : ). But this is not the problem I think. This only solved one of the warnings of the compiler. I already did try that. I documented enough to know that __cplusplus is a known directive, but anyway, _ _cplusplus was in that book so.... Now that I put two leading underscores and compiled again I "only" get these errors:

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


Also, what I did now is replace #define MAINHOOK_API _ _declspec(ddlexport) with #define MAINHOOK_API __declspec(ddlexport) (I put two leading underscores again.)

This resulted in this error
D:\Lucru\!!Aoleo\Exp\Exp.cpp(33) : error C2485: 'ddlexport' : unrecognized extended attribute
beeing repetead 7 times in my CPP file. Here is my CPP file in case you were wondering... (I posted now the full source code, the header file is in my previous post).

By the way, this is a SIMPLE WIN32 DLL (not a DLL that exports some symbols or empty DLL, so you imagine how stdafx.h and stdafx.cpp look like).

<br />
<br />
// Exp.cpp : Defines the entry point for the DLL application.<br />
//<br />
<br />
#include "stdafx.h"<br />
#include "Exp.h"<br />
#include "WINUSER.H"<br />
<br />
HANDLE hInstance;<br />
HHOOK hhookHooks;<br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
                       DWORD  ul_reason_for_call, <br />
                       LPVOID lpReserved<br />
					 )<br />
{<br />
	hInstance = hModule;<br />
	switch (ul_reason_for_call)<br />
	{<br />
	case DLL_PROCESS_ATTACH:<br />
	case DLL_THREAD_ATTACH:<br />
	case DLL_THREAD_DETACH:<br />
	case DLL_PROCESS_DETACH:<br />
		break;<br />
	}<br />
<br />
    return TRUE;<br />
}<br />
<br />
MAINHOOK_API int InstallFilterDLL(void);<br />
MAINHOOK_API int UnInstallFilterDLL(void);<br />
LRESULT CALLBACK KeyboardFunc (int nCode, WPARAM wParam, LPARAM lParam);<br />
<br />
MAINHOOK_API int InstallFilterDLL(void)<br />
{<br />
	hhookHooks = SetWindowsHookEx(WH_KEYBOARD, <br />
		                          (HOOKPROC) KeyboardFunc,<br />
								  (HINSTANCE) hInstance,<br />
								  0);<br />
	return 1;<br />
}<br />
<br />
MAINHOOK_API int UnInstallFilterDLL(void)<br />
{<br />
	int iResult;<br />
	iResult = UnhookWindowsHookEx(hhookHooks);<br />
	if (iResult == 0) return 0; else return 1;<br />
}<br />
<br />
LRESULT CALLBACK KeyboardFunc (int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
	return CallNextHookEx(hhookHooks, nCode, wParam, lParam);<br />
}<br />


What do you say about this? Either that book is not good, either I'm too much of a beginner to handle this. I worked with C# in the past year and half but this is a totally different game : )

-= E C H Y S T T A S =-
The Greater Mind Balance
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 
Questionhow to detect system's idle state? Pin
Kamis7-Mar-05 9:45
Kamis7-Mar-05 9:45 
AnswerRe: how to detect system's idle state? Pin
David Crow7-Mar-05 10:42
David Crow7-Mar-05 10:42 

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.