Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP.dll 1

Status
Not open for further replies.

ForeverCode

Programmer
Dec 6, 2002
41
0
0
US
I'm having problems finding information on how I would load a php.dll most likely php4apache.dll and be able to use it in my app. Does anyone know how to do this? I've been searching through the Apache source but it's really hard to find what I'm looking for. Any tips would be great.

-Micah
 
Are you asking for generic "how to load a DLL" information or specific information about the PHP.DLL interface and semantics?

-pete
 
Either one...I can Load a DLL now, but I haven't been able to use any functions of a DLL. I think if I can do that I will be able to search through the PHP.DLL source and find the functions that can be used. But if anyone already knows how to use a PHP.DLL and could point me in the right direction that would make my life easier. Also, maybe some example code of a DLL and some example code of using that DLL. I haven't been able to find any code that works.
 
When DLL code is built it must "export" the functions it wants to make available to users of the DLL. When you want to call those functions from you application code you must "import" those functions.

This is typically handled in the header file that is used to both build the DLL and also share with users of the DLL.

[/code]// filename: sample.h
#ifdef DLL_BUILD
#define MY_API __declspec(dllexport)
#else
#define MY_API __declspec(dllimport)
#endif

// prototypes
MY_API int getRandomNumber();
MY_API void seedRandomGenerator( float f);[/code]

Once you have that header file containing the correct “import” declaration of a function and you have linked to the DLL you can call those functions from your code.

Code:
#include “sample.h”

void main(…){
  int n = getRandomNumber();
}

You can find detailed explanation of building/using DLL’s and sample projects on
Hope that helps
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top