Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Out-Of-VFP execution of ActiveX of Report Manager
Message
From
13/10/2005 04:49:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01057851
Message ID:
01058567
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>Hi
>
>>You don't need to do that. When your work with your object is finished simply release the form and your code would end. ie:
>
>To an extent I did figured it out, though I have not done it programatically like your example (see prg below). Instead of a container I put the activex on the form class, so that is one problem down.
>
>Now I have also created a table which will be populated with stuff like the following:
>
FileName
>REPORTS\DailyDetails0001.REP
>
ShowProgress
>.T.
>
Preview
>.T.
>
ShowPrintDialog
>.F.
>
Property
>VP_CCLIENTNAME
>Venus Software Operations
>
Property
>VP_DFROMDT
>{^20051011}
>
Property
>VP_DTODT
>(^20051011}
>
Property
>VP_CSYMBOLS
>AND cSymbol IN ('INDIABULLS','GOLD','S&P CNX NIFTY',;
'TISCO','RELIANCE','INFOSYS','GHCL','GARDENSILK',;
'HMT','TCS','RELCAPITAL','INFOSYSTCH','HDFCBANK','SATYAMCOMP','WIPRO')
>
Property
>VP_LSHOWABNORMAL
>.F.
>
Title
>Daily Details
>
>These above are each and every record stored in a single memo field called prpty. Now what is scaring me is all the kinds of data that I might have to pass to the ActiveX. I still have not come that far, but the diff. types of data to pass is beyond my comprehension. Any suggestion how passing the parameters can be made more generically than converting everthing to strings and at some point, some typical (esp. numerical value) falls to pieces when sent as a string (high precision numbers come to mind).
>
>I have currently successfully passed that interim tables name to the mini.exe and but I am not able to use it in the mini.exe, I am still trying to figure this out. Though the wait window of the dbf name passed is looking okay but when I try to use it somehow it doubles the pathname before the dbf name and it won't be used.
>
>Appreciating your help.
>
>main.prg
>
LPARAMETERS tcCursor
>
>
>wait window "1 " + tcCursor
>
>LOCAL loForm
>
>
>SET CLASSLIB TO cReportManager.vcx ADDITIVE
>
>
>loForm = CREATEOBJECT("cfrmReportManager")
>
>
>wait window "2 " + tcCursor
>USE (tcCursor) AGAIN
>wait window "3 " + tcCursor
>
>SCAN
>	wait window prpty
>ENDSCAN
>
>wait window "4 " + tcCursor
>USE
>wait window "5 " + tcCursor
>
>
>loForm.RELEASE()
>
>
>*QUIT
Bhavbhuti,
There are many ways to pack and pass multiple parameters with data types. You've VFP6 SP5. You could write to a prg file at run time and compile it, put compiled code in 'bridge' table (or simply the code which is compiled on the receiving end). With this approach it looks like:
ldDate = date()
lnNumber = 123
lcName = 'Bhavbhuti'
lcBridge = sys(2015)+'.prg'

set textmerge to (m.lcBridge) noshow
set textmerge on
\\lparameters toObj
\with toObj
\ .Prop1 = {^<<transform(dtoc(m.ldDate,1),'@R 9999/99/99')>>}
\ .Prop2 = <<m.lnNumber>>
\ .Prop3 = '<<m.lcName>>'
\endwith
set textmerge to 
set textmerge off

*Receiver get m.lcBridge - name of file to read
Compile (m.tcBridge)
do (m.tcBridge) with myObject
erase (forceext(m.tcBridge,'*'))
You can use now forgotten feature of Foxpro's ability to save and restore memory variables to .mem files. ie:
clear all
clear
local lcPackageName
lcPackageName = 'myParms.mem'
PackageParms(m.lcPackageName)

lcSomeVar = "created in between"
RestoreParms(m.lcPackageName)
erase (m.lcPackageName)

Function RestoreParms && receiver
lparameters tcPackageName
restore from (m.tcPackageName) additive
disp memo like lc*
* Note that these are local as they're declared in saving routine
disp memo like _p*
endfunc

Function PackageParms && Sender
lparameters tcPackageName
local _pMyDate, _pMyDateTime, _pMyChar, _pMyNum, _pMyExpr
local array _paCollection[4,2]
_pMyDate = date()
_pMyDateTime = datetime()
_pMyChar = 'character'
_pMyNum = 12345
_pMyExpr = 'and Something in ("v1","v2")'
_paCollection[1,1] = 'Name'
_paCollection[2,1] = 'Children'
_paCollection[3,1] = 'BirthDate'
_paCollection[4,1] = 'Hobbies'
_paCollection[1,2] = 'Smith'
_paCollection[2,2] = 3
_paCollection[3,2] = {^1957/03/27}
_paCollection[4,2] = replicate("some hobby",500)
save to (m.tcPackageName) all like _p*
endfunc
You can pass Name,Value pairs as string which receiving side assigns with eval(). ie:
create table ParmCargo free (Name m, Value m)
'MyProperty', '123'
'MyDate', '{^2005/4/17}'
'MyName', '"cetin"'
'myChar', '"123"'

You can create an XML which receiver can read say with ADO.
etc

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform