| From: | "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> |
|---|---|
| To: | "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | LIBPQ for WIN32 |
| Date: | 1998-09-28 04:09:47 |
| Message-ID: | 000401bdea95$d4dfb7e0$2801007e@cadzone.tpf.co.jp |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi All.
I tested libpq for win32 coming with 6.4-BETA and have a question about
LIBPQ.
I used LIBPQ from a C program,but coundn't connect PostgreSQL DB.
Calling pg_connect() without WSAStartup() failed because of gethostbyname()
error in LIBPQ.
so I modified DllMain in LIBPQ as follows.
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason,
LPVOID lpReserved ){
WSADATA wsaData;
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
WSAStartup( WSAStartup(MAKEWORD(1, 1), &wsaData);
break;
case DLL_PROCESS_DETACH:
WSACleanup();
break;
}
return (TRUE);
}
and the connection to DB was OK.
Why WSAStartup() is not called in LIBPQ?
Thanks.
Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Stan Thomas | 1998-09-28 07:08:29 | subscribe |
| Previous Message | Jon Buller | 1998-09-28 03:27:45 | spinlock code for ns32k (again) |