Up to date ISAPI include and example (64bit ready)
Re: Up to date ISAPI include and example (64bit ready)
Hi
Do you know if there is a method that is called when the dll is first loaded where I could do some initialization? I would like to load some Chilkat tools and I thought it would be best just to do them once and not on every request. I am assuming that one the dll is loaded it stays in memory.
Thanks,
simon
Do you know if there is a method that is called when the dll is first loaded where I could do some initialization? I would like to load some Chilkat tools and I thought it would be best just to do them once and not on every request. I am assuming that one the dll is loaded it stays in memory.
Thanks,
simon
Simon White
dCipher Computing
dCipher Computing
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: Up to date ISAPI include and example (64bit ready)
Why yes. Yes there is! Use the normal DLL procedure of 'AttachProcess()' to initialize globally. I use it to open and read html files as well as setup database connections.
I use the ISAPI procedure 'TerminateExtension()' to clean up.
I use the ISAPI procedure 'TerminateExtension()' to clean up.
Re: Up to date ISAPI include and example (64bit ready)
Hi Rich
I was just about to reply to myself because I discovered the AttachProcess discussion in the PB docs then I read your response. Thanks for confirming my discovery.
I do have a question though. I want to populate a structure with several Chilkat objects so I assume I should declare the structure in the AttachProcess procedure as Global so I can access it from the HttpExtensionProc() procedure.
Simon
I was just about to reply to myself because I discovered the AttachProcess discussion in the PB docs then I read your response. Thanks for confirming my discovery.
I do have a question though. I want to populate a structure with several Chilkat objects so I assume I should declare the structure in the AttachProcess procedure as Global so I can access it from the HttpExtensionProc() procedure.
Simon
Last edited by swhite on Fri Nov 10, 2017 9:21 pm, edited 1 time in total.
Simon White
dCipher Computing
dCipher Computing
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: Up to date ISAPI include and example (64bit ready)
I do have a question though. I want to populate a structure with several Chilkat objects so I assume I should declare the structure in the AttachProcess procedure as Global so I can access it from the HttpExtensionProc() procedure.
Simon
Simon
Simon White
dCipher Computing
dCipher Computing
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: Up to date ISAPI include and example (64bit ready)
Exactly! You can also declare Globals at the beginning of your DLL as well, prior to the procedures.
Re: Up to date ISAPI include and example (64bit ready)
Hi
I am attempting to use the ChilKat http library in my ISAPI extension but I always get an error on ckHttp::ckCreate() method. I need the Chilkat software because I have to issue an HTTP post command over SSL to get some data that will be returned from the dll. My code works perfectly if I compile everything as a plane console application but once I convert it to a shared dll with the initilization code in the AttachProcess method I get and error on Chilkat ckCreate() method. All the code prior to this works fine. So I am wondering whether it is possible to include their code in my dll.
Thanks,
Simon
I am attempting to use the ChilKat http library in my ISAPI extension but I always get an error on ckHttp::ckCreate() method. I need the Chilkat software because I have to issue an HTTP post command over SSL to get some data that will be returned from the dll. My code works perfectly if I compile everything as a plane console application but once I convert it to a shared dll with the initilization code in the AttachProcess method I get and error on Chilkat ckCreate() method. All the code prior to this works fine. So I am wondering whether it is possible to include their code in my dll.
Thanks,
Simon
Simon White
dCipher Computing
dCipher Computing
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: Up to date ISAPI include and example (64bit ready)
I am not familiar with the specifics around ChilKat, but you can certainly utilize static or dynamic libraries, just as you would in a console application.
Solved: Up to date ISAPI include and example (64bit ready)
Hi
I found the problem with Chilkat. They are using modules and the code that initializes the Global variables is not contained in a procedure so for DLLs it never gets executed. So I moved the global declarations into a new procedure called ckInitGlobals() and call this procedure from the AttachProcess() method and everything works just fine.
I found the problem with Chilkat. They are using modules and the code that initializes the Global variables is not contained in a procedure so for DLLs it never gets executed. So I moved the global declarations into a new procedure called ckInitGlobals() and call this procedure from the AttachProcess() method and everything works just fine.
Simon White
dCipher Computing
dCipher Computing
Re: Up to date ISAPI include and example (64bit ready)
Hi
I contacted Chilkat and they are going to change the way they structure their Purebasic modules so they will work with an exe or a shared dll. They said it should be done in several days.
Simon
I contacted Chilkat and they are going to change the way they structure their Purebasic modules so they will work with an exe or a shared dll. They said it should be done in several days.
Simon
Simon White
dCipher Computing
dCipher Computing
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL