You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Hi...
I need to generate a DLL for use in Delphi. Is it possible?
This DLL must acess Winhttp.DLL, Msxml.DLL and CAPICOM.DLL. Is it possible too?
Thanks.
Originally posted by Pedro Caetano BarbieroView Post
Hi...
I need to generate a DLL for use in Delphi. Is it possible?
Sure. Since with PB/Win you can create standard .DLL, it's just a matter of using the right / corresponding datatypes & calling convention.
I have been recently in a similar situation: created a .DLL in PB and provided some demo code using it from various languages. If it can be of some help, you can maybe compare the PowerBASIC and & Delphi declarations / samples from the sample's package here: TrIDLib.
Bye!
-- The universe tends toward maximum irony. Don't push it.
This DLL must acess Winhttp.DLL, Msxml.DLL and CAPICOM.DLL. Is it possible too?
If your DLL imports any function in any other DLL (DECLARE ...LIB "Dllname.dll"...) , if that DLL is not available at runtime and not yet loaded in the address space of the calling process, then the load of DLL (either at program start or on explicit call to LoadLibrary) fails; and if it's a good day and the calling process is using an explicit call to LoadLibrary, the error code returned by GetLastError will tell you the load failed due to a missing import.
To take full advantage of this, you "could" make all your calls from functions in the DLL using LoadLibrary(); that way your DLL would always load into the calling process when that process starts even if one or more of the named DLLs is absent. This mght be a good plan if you are planning on distributing the DLL as a standalone product, because now every function called by the user could return an error code for missing import. But this is probably not a good idea if this DLL is part of a larger application... in this case the user would more than likely rather be notified immediately when the program starts that something is missing and the application is not going to be able to do all the things it was designed to do.
FWIW, a handy function for you might be the WinApi "SearchPath" function. It will let you check - without loading - any DLL to see if Windows is going to find it when asked to load it later.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment