SergioFeitoza Posted August 10, 2020 Posted August 10, 2020 Which kind of property or functions could I use to check, in design time, if a code is Standalone or Isapi ? . I need to do something like: If mode= standalone then AutoStartBrowser Else {Isapi} do another_thing; Quote
Daniel Prado Posted August 10, 2020 Posted August 10, 2020 Hello SergioFeitoza. As mentioned in this link https://stackoverflow.com/questions/13112257/how-can-i-tell-at-compile-time-whether-the-project-is-a-program-or-a-library, probably there is no way to do some compilation time check. What I know is that a ISAPI project is a Library, and a standalone is a program. So, if I need to do that, I would define some mark, as example, ISAPI, to the ISAPI project and PROGRAM to standalone. Then, in my code I would do something like {$IF Defined(ISAPI)} //... {$ELSEIF Defined(PROGRAM)} //Or just $ELSE, as there is just two options. //... {$ENDIF} Edit: If your project's source code first line is LIBRARY, then, it is an ISAPI project. Quote
SergioFeitoza Posted August 10, 2020 Author Posted August 10, 2020 6 minutes ago, Daniel Prado said: Hello SergioFeitoza. As mentioned in this link https://stackoverflow.com/questions/13112257/how-can-i-tell-at-compile-time-whether-the-project-is-a-program-or-a-library, probably there is no way to do some compilation time check. What I know is that a ISAPI project is a Library, and a standalone is a program. So, if I need to do that, I would define some mark, as example, ISAPI, to the ISAPI project and PROGRAM to standalone. Then, in my code I would do something like {$IF Defined(ISAPI)} //... {$ELSEIF Defined(PROGRAM)} //Or just $ELSE, as there is just two options. //... {$ENDIF} Edit: If your project's source code first line is LIBRARY, then, it is an ISAPI project. Dear Daniel. Thank you very much for your answer However, it is a little bit more difficult than I am looking for. I saw, by chance, last week, a way of doing like I wrote above. The problem is that I lost the link and I am not finding now. I will continue looking for . I think it was some kind of windows function Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.