c++ how to tell if the progra is ctl or mfc atl ect

sydneyguy
sydneyguy used Ask the Experts™
on
have been going through projects that  i have found on the net but how do you tell if there
mfc atl win32 console , windows form app ect is there some were that it specifes what it is in the properties some where
any help would be appreciated
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Freelance programmer / Consultant
Commented:
Have a look in the .vcproj file.

<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8.00"
	Name="xxxxxxxxxxxxxxxxxxx"
	ProjectGUID="{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}"
	RootNamespace="xxxxxxxx"
	Keyword="MFCProj"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="1"
			UseOfMFC="2"
			CharacterSet="1"
...

Open in new window

Karrtik IyerSoftware Architect

Commented:
Hi,
Do you want to find that from the program exe/dll (binary) or from source code?
If you have the source code of the project and if it was developed using visual studio, in the project properties general page it shall indicate if MFC is used or ATL is used. Both can be used either (linked) statically or dynamically.
See the screenshots below.
1> ATL
1-5-2016-6-37-45-PM.png2> MFC
1-5-2016-6-37-15-PM.png
Karrtik IyerSoftware Architect

Commented:
From a program, I normally use dependency walker tool to open the exe and see what that program depends, it normally gives a good indication on what components (windows, MFC or ATL libraries) it is dependent upon. You can download dependency walker from the link below,
http://www.dependencywalker.com/

To see the difference,
1> Build a simple console C++ with standard libraries, open the built exe in dependency walker, and save the output as text or csv.
2> Then enable MFC statically and do a similar exercise to save the output.
3> Then enable MFC as shared library.
you can compare the output produced in step 1, 2 and 3 using some diff tool like windiff or beyond compare which gives you indication about dependencies of your exe on other libraries.
Top Expert 2016

Commented:
to add to above comments:

have a look at

    properties - configuration properties - c/c++ - command line

you recognize C++/CLI (managed c++) projects immediately by /clr option and many /FU options specifying .NET assemblies (to omit 'using' clauses)

if you look at

      properties - configuration properties - c/c++ - advanced - compile as

it is

    'Default' for C++/CLI and C++ or C else.

also if you search for main function in the source files you see

   int main(array<System::String ^> ^args)      for C++/CLI and

   int main(int argc, char* argv[])                     for c/c++ console programs
   int _tmain(int argc, _TCHAR* argv[])            for wizard created console programs

   no main function                                           for mfc apps (embedded in the mfc framework)
 
   extern "C" int WINAPI _tWinMain(...)           for atl application

   extern "C" BOOL WINAPI DllMain(...)          for atl dll

the list is not complete but actually it is pretty simple to see the differences.

Sara

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial