Solved

Need help with CRegKey!

Posted on 1998-09-20
10
297 Views
Last Modified: 2013-11-19
hello there. i wanna use CRegKey provided in VC++ 5 to access Win95's registry, but while i compile my app i get an error: LNK2001: unresolved external symbol "public: long __thiscall ATL::CRegKey::Open(void)" (?Open@CRegKey@ATL@@QAEJXZ)

i already include "atlbase.h", but it seems VC can't find the implementation defined in "atlimpl.cpp". do i have to put this file into my project? or there's another solution?
please help...
0
Comment
Question by:darrelliu
  • 6
  • 4
10 Comments
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322350
Are you including the right library (LIB file) too?
0
 

Author Comment

by:darrelliu
ID: 1322351
which one? ATL.LIB? i tried this but not working...
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322352
Wow this is really pathetic, there is no place in the documentation that tells you what library file to use.  But, from what meager information is in that header file, it would seem that atl.lib is the correct one.  I am not sure why it is not working.
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322353
We can do this the hard way though... Copy the file atlimpl.cpp (located in the vc\atl\include directory) to the directory your project is in, and then include it.  That ought to fix it.
0
 
LVL 6

Accepted Solution

by:
thresher_shark earned 100 total points
ID: 1322354
In fact, I am certain that will fix it.  Please take my above comment as an answer.

If you have any further questions, please feel free to ask.

Thanks!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322355
Clarification:

I said:
>> and then include it.  That ought to fix it.

I meant to say:
>> and then add it to your project by going to the Project menu->Add to project->Files.  That ought to fix it.
0
 

Author Comment

by:darrelliu
ID: 1322356
yes, i even have tried to this. i copied 'atlimpl.cpp' into the 'myapp' directory and added it into my project, but when i compiled it, i got an error said:
error LNK2001: unresolved external symbol "public: long __thiscall ATL::CRegKey::Open(struct HKEY__ *,char const *,unsigned long)" (?Open@CRegKey@ATL@@QAEJPAUHKEY__@@PBDK@Z)
well there's only one, not like before there were 2, 'Open' and 'Close'. i think it's because there's no parameters needed for 'Close'. i don't know why, but compare with the definition, seems because a 'overloaded' 'Open' function can not be found (the original definition should be LONG Open(HKEY, LPCTSTR, REGSAM))...
anyway, thank your help!
0
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1322357
Glad I could help.
0
 

Author Comment

by:darrelliu
ID: 1322358
wow! finally i got it! i modified 'atlbase.h' and 'atlimpl.cpp' and left only those CRegKey parts, then added to my project and it worked! i mean it now can go thru the compiling. so this class just has nothing to do with the ATL. thanx for the help!
0
 

Author Comment

by:darrelliu
ID: 1322359
and, don't forget to include "stdafx.h" in your modified 'atlimpl.cpp' or you'll get hundreds of errors!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Is it possible to combine several text files into one big one? (redhat v5 enterprise) 4 82
Windows Drag & Drop Location 2 94
countEvens challenge 2 79
sum13 challenge 24 91
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now