ObjectARX & Dummies

Course Index

*Course support: Click here!
*Course and User samples: Download here!

Tuesday, February 15, 2005

Appendix A - Debug versus Release

ObjectARX and ObjectBDX applications could be compiled using Debug or Release configurations. For those who are beginners with programming is very important to know what are the differences between these two types of compilation.

When your are developing an application you will pass through several steps before it reaches the deployment phase. These steps are very important to detect bugs inside your application, correct them and make your application as much secure as you can.

When you are on the phase prior to deployment you will probably need to debug your code. The debug tool, using a simplistic point of view, is just a way to follow your application execution mapping what is happening on the execution environment to the corresponding line at your source code. This tool is powerful and essential to troubleshoot your application.

To make this happen, Visual Studio compiles your code adding debug information that will allow it to map events to your source code, show variables, show memory stack, code flowing and much more. This is pretty handy and helps a lot! Matter of fact you can't live without the debug tool. Due that, your resulting application is linked with Debug versions of extensions you are using like MFC. If you deploy your Debug version to your clients they will face trouble to load it because the probably will not have those debug libraries available.

Suppose your application uses the mfc42.dll which is a common situation. When you compile your application using the Debug type it will use the mfc42d.dll which is the debug version of the original DLL. When your client tries to load the application, Windows will search for the required DLL (debug version) which does not exist in that machine and will fail to load.

Worst than deploy Debug version is do ship the debug version of those DLLs your application needs. These DLLs are for development purposes only. Please, don't do that!
There are much more issues involved on this but basically you should follow the following ground rules:
  • Use the Debug compilation for development purposes only;
  • From time to time compile and test your application with Release version because Debug compilation is more robust and may hide some runtime errors that Release version won't;
  • Don't ship debug versions of Windows or third-party libraries except for debug purposes;
  • Use the _DEBUG symbol directive to isolate parts of your code that are only interesting when debugging. For instance, some trace messages are very interesting to you but users will hate to keep seeing them every time.

At the last, debug compiled applications has a higher file size (sometimes almost 5 times greater than Release version).

5 Comments:

  • Hi Fernando,
    Thank you for the articles. You are a good hand at this.

    Valery

    By Anonymous Anonymous, at 5:28 PM  

  • Olá Fernando
    Sou um desenhador português e utilizo diariamente o Autocad (neste momento na versão 2006) usualmente crio rotinas em autolisp/visual lisp para um aumento de productividade na empresa que trabalho e até para outras empresas e desenhadores, mas neste momento estou a tentar compreender o objectARX para criar aplicações mais poderosas e mais rápidas, o que eu gostava de saber é se existe uma versão em português do seu "ObjectArx for Dummies"

    Cumprimentos
    Pedro Ferreira

    http://pwp.netcabo.pt/pedro_ferreira

    By Anonymous Anonymous, at 12:02 PM  

  • thank you!!

    By Anonymous Anonymous, at 7:42 AM  

  • tenta ir a este link: (é uma verção traduzida do website)

    http://translate.google.com/translate?hl=pt-PT&sl=en&u=http://arxdummies.blogspot.com/&sa=X&oi=translate&resnum=1&ct=result&prev=/search%3Fq%3DObjectArx%2Bfor%2BDummies%26hl%3Dpt-PT%26lr%3D

    By Anonymous Anonymous, at 6:59 AM  

  • This has been a very helful course, you should turn it into a book.

    By Anonymous Anonymous, at 7:02 PM  

Post a Comment

<< Home