Click here to Skip to main content
15,907,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to load a Dll in an ATL COM Server Pin
Ollie8-May-02 23:14
Ollie8-May-02 23:14 
GeneralMFC Extension DLL Problems Pin
Tony Fontenot8-May-02 17:51
Tony Fontenot8-May-02 17:51 
GeneralRe: MFC Extension DLL Problems Pin
Tony Fontenot8-May-02 18:12
Tony Fontenot8-May-02 18:12 
QuestionHow do I make this Unicode? Pin
Matt Newman8-May-02 17:08
Matt Newman8-May-02 17:08 
AnswerRe: How do I make this Unicode? Pin
Michael Dunn8-May-02 17:21
sitebuilderMichael Dunn8-May-02 17:21 
GeneralRe: How do I make this Unicode? Pin
Matt Newman9-May-02 11:26
Matt Newman9-May-02 11:26 
GeneralRe: How do I make this Unicode? Pin
Michael Dunn9-May-02 16:39
sitebuilderMichael Dunn9-May-02 16:39 
GeneralRe: How do I make this Unicode? Pin
Matt Newman14-May-02 15:26
Matt Newman14-May-02 15:26 
Sorry about the delay I was gone this weekend

CString strTemp;
int item = 0;

struct hostent *host;
struct in_addr *ptr;    // To retrieve the IP Address

DWORD dwScope = RESOURCE_CONTEXT;
NETRESOURCE *NetResource = NULL;
HANDLE hEnum;

WNetOpenEnum(dwScope, NULL, NULL, NULL, &hEnum);

WSADATA wsaData;

WSAStartup(MAKEWORD(1,1),&wsaData);

if (hEnum)
{
    DWORD Count = 0xFFFFFFFF;
    DWORD BufferSize = 2048;
    LPVOID Buffer = new char[2048];

    WNetEnumResource(hEnum, &Count, Buffer, &BufferSize);

    NetResource = (NETRESOURCE*)Buffer;

    char szHostName[200];

    for (unsigned int i = 0; i < BufferSize/sizeof(NETRESOURCE); i++, NetResource++)
    {
        if (NetResource->dwUsage == RESOURCEUSAGE_CONTAINER && NetResource->dwType == RESOURCETYPE_ANY)
        {
            if (NetResource->lpRemoteName)
            {
                CString strFullName = NetResource->lpRemoteName;

                char buf[512];

                if (0 == strFullName.Left(2).Compare(_T("\\\\")))
                strFullName = strFullName.Right(strFullName.GetLength()-2);
                <code>host = gethostbyname(strFullName));</code>  // Problem Spot

                if (!host) continue;

                ptr = (struct in_addr *) host->h_addr_list[0];

                sprintf(buf, "%d.%d.%d.%d", ptr->S_un.S_un_b.s_b1,
                    ptr->S_un.S_un_b.s_b2, ptr->S_un.S_un_b.s_b3, ptr->S_un.S_un_b.s_b4);\

                List->InsertItem(item++, strFullName, 0);
                List->SetItemText(item - 1, 1, (LPTSTR)buf);
                List->SetItemText(item - 1, 2, NetResource->lpComment);
            }
        }
    }


This is the original code,

-Suspicious | :suss: Matt Newman / Windows XP ActivistSuspicious | :suss:
-Sonork ID: 100.11179

01001001 00100000 01010000 01100001 01100100 00100000 01001101 01111001 00100000 01010000 01101111 01110011 01110100 00100000 01000011 01101111 01110101 01101110 01110100
AnswerRe: How do I make this Unicode? Pin
Paul M Watt8-May-02 17:24
mentorPaul M Watt8-May-02 17:24 
AnswerRe: How do I make this Unicode? Pin
Nish Nishant8-May-02 17:24
sitebuilderNish Nishant8-May-02 17:24 
GeneralUsing struct with CList Pin
Coremn8-May-02 17:07
Coremn8-May-02 17:07 
GeneralRe: Using struct with CList Pin
Paul M Watt8-May-02 17:46
mentorPaul M Watt8-May-02 17:46 
GeneralRe: Using struct with CList Pin
Christian Graus8-May-02 18:34
protectorChristian Graus8-May-02 18:34 
GeneralRe: Using struct with CList Pin
Coremn8-May-02 18:51
Coremn8-May-02 18:51 
Questionwhat happpened when casting Pin
NicholasCougar8-May-02 16:55
NicholasCougar8-May-02 16:55 
AnswerRe: what happpened when casting [edited] Pin
Nish Nishant8-May-02 17:19
sitebuilderNish Nishant8-May-02 17:19 
Generalnewb question: Pin
stupration8-May-02 16:09
stupration8-May-02 16:09 
GeneralRe: newb question: Pin
Paul M Watt8-May-02 16:17
mentorPaul M Watt8-May-02 16:17 
GeneralRe: newb question: Pin
8-May-02 22:32
suss8-May-02 22:32 
GeneralMy question more about "C" Pin
Volki8-May-02 15:36
Volki8-May-02 15:36 
GeneralRe: My question more about "C" Pin
8-May-02 16:04
suss8-May-02 16:04 
GeneralRe: My question more about "C" Pin
Nish Nishant8-May-02 17:18
sitebuilderNish Nishant8-May-02 17:18 
GeneralRe: My question more about "C" Pin
Volki9-May-02 14:31
Volki9-May-02 14:31 
GeneralTransparent windows Pin
redeemer8-May-02 12:48
redeemer8-May-02 12:48 
GeneralRe: Transparent windows Pin
Anders Molin8-May-02 13:18
professionalAnders Molin8-May-02 13:18 

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.