This is really weird and annoying me. In my VS2005 Team Edition for Developers(8.0.50727.42), I cannot add a ATL Simple Object into a ATL Project.
The "Add Classs" dialog just show diabled name & Location. If I select "ATL Simple Object" and click "Add" button. It pops up a error dialog "ATL classes can only be added to MFC EXE and MFC Regular DLL projects or projects with full ATL support.". I don't think I am the only person who meet such situation. Google and MSN search doens't get me any helpful info.
I searched local file and found the error message is in file "...\VC\VCWizards\1033\common.js". After one hour of trying to hack these javascript wizard, I failed and gave up.
Is there anybody know how to work this out

VS2005 cannot add ATL Simple Object into a ATL Project?
DooH
Hello
You should try posting this question to the C++ ATL newsgroup.
http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.atl&lang=en&cr=US
Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Benjy
Hi!
We've analyzed the problem reported by Bill Armstrong (see below) and determined that the root cause of the issue is that tlbref.dll is not in the path. It is located in the .NET SDK directory (<install dir>\SDK\v2.0\bin). The workaround is rather simple: add that directory to your system path, or copy tlbref.dll to somewhere in the path. You will also have to delete the .NCB file for your project and re-open it in the IDE.
Without knowing your exact problem, I can't say whether it will help you or not. What caused the problem in Bills case were the #imports in his solution. If you used that construct, chances are, you're running into the same issue.
Regards,
Andras Tantos
Visual C++ IDE Team
johnfi
vjFlexx
Slappie
Did you ever rename or delete the file feacp.dll under your Microsoft Visual Studio 8\VC\vcpackages\
Try to restore it or put it back. I resolve the problem just like Morgan described by this way.
umanwizard
Hi!
I created "ATL service" application and was not able to add ATL Simple Object into this project.
To resolve it, you need to modify "D:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\1033\common.js":
if (oClass.IsDerivedFrom("CAtlDllModuleT") || oClass.IsDerivedFrom("ATL::CAtlDllModuleT") ||
oClass.IsDerivedFrom("CAtlModuleT") || oClass.IsDerivedFrom("ATL::CAtlModuleT") )
to
if (oClass.IsDerivedFrom("CAtlDllModuleT") || oClass.IsDerivedFrom("ATL::CAtlDllModuleT") ||
Regards Yuriy TarasovoClass.IsDerivedFrom("CAtlModuleT") || oClass.IsDerivedFrom("ATL::CAtlModuleT") ||
oClass.IsDerivedFrom("CAtlServiceModuleT") || oClass.IsDerivedFrom("ATL::CAtlServiceModuleT") )
UmaMohan
Thanks for your info.
Now, I shifted to VS2003 to create ATL project. ATL stuff works fine for VS2003.
kogkog
try to change the file common.js under your Microsoft Visual Studio 8\VC\VCWizards\1033\
search for the line
if (strTypeString == "ATL::CComModule" || strTypeString == "ATL::CAutoThreadModule" )
and change it to
if (strTypeString == "ATL::CComModule" || strTypeString == "ATL::CAutoThreadModule" || strTypeString == "WTL::CAppModule")
you need to generate the IDL file beforehand otherwise the wizard will still complain for another error.
PS: I use the WTL, and not sure whether it works for other types of project.
cyrus
StevenDH
I haven't tried modifying any of the script files, but I found that the solution described by Andras Tantos worked perfectly. I copied the tlbref.dll file to my system32 folder and the problem went away. You may have to shut down VS and delete your project's .ncb file before the problem is corrected (I can't remember if I had to do that or not). I've used this procedure on several PC's and it worked every time.
Netmaker
None of the suggested solutions worked for me.
So I opened common.js (as described above), found the function IsAtlProject, which seems to iterate through the project variables looking for an ATL based class. However, my variable count was 0, so it didn't go through the loop and returned false. I didn't know how to get the correct variable count, so I changed the function to return true; and all my problems were over
It's dirty, but oh so good.
Neil
mech3
Hello Andras:
I am experiencing the same problem (as reported originally) and your advice does not seem to help. Basically, I create a new solution and add an ATL project (exe, attributed). That goes well, but any attempt to add an "ATL Simple Object" leads to an error. An error box is displayed with message: "ATL classes can only be added to MFC EXE and MFC Regular DLL projects or projects with full ATL support."
I am using VS-2005. What is wrong
Thank you,
Arno t Lobel