Solved

Adding MFC support to an ATL EXE project

Posted on 2001-08-01
11
460 Views
Last Modified: 2013-12-04
Hello ,

Can somebody please write me the detailed steps to add MFC support to an ATL EXE / Service project.

Thanks in advance
0
Comment
Question by:Khawar091697
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +2
11 Comments
 
LVL 1

Expert Comment

by:Black_End
ID: 6341131
include "afx.h" in your stdafx.h
and Select "Use MFC in a Shread DLL" in the General TAB in "Project Settings" Dialog
0
 
LVL 86

Expert Comment

by:jkr
ID: 6341189
See http://support.microsoft.com/support/kb/articles/q173/9/74.asp ('HOWTO: Add MFC Support to an ATL Project')
0
 
LVL 86

Expert Comment

by:jkr
ID: 6341205
Ooops, the above should have been an answer: http://support.microsoft.com/support/kb/articles/q173/9/74.asp ('HOWTO: Add MFC Support to an ATL Project')
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:Khawar091697
ID: 6341674
But I have already tried these things and that article. The problem is that while the VC IDE is doind "Performing registeration", it fail and gives error that "instruction at <address> referenced memory location at (). The memory could not be read."

This thing is creating problems...

Thanks for help and further help will be appreciated
0
 
LVL 1

Expert Comment

by:Black_End
ID: 6341730
Well you didn't told us about this part...
I advice you to debug the reg, here is how:

remove from the Custom Build step of you ATL project the register part, then open RegSvr32.exe and give the the name of your ATL DLL/EXE as program argument. now run the program and see where it fails.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6341735
>>instruction at <address> referenced memory
>>location at (). The memory could not be read."

Then, please ask that as your question - I wouldn't have dug up that article (which *is* the answer to "Can somebody please write me the detailed steps to add MFC support to an ATL EXE / Service project") if I knew that your problem is related to DevStudio rather than programming? (Q:"How do I get to the nearest gas station?" A:"<description>" C:"Yes, but my car is broken")...

Get the most recent service pack for DevStudio and apply it: http://msdn.microsoft.com/vstudio/sp/vs6sp5/default.asp
0
 

Author Comment

by:Khawar091697
ID: 6343557
Mr. Black End!

I have already tried manual registration but even that is failing....
0
 
LVL 1

Expert Comment

by:Black_End
ID: 6343967
Of Curse that it is failing, but where?, you need to debug Regsvr32 and see where the debugger is going to stop.
0
 

Author Comment

by:Khawar091697
ID: 6344023
how can i debug regsvr32... It just gives msg. "DllRegister server failed"
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6344070
load dll project into visual studio - go to debug settings - use regsvr32 as the app and use the settings to point to your dll - place breakpoint in Dllregisterserver - hit debug
0
 

Accepted Solution

by:
Nanos earned 300 total points
ID: 7156721
I am quite new with ATL/Services, so bare with me. I have a few projects which have MFC support for file types, and all I added were the includes to the stdafx.h file.
It may be possible that the extra things added may corrupt something u've done, so try just adding the the includes to the bottom of your stdafx.h
#include <afxwin.h>
#include <afxdisp.h>
#include <afxext.h>

if u've already followed the file from MSDN reverse all that.. I just added these lines, and got MFC support for an ATL.. I think what the MSDN is trying to do is change the ATL into an MFC app, or something like that.

good luck
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 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