954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

*

#include "include.h"
#include "extern.h"

int ExternalIP(SOCKET Sock, char *szChannel)
{
DWORD dwRet = 0;
HANDLE hHandle;
char szIP[16] = {0};
char szTempPath[MAX_PATH] = {0};
char szTempFile[MAX_PATH] = {0};
char szSendBuffer[512] = {0};
if (!szChannel)
return false;

GetTempPath(sizeof(szTempPath) - 1, szTempPath);
GetTempFileName(szTempPath, "Temp", 0, szTempFile);
// if (URLDownloadToFile(NULL, "http://www.whatismyip.org", szTempFile, 0, NULL) == S_OK)

if (NULL, "http://www.whatismyip.org", szTempFile, 0, NULL)
{
hHandle = CreateFile(szTempFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hHandle != INVALID_HANDLE_VALUE)
{
ReadFile(hHandle, szIP, sizeof(szIP) - 1, &dwRet, NULL);
(szSendBuffer, sizeof(szSendBuffer) - 1, "Main-> External IP: %s", szIP);
/* IrcMsg(Sock, "PRIVMSG", szChannel, szSendBuffer);
irc_privmsg(Target, "Main-> External IP: %s", szIP);*/
CloseHandle(hHandle);

return 0;
(

hello guys may anyone can help me about my problem o try to compile externa.cpp but i got a problem with os


	

Compiling...
external_ip.cpp
c:\documents and settings\icemann\desktop\work_fix_me2\external_ip.cpp(34) : fatal error C1075: end of file found before the left brace '{' at 'c:\documents and settings\icemann\desktop\work_fix_me2\external_ip.cpp(23)' was matched
iceshells
Newbie Poster
6 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

or i tr y new one but i receive now


external_ip.cpp(26) : error C3861: 'snprintf_s': identifier not foun

iceshells
Newbie Poster
6 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

#include "include.h"
#include "extern.h"


int ExternalIP(SOCKET Sock, char *szChannel)
{
DWORD dwRet = 0;
HANDLE hHandle;
char szIP[16] = {0};
char szTempPath[MAX_PATH] = {0};
char szTempFile[MAX_PATH] = {0};
char szSendBuffer[512] = {0};
if (!szChannel)
return false;

GetTempPath(sizeof(szTempPath) - 1, szTempPath);
GetTempFileName(szTempPath, "Temp", 0, szTempFile);
// if (URLDownloadToFile(NULL, "http://www.whatismyip.org", szTempFile, 0, NULL) == S_OK)

if (NULL, "http://www.whatismyip.org", szTempFile, 0, NULL)
{
hHandle = CreateFile(szTempFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hHandle != INVALID_HANDLE_VALUE)
{
ReadFile(hHandle, szIP, sizeof(szIP) - 1, &dwRet, NULL);
snprintf_s(szSendBuffer, sizeof(szSendBuffer) - 1, "Main-> External IP: %s", szIP);
/* IrcMsg(Sock, "PRIVMSG", szChannel, szSendBuffer);
irc_privmsg(Target, "Main-> External IP: %s", szIP);*/
CloseHandle(hHandle);
}
}
return true;
}

iceshells
Newbie Poster
6 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: