Or are you trying to defer network activity until absolutely necessary.
exactly. i thought i could put all winsock activity in a dialogbox and that way only call it when needed. was trying to save ram and only when needed sock activity. ok will put in winmain(). was converting console sock prog to win.
also need to convert argv[] to lpcstr.
Code:
main(int argc, char **argv)
{
WORD wVersionRequested = MAKEWORD(1,1);
WSADATA wsaData;
to edit box EDITTEXT IDC_TEXTB,...., ES_AUTOVSCROLL | ES_MULTILINE | ES_WANTRETURN from .rc file.
from dialog srvrproc....
buff = (char*)GlobalAlloc( GPTR, textlen + 1);
GetDlgItemText(hwnd,IDC_TEXTB, buff , textlen + 1);
to sock
int Printsrvr(LPCSTR lpServerNameOrAddress)
{....
iaHost.s_addr = inet_addr(lpServerNameOrAddress);
instead of getting **argv from console would be getting webpage from dialogbox idc_textb editbox to buff then convert to lpcstr lpservernameoraddr hence the prob of where to put sock. page not always needed. hope that made sense. again thank you.
edit convert globalalloc buff to lpcstr lpaddr....