Link to home
Start Free TrialLog in
Avatar of sydneyguy
sydneyguyFlag for Australia

asked on

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

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
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
User generated image2> MFC
User generated image
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.
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