Click here to Skip to main content
15,905,912 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CSpinButtonControl : undeclared identifier. Pin
tenwang18-Sep-08 2:19
tenwang18-Sep-08 2:19 
QuestionRe: CSpinButtonControl : undeclared identifier. Pin
Roger Stoltz18-Sep-08 2:20
Roger Stoltz18-Sep-08 2:20 
AnswerRe: Pin
tenwang18-Sep-08 18:39
tenwang18-Sep-08 18:39 
AnswerRe: Pin
Roger Stoltz18-Sep-08 21:29
Roger Stoltz18-Sep-08 21:29 
GeneralRe: Pin
tenwang18-Sep-08 21:51
tenwang18-Sep-08 21:51 
AnswerRe: Pin
Roger Stoltz18-Sep-08 22:16
Roger Stoltz18-Sep-08 22:16 
GeneralRe: Pin
tenwang18-Sep-08 23:12
tenwang18-Sep-08 23:12 
Questiongethostname() function returns errror Pin
Anu_Bala18-Sep-08 1:38
Anu_Bala18-Sep-08 1:38 
I have used the below code to determine the Host Name of the local machine in which the application is running. gethostname() function returns SOCKET_ERROR. The same code works fine in another application. Pls tell me why it is not working in my application. Should I change any Project settings.

SOCKADDR_IN sockAddr;
memset(&sockAddr,0,sizeof(sockAddr));
CString rSocketAddress;
LPHOSTENT lphost;
char HostName[80];

if (gethostname(HostName, sizeof(HostName)) == SOCKET_ERROR)
{
AfxMessageBox(WSAGetLastError());
PostQuitMessage(WM_QUIT);
}
//_tcscpy(mInstSess[ind].INSHost,HostName);
m_sInsHost = HostName;

lphost = gethostbyname(HostName);
if (lphost != NULL)
{
sockAddr.sin_addr.s_addr = ((LPIN_ADDR)lphost->h_addr)->s_addr;
rSocketAddress = inet_ntoa(sockAddr.sin_addr);
//strcpy(mInstSess[ind].INSIP,rSocketAddress);
m_sInsIP = rSocketAddress;
}



Thanks in advance

Anusuya

Anu

AnswerRe: gethostname() function returns errror Pin
Roger Stoltz18-Sep-08 1:55
Roger Stoltz18-Sep-08 1:55 
GeneralRe: gethostname() function returns errror Pin
Anu_Bala18-Sep-08 2:11
Anu_Bala18-Sep-08 2:11 
GeneralRe: gethostname() function returns errror Pin
Rajesh R Subramanian18-Sep-08 2:27
professionalRajesh R Subramanian18-Sep-08 2:27 
AnswerRe: gethostname() function returns errror Pin
Roger Stoltz18-Sep-08 2:36
Roger Stoltz18-Sep-08 2:36 
AnswerRe: gethostname() function returns errror Pin
Rajesh R Subramanian18-Sep-08 2:25
professionalRajesh R Subramanian18-Sep-08 2:25 
AnswerRe: gethostname() function returns errror Pin
Varghese Paul M18-Sep-08 5:14
Varghese Paul M18-Sep-08 5:14 
QuestionHow to find the number of files in a folder Pin
Deepu Antony18-Sep-08 1:31
Deepu Antony18-Sep-08 1:31 
AnswerRe: How to find the number of files in a folder Pin
Hamid_RT18-Sep-08 1:50
Hamid_RT18-Sep-08 1:50 
GeneralRe: How to find the number of files in a folder Pin
Deepu Antony18-Sep-08 2:04
Deepu Antony18-Sep-08 2:04 
GeneralRe: How to find the number of files in a folder Pin
Hamid_RT18-Sep-08 2:07
Hamid_RT18-Sep-08 2:07 
GeneralRe: How to find the number of files in a folder Pin
Deepu Antony18-Sep-08 3:15
Deepu Antony18-Sep-08 3:15 
GeneralRe: How to find the number of files in a folder Pin
David Crow18-Sep-08 3:35
David Crow18-Sep-08 3:35 
GeneralRe: How to find the number of files in a folder Pin
Deepu Antony18-Sep-08 4:42
Deepu Antony18-Sep-08 4:42 
GeneralRe: How to find the number of files in a folder Pin
David Crow18-Sep-08 5:18
David Crow18-Sep-08 5:18 
GeneralRe: How to find the number of files in a folder Pin
Joe Woodbury18-Sep-08 8:43
professionalJoe Woodbury18-Sep-08 8:43 
GeneralRe: How to find the number of files in a folder Pin
David Crow18-Sep-08 8:56
David Crow18-Sep-08 8:56 
GeneralRe: How to find the number of files in a folder Pin
Joe Woodbury18-Sep-08 10:38
professionalJoe Woodbury18-Sep-08 10:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.