#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

or i tr y new one but i receive now


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

#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; 
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.