Adding MFC support to an ATL EXE project

Hello ,

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

Thanks in advance
Khawar091697Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
NanosConnect With a Mentor Commented:
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
 
Black_EndCommented:
include "afx.h" in your stdafx.h
and Select "Use MFC in a Shread DLL" in the General TAB in "Project Settings" Dialog
0
 
jkrCommented:
See http://support.microsoft.com/support/kb/articles/q173/9/74.asp ('HOWTO: Add MFC Support to an ATL Project')
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
jkrCommented:
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
 
Khawar091697Author Commented:
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
 
Black_EndCommented:
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
 
jkrCommented:
>>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
 
Khawar091697Author Commented:
Mr. Black End!

I have already tried manual registration but even that is failing....
0
 
Black_EndCommented:
Of Curse that it is failing, but where?, you need to debug Regsvr32 and see where the debugger is going to stop.
0
 
Khawar091697Author Commented:
how can i debug regsvr32... It just gives msg. "DllRegister server failed"
0
 
ShaunWildeCommented:
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
All Courses

From novice to tech pro — start learning today.