🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11094

access violation on InternetStatusCallback

#11094
From: ScOe
Date: Thu, 26 Feb 2004 21:32
37 lines
2127 bytes
Can anyone help me on this ...

typedef struct{
    HWND        hWindow;     // Window handle
    int         nStatusList;  // Identifier of the list box control to hold
the callbacks
    HINTERNET   hResource;   // HINTERNET handle created by InternetOpenUrl
    char        szMemo[512]; // String to store status memo
} REQUEST_CONTEXT;



i initialize connection:
FINet = InternetOpen ("FTPCommander", INTERNET_OPEN_TYPE_DIRECT, NULL, 0,
0);
if (FINet == NULL)
    ShowMessage ("Connection could not be established");
iscCallback = InternetSetStatusCallback(FINet,
&(INTERNET_STATUS_CALLBACK)CallMaster);

void __stdcall CallMaster (HINTERNET hInternet, DWORD_PTR dwContext,
        DWORD dwInternetStatus, LPVOID lpvStatusInformation,
        DWORD dwStatusInformationLength)
{
    REQUEST_CONTEXT *cpContext;
    cpContext = (REQUEST_CONTEXT*)dwContext;
    AnsiString szStatusText;
    switch (dwInternetStatus)
 {
        case INTERNET_STATUS_HANDLE_CREATED:
            szStatusText.sprintf ("%s HANDLE_CREATED", cpContext->szMemo);
            break;

i receive access violation on cpContext->szMemo ... so that means dwContext
doesnt exist  ....
what do i need to do to initialize those values ?
i saw part of this at MSDN
Technical Details
Message-ID: <403e6655@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,4610331582357ae2,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-26 13:40:26 PST
From: "ScOe" <cbinders@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: access violation on InternetStatusCallback
Date: Thu, 26 Feb 2004 22:32:38 +0100
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 193.198.129.8
Message-ID: <403e6655@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1077831253 193.198.129.8 (26 Feb 2004 13:34:13 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail