Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COMException when accessing a VFP created dll
Message
From
30/05/2007 23:10:38
 
 
To
30/05/2007 21:35:26
General information
Forum:
ASP.NET
Category:
Testing and debugging
Miscellaneous
Thread ID:
01229352
Message ID:
01229491
Views:
15
You need to remove the WAIT WINDOW and MESSAGEBOX. VFP COM DLLs cannot have any UI.

Also, you should provide the full path to the VFPEncryption.fll.

>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
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform