skafy Posted January 14, 2016 Share Posted January 14, 2016 Hello, how could I simply change from Standalone version to ISAPI modulu without moving the code from project to project. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted January 14, 2016 Share Posted January 14, 2016 Very easy... You just comment or incoment {$define UNIGUI_VCL} in your Source Project : ************************************************************************** {$define UNIGUI_VCL} // ISAPI --> Comment this line with // {$ifndef UNIGUI_VCL}library{$else}program{$endif} Project1;useswindows,ShellAPI,SysUtils,uniGUIISAPI,Forms,DataModule in 'DataModule.pas' {DM: TDataModule},MainModule in 'MainModule.pas' {UniMainModule: TUniGUIMainModule},Main in 'Main.pas' {MainForm: TUniForm};{$R *.res}{$ifndef UNIGUI_VCL}exportsGetExtensionVersion,HttpExtensionProc,TerminateExtension;{$endif}begin{$ifdef UNIGUI_VCL}ReportMemoryLeaksOnShutdown := True;Application.Initialize;TUniServerModule.Create(Application);// run directly in Browserif extractFileExt(GetModuleName(Hinstance))='.exe' thenshellExecute(Application.Handle,PChar('Open'),PChar('Http://127.0.0.1:8077'),Nil,Nil,SW_Show);Application.Run;{$endif}end. ************************************************************************** Best regards... Quote Link to comment Share on other sites More sharing options...
skafy Posted January 14, 2016 Author Share Posted January 14, 2016 And where dll file is created that i can use? Quote Link to comment Share on other sites More sharing options...
mierlp Posted January 14, 2016 Share Posted January 14, 2016 After you comment out like Abaksoft explained close and reopen the project (this is important) Then compile again and you will find the .dll at the same location as the .exe file Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted January 14, 2016 Share Posted January 14, 2016 it's very simple: 1. Comment out the first line : // {$define UNIGUI_VCL} 2. Close your project, then re-open it 3. Compile and build it again. 4. You will obtain your : Project1.dll 5. Create a Folder in D:\ and name it for example D:\MyWebDoc 6. Copy your project1.dll there. 7. Now, you have to create your server application : Don't worry, just follow the Unigui.pdf guide (C:\Program Files\FmSoft\Framework\Unigui\Docs) At this point, in a brief description : you will create an alias (let say MyAlias) to your folder (D:\MyWebDoc) wich contains your project1.dll. You can see "Chee Yang Chau" setting for win 7, 8 and 10: http://chee-yang.blogspot.com/2009/10/configure-windows-7-iis7-for-isapi-dll.html 8. Now, all ils ready. Just call your project from your browser like this: 192.168.0.1/MyAlias/project1.dll (192.168.0.1 is your IP local server) • You can run it from any local machine (intranet) • You can suscribe for a VPS (Virtual Private Server) and run it from any device on the world (desktop, tablet, smartphone...) with any system (Microsoft, Android, Mac Os, and soon linux !?). Best regards. Quote Link to comment Share on other sites More sharing options...
skafy Posted January 15, 2016 Author Share Posted January 15, 2016 Ok. I've done that. Now i'm publishing it in server IIS7.5. I also download runtime ext js package but i get message loading... Whaut could that be? Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted January 15, 2016 Share Posted January 15, 2016 Many reasons for that. Please check : 1. First download the latest Trial UNIGUI 12.58 You have not to download runtime ext js package from Sencha. It's an OEM embeded ext JS version 4.2.4.1720) 2. Important : If your server (your machine) is windows 64 bits, and your Project1.dll is 32 bits (on Delphi Target PlatForms), then Enable your Pool Application to accept 32 bit = TRUE. 3. Not important but will enhance the dll launching : Your Project1.dll will be smaller with a Buid Configuration = Release 4. Restart your iis Server : 5. Check your RDBM version 64 or 32 : That must be the same in your development and on your server. Good Luck Quote Link to comment Share on other sites More sharing options...
rgreat Posted January 15, 2016 Share Posted January 15, 2016 it's very simple: 1. Comment out the first line : // {$define UNIGUI_VCL} 2. Close your project, then re-open it 3. Compile and build it again. 4. You will obtain your : Project1.dll 5. Create a Folder in D:\ and name it for example D:\MyWebDoc 6. Copy your project1.dll there. 7. Now, you have to create your server application You can add {$EXTENSION } compiler directive after programm/library lines.{$EXTENSION dll} {$EXTENSION exe} This way you can skip reopening project. 1 Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted January 15, 2016 Share Posted January 15, 2016 Great rgreat. All feedback are important. Thx. +1 Quote Link to comment Share on other sites More sharing options...
dunham Posted February 9, 2016 Share Posted February 9, 2016 You can add {$EXTENSION } compiler directive after programm/library lines. {$EXTENSION dll} {$EXTENSION exe} This way you can skip reopening project. in XE7 --> Project ---> view source , there is no lines with program or library , so how to convert project to isapi , the above method is not working Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted February 9, 2016 Administrators Share Posted February 9, 2016 in XE7 --> Project ---> view source , there is no lines with program or library , so how to convert project to isapi , the above method is not working Above instructions are only valid for ISAPI/StandAlone Combo projects. Quote Link to comment Share on other sites More sharing options...
dunham Posted February 9, 2016 Share Posted February 9, 2016 Above instructions are only valid for ISAPI/StandAlone Combo projects. Thank you, i 'll remade the project selecting with ISAPI/StandAlone Quote Link to comment Share on other sites More sharing options...
psborges Posted May 14, 2016 Share Posted May 14, 2016 I'll try. then put the result here. Thank you very much Quote Link to comment Share on other sites More sharing options...
lema Posted May 14, 2016 Share Posted May 14, 2016 In Delphi 2010 that I was using for several years , I had no problem changing the target through the directive UNIGUI_VCL. The name in project manager was changing accordingly (Project.exe / Project.dll) , I had not even the need of closing and re-opening the whole project. Now, I evaluate the Seattle and the method of changing (commenting out) the compiler directive in project source doesn't seem to work for the project name showing in IDE - Project manager, even with closing and re-opening project and/or Delphi itself. For example , you see in the IDE that the target is the Project.dll , but the directive UNIGUI_VCL is active and the linker will link the project into the Project.exe. This will drive into misunderstandings. The workaround I use is the following . I create new configurations xxx_exe and xxx_dll I remove the {$define UNIGUI_VCL} from project source. In xxx_exe configurations, I add the UNIGUI_VCL in conditional defines and exe as Target file extension In xxx_dll configurations, I just change the Target file extension to dll Please correct me if there is any easier way to jump from library to program linking. Quote Link to comment Share on other sites More sharing options...
MVakili Posted May 21, 2016 Share Posted May 21, 2016 it's very simple: 1. Comment out the first line : // {$define UNIGUI_VCL} 2. Close your project, then re-open it 3. Compile and build it again. 4. You will obtain your : Project1.dll 5. Create a Folder in D:\ and name it for example D:\MyWebDoc 6. Copy your project1.dll there. 7. Now, you have to create your server application : Don't worry, just follow the Unigui.pdf guide (C:\Program Files\FmSoft\Framework\Unigui\Docs) At this point, in a brief description : you will create an alias (let say MyAlias) to your folder (D:\MyWebDoc) wich contains your project1.dll. You can see "Chee Yang Chau" setting for win 7, 8 and 10: http://chee-yang.blogspot.com/2009/10/configure-windows-7-iis7-for-isapi-dll.html 8. Now, all ils ready. Just call your project from your browser like this: 192.168.0.1/MyAlias/project1.dll (192.168.0.1 is your IP local server) • You can run it from any local machine (intranet) • You can suscribe for a VPS (Virtual Private Server) and run it from any device on the world (desktop, tablet, smartphone...) with any system (Microsoft, Android, Mac Os, and soon linux !?). Best regards. Hi tanks for a good step by step working I did all of this steps and get this msg An Exception has occured in application: Cannot create file "C:\inetpub\eds7\cache\EDS7_dll\res\app_main_icon.ico". The system cannot find the path specified Restart application I stop the www server and start it again and made all of the folders again but I have error yet may help me ? Quote Link to comment Share on other sites More sharing options...
albertovesx Posted May 24, 2016 Share Posted May 24, 2016 How can I convert an standalone project to Isapi if I already create it as standalone and not as combo standalone/isapi? Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted May 24, 2016 Share Posted May 24, 2016 Hello Alberto, To see the difference, you can compare the Source Project of a standalone project and an isapi project. -------- Just add in your standalone source project : 1. library Project1; 2. uniGUIISAPI in your uses 3. exports GetExtensionVersion, HttpExtensionProc, TerminateExtension; Best regards. 1 Quote Link to comment Share on other sites More sharing options...
albertovesx Posted May 24, 2016 Share Posted May 24, 2016 Hello Alberto, To see the difference, you can compare the Source Project of a standalone project and an isapi project. -------- Just add in your standalone source project : 1. library Project1; 2. uniGUIISAPI in your uses 3. exports GetExtensionVersion, HttpExtensionProc, TerminateExtension; Best regards. Thank you. Quote Link to comment Share on other sites More sharing options...
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.