Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COMException when accessing a VFP created dll
Message
From
30/05/2007 21:35:26
 
 
To
30/05/2007 15:56:42
General information
Forum:
ASP.NET
Category:
Testing and debugging
Miscellaneous
Thread ID:
01229352
Message ID:
01229487
Views:
13
>Looks like an error in the Init method of the VFP class. Can you post the code from there?

Thanks Craig,

I have added some code to Calvin's to provide security, though at the moment it is unused.

Alex
DEFINE CLASS c1 as session OLEPUBLIC 
*	lAuthorized = .F.
	lAuthorized = .T. && For developement 
	cPassword   = PADR(TRANSFORM(156789*6543278*4567),16) && 16 char key
	cSessionID  = ''
	lOpen       = .T.
	PROCEDURE Init
WAIT WINDOW 'I am in '+CURDIR()

		IF NOT 'VFPENCRYPTION' $ SET("Library")
*			SET LIBRARY TO VFPEncryption.FLL ADDITIVE
		ENDIF
		This.cSessionId = TRANSFORM(RAND()*10000000000000000)

	PROCEDURE Error
	LPARAMETERS nError, cMethod, nLine
		MESSAGEBOX('nError = '+TRANSFORM(nError)+ '   cMethod = '+cMethod + '   nLine = '+TRANSFORM(nLine))
	
	PROCEDURE Authorize1
		RETURN This.EncryptEncode( PADR(This.cSessionID + CHR(0),50) )

	PROCEDURE Authorize2
	LPARAMETERS tcMessage
		LOCAL lcPlainMessage,lcSessionID
		lcPlainMessage = This.DecodeDecrypt(tcMessage)
		lcSessionID    = LEFT(lcPlainMessage,AT(CHR(0),lcPlainMessage)-1-10)
		IF This.lOpen AND This.cSessionID = lcSessionId
			This.lAutorized = .T.
		ENDIF
		This.lOpen = .F.
		RETURN

	PROCEDURE EncryptEncode
	LPARAMETERS tcText
		RETURN STRCONV(Encrypt(tcText,This.cPassword,0),13)

	PROCEDURE DecodeDecrypt
	LPARAMETERS tcText
		RETURN Decrypt(STRCONV(tcText,14))

	PROCEDURE MyDoCmd(cCmd as string,p2 as Variant,p3 as Variant,p4 as Variant,p5 as Variant) helpstring 'Execute a command|%2'
		IF This.lAutorized
			&cCmd
		ENDIF

	PROCEDURE MyEval(cExpr as string,p2 as Variant,p3 as Variant,p4 as Variant,p5 as Variant) helpstring 'Evaluate an expression|%2'
		RETURN IIF(This.lAutorized,&cExpr,'')

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform