Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C++ error calling a fox dll
Message
From
21/09/2004 10:02:16
 
 
To
20/09/2004 15:49:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00944185
Message ID:
00944531
Views:
9
>Hi
>We have a isapi filter for our website write in c++ version 6 we receive sometime an error message at runtime "R6025 pure virtual function call"
>
>Below is the code we use. If someone have any idea how to correct the problem this will help us
>
>Thanks
>
>
>
>#include <afx.h>
>#include <stdio.h>
>#include <stdlib.h>
>#include <httpfilt.h>
>
>#import "d:\systemes\applic\sitebssfd\sitebssfd.tlb"	// Définition du DLL Fox
>//#import "D:\temp\test.tlb"	// Définition du DLL Fox
>
>
>// définition du type AUTH_COMPLETE
>#define SF_NOTIFY_AUTH_COMPLETE             0x04000000
>
>typedef struct _HTTP_FILTER_AUTH_COMPLETE_INFO
>{
>   BOOL (WINAPI * GetHeader) (
>      struct _HTTP_FILTER_CONTEXT * pfc,
>      LPSTR lpszName,
>      LPVOID lpvBuffer,
>      LPDWORD lpdwSize
>      );
>   BOOL (WINAPI * SetHeader) (
>      struct _HTTP_FILTER_CONTEXT * pfc,
>      LPSTR lpszName,
>      LPSTR lpszValue
>      );
>   BOOL (WINAPI * AddHeader) (
>      struct _HTTP_FILTER_CONTEXT * pfc,
>      LPSTR lpszName,
>      LPSTR lpszValue
>      );
>   BOOL (WINAPI * GetUserToken) (
>      struct _HTTP_FILTER_CONTEXT * pfc,
>      HANDLE * phToken
>      );
>   DWORD HttpStatus;
>   BOOL  fResetAuth;
>   DWORD dwReserved;
>} HTTP_FILTER_AUTH_COMPLETE_INFO, *PHTTP_FILTER_AUTH_COMPLETE_INFO;
>
>
>BOOL WINAPI __stdcall GetFilterVersion(HTTP_FILTER_VERSION * pVer)
>{
>    pVer->dwFlags = (SF_NOTIFY_NONSECURE_PORT | SF_NOTIFY_AUTH_COMPLETE | SF_NOTIFY_ORDER_DEFAULT); //  Spécifier le type de notification
>
>    pVer->dwFilterVersion = HTTP_FILTER_REVISION;  //Version interne du filter
>
>    strcpy( pVer->lpszFilterDesc, "Filtre Bssfd 1.0"); //Version dans la propriété
>
>    return TRUE;
>}
>
>DWORD WINAPI __stdcall HttpFilterProc(HTTP_FILTER_CONTEXT * pfc, DWORD NotificationType,VOID * pvData)
>{
>	char cUserName[33]; // Usager
>	char cUrl[512]; // Url
>	DWORD wLongUser = sizeof(cUserName); // Longueur du buffer
>	DWORD wLongUrl = sizeof(cUrl); // Longueur du buffer
>
>	_variant_t vUrl,vUserName,vUrlRetour;	// declare variant variables.
>	_bstr_t res;
>
>	PHTTP_FILTER_AUTH_COMPLETE_INFO pFACI;
>
>
>	using namespace sitebssfd;	//use the PostSetup namespace
>	IcommunPtr psetup;    // declare a smart ptr to the server
>
>	switch ( NotificationType )
>    {
>
>		case SF_NOTIFY_AUTH_COMPLETE:
>			pFACI = (PHTTP_FILTER_AUTH_COMPLETE_INFO)pvData;
>
>			pFACI->GetHeader(pfc, "url", cUrl, &wLongUrl); // Lecture de l'URL
>			pfc->GetServerVariable(pfc,"LOGON_USER", cUserName,  &wLongUser);  //Lecture de l'usager
>
>			vUrl = cUrl;  // Tranformer l'URL en variant pour le passer à fox
>			vUserName = cUserName; // Tranformer l'usager en variant pour le passer à fox
>
>			CoInitialize(0);			// initialize COM
>			psetup.CreateInstance("sitebssfd.commun");	//create an instance
>			vUrlRetour = psetup->verifieaccespage(&vUserName,&vUrl);  // Appel de la fonction Fox
>			psetup->detruireobj();
>			psetup = 0;				// release the server
>			CoUninitialize();		//uninitialize COM
>
>			res = vUrlRetour.bstrVal;
>			pFACI->SetHeader(pfc, "url", res); // Écriture de l'URL
>
>			break;
>
>		default:
>			break;
>    }
>
>    return SF_STATUS_REQ_NEXT_NOTIFICATION;
>}
>
Hi Michel,

I can't offer much help in this problem, but my guess would be this line (casting VOID* type)
pFACI = (PHTTP_FILTER_AUTH_COMPLETE_INFO) pvData;
You might need to trace it and/or the code that has relation to it

Look here:

C Run-Time Error R6025
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/R6025.asp

PRB: Cause of the R6025 Run-Time Error
http://support.microsoft.com/default.aspx?scid=kb;en-us;125749

Regards
Herman
Previous
Reply
Map
View

Click here to load this message in the networking platform