Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBScript Passing Parameters to VFP COM object
Message
From
26/08/2000 18:19:26
 
 
To
26/08/2000 17:45:09
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00409553
Message ID:
00409563
Views:
19
Terry,

>Yes, there is a line elsewhere that calls the Visit function. Debug in Visual Interdev steps me through the call. The configure line seems to execute but when I return to the line that called the Visit Function IIS hangs. When I hard coded the values in the VFP COM object then step through in VI the system does not hang.
>
>Tried with and without parens. With parens Visual Interdev says there is a syntax error.

Sorry, I was testing by returning a value to a var, in which case the parens would be necessary.

>I don't know enough about IIS/ASP/VBScript to know a good way to figure out why the parameter passing causes the problem.

I suggest that you break it down to as simple as you can, with a new .asp page with only enough lines to init the vars, do the createobject, and test the values sent to the COM object method.

Add some properties to your COM object and stuff them with the parameters sent, like this:
DEFINE CLASS visit AS custom OLEPUBLIC
param1 = []
param2 = []

FUNCTION configure
LPARAMETERS whatever1, whatever2 ...etc
* store the params passed to properties, to be queried from outside
WITH THIS
* transform so we can easily show them in ASP
.param1 = TRANSFORM(whatever1)
.param2 = TRANSFORM(whatever2)
ENDWITH
* temporary return
RETURN
* balance of your code...
ENDFUNC
ENDDEFINE
Then, in the asp, something like this to show the values passed in, from inside the COM object (remove extra spaces I added after the < ):
< HTML>
< BODY>
< % 
const g_sitename = "Sitename"
const g_domainname = "MailDomain"
const g_appdir = "ComponentDir"

const Select_Departments = 0

const g_bodytag = _
"bgcolor=#ffffff leftmargin=0 topmargin=0 marginleft=0 margintop=0"

DIM m_visit

visit

Function visit
DIM strMessage
IF IsEmpty(m_visit) Then
Set m_visit = Server.CreateObject("govt2bus.visit")
m_visit.configure g_sitename,g_domainname, _
"DRIVER=SQL Server;DATABASE=dbname;UID=Userid;PWD=password;SERVER=localhost", _
g_appdir

Response.Write( m_visit.param1 + "< br>" )
Response.Write( m_visit.param2 + "< br>" )

END IF

END Function
%>
< /BODY>
< /HTML>
This should allow you to see what the values were inside the COM object during the configure call. I haven't done enough VI work to suggest how to debug it there, but you can use this kind of approach to narrow down the problem and verify that what you're passing in is actually getting there.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform