i have a dll that keeps locking up when i call the function sock_init() and i have no idea why. i'll post the code and if anyone can answer i'll appreciate it.
PHP Code:
#include "dll.h"
#include <windows.h>
using namespace std;
export double sock_init()
{
WSADATA w;
int error = WSAStartup(0x0202, &w);
if (error)
{
WSACleanup();
return (static_cast<double>(0));
}
if (w.wVersion != 0x0202)
{
WSACleanup();
return (static_cast<double>(0));
}
}
dll.h
PHP Code:
#ifndef _DLL_H_
#define _DLL_H_
#define export extern "C" __declspec (dllexport)
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else
# define DLLIMPORT __declspec (dllimport)
#endif
class DLLIMPORT DllClass
{
public:
DllClass();
virtual ~DllClass(void);
private:
};
#endif