[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Compile DLL has error (emergency)

Posted on 2005-04-15
5
Medium Priority
?
286 Views
Last Modified: 2013-11-20
http://www.codeproject.com/system/KeyHook.asp

When i download these source codes , the demo source is ok .
But my question is that when i download that source code ( "keyhook.cpp && "keyhook.h") and compile it using MFC(DLL) .It didn't work and there is an error

"fatal error C1010: unexpected end of file while looking for precompiled header directive"

Although i have included the library "stdafx.h" in my "keyhook.cpp"

Can anyone will me an help?
Thank you very much
0
Comment
Question by:dtuananh
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 13791284
You need to put

#include "StdAfx.h"

as the 1st line of your .cpp file - VC++ will create it's precompiled headers through that file and therefore needs that directive there.
0
 
LVL 7

Accepted Solution

by:
jimwasson earned 450 total points
ID: 13791404
Did you look at his demo project?  The source files are not for MFC (keyhook.cpp includes windows.h). The demo project (which does not use keyhook.cpp) is an MFC project and compiles and runs just fine (at least for me).
0
 
LVL 30

Expert Comment

by:Axter
ID: 13791407
Hi dtuananh,
You can setup your file so it doesn't need precompile headers.
You can do this by right clicking the file on your FileView workspace, and then click settings.
Then click the C++ tab, and change category to Precompiled Headers.
Then just select "Not Using Precompiled Headers".

This is a good option to use, if you want to keep the file as-is.

David Maisonave :-)
Cheers!
0
 

Author Comment

by:dtuananh
ID: 13794903
I have just do all of your opions but i still can not solve the problem .Can anyone try to compile "keyhook.cpp" && "keyhook.h" to DLL file and give me a help ?

Thank you very much
0
 

Author Comment

by:dtuananh
ID: 13796594
Now i see my error .These two file is for Win32 DLL not MFC DLL
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question