Imports GetPrice
Dim PriceInfoRec As PriceInfo = GetPrice.PriceInfo.GetNCSPrice(PriceYear, Part, OrderQty, PriceList, InvLang)
Where PriceInfo is a class which includes 4 properties. I need these 4 properties returned in the ".p" program.
Any help would be greatly appreciated as this is the last stubbling block in a big project for me.
Which version of Progress?
GUI or TTY?
Which version of Progress?
Then check the "GUI for .NET Developers Guide". That will tell you how to use .NET Assemblies from the ABL GUI client.
Although officially you should be on 10.2B02 to use non visual .NET components. But technically 10.2A should support it.
Where is that .p being executed?
On an AppServer, in _progress or prowin32.exe?
For the Windows AppServer in 10.2A you need to turn your VB Assembly into a COM-Interop Assembly.
The 10.2A AppServer can only execute regular Windows DLLs and COM-Automation Servers.
Hi Roy,
The name "Progress 4GL Reference" tells me that you have an older version of the manual (OpenEdge 10.1A or earlier). In OE 10.1B Progress changed the name of the language to "ABL" (Advanced Business Language) to reflect it's evolution, and therefore changed the name of the manual to "ABL Reference". OpenEdge didn't support .NET until 10.2A, so the information you need about how to call .NET methods isn't in the PDF you have.
You can get all the OpenEdge 10.2A documentation here on Progress Communities at . The ABL Reference is in the ABL section. It is a syntax reference, not a tutorial, but it does include all the changes to the language needed to work with .NET classes.
For a better introduction to using .NET classes from ABL, look at "GUI for .NET Programming" in the "OpenEdge GUI for .NET" section of the documentation page. This is the book that Mike mentioned earlier in this thread. Chapter 1, "Accessing and Managing .NET Classes from ABL", should have the information you need.
Just to get you started, your VB code would look something like this in ABL:
USING GetPrice
DEFINE VARIABLE PriceInfoRec AS PriceInfo NO-UNDO.
PriceInfo = GetPrice.PriceInfo.GetNCSPrice(PriceYear, Part, OrderQty, PriceList, InvLang).
This assumes that the other variables are defined, your DLL is in the right place, etc. You can find information on deploying applications with .NET classes in the "Managing ABL Applications" book in the Deployment section of the doc page; you may also want to look at the instructions for installing the sample code in the preface of "GUI for .NET Programming".
As Mike also mentioned, in OpenEdge 10.2A you cannot call .NET methods from a non-GUI client such as the AppServer. This is due to a software implementation of a license restriction that existed in OE 10.2A, but has since been lifted.
HTH,
Roberta
Will I be able to make my dll available to my ".p" program without the development environment?
Yes.
If so, how should I deploy that dll to accomplish that?
It needs to be registered using regsvr32 as an automation server - not as an Active X control.
Then read up about using automation servers using COM-HANDLE variables. There's a reference entry for the "CREATE automation object statement ".
DEFINE VARAIBLE chHandle AS COM-HANDLE NO-UNDO .
CREATE yourvbdotnet.classname chHandle.
chHandle:YourMethodHere () .
USING GetPrice
DEFINE VARIABLE PriceInfoRec AS PriceInfo NO-UNDO.
PriceInfo = GetPrice.PriceInfo.GetNCSPrice(PriceYear, Part, OrderQty, PriceList, InvLang).
Firstly, remove the quotes.
Then change the following line so that the method call is preceded by a colon (, not point (.)
PriceInfo = GetPrice.PriceInfo.GetNCSPrice(PriceYear, Part, OrderQty, PriceList, InvLang).
-- peter
tromba99 wrote:
Peter,I have removed the quotes.I was unclear as to what you meant about the colon so I tried a number of combinations to no avail.This is my code currently:USING GetPrice.*.DEFINE VARIABLE PriceInfoRec AS GetPrice.PriceInfo NO-UNDO.
PriceInfoRec = GetPrice:PriceInfo:GetNCSPrice(PriceYear, Part, OrderQty, PriceList, InvLang).I am still getting the following error on the variable definition line:"Invalid datatype specified: GetPrice.PriceInfo. Specify a datatype such as 'character' or the name of a class."To me, nothing I can change in code after that line would have any effect on that error.It is that line(at this moment) that needs to be changed in some way to get the variable defined properly.I need to make some progess(no pun intended) on this issue soon or I have to go a whole different way in this project.Thanks for your help.
Is PriceInfo a class? Does it appear in the propath? Syntactically, that line should compile. If it's a DLL, is it in the GAC, or is it in the directory referred to by the -assemblies parameter? Is there a reference to the DLL in the assemblies.xml file? If not, you should add it. You can do so via the "Add Assembly References" context menu on the project's Reference Assemblies node.
Also, periods/dots are for package separation. Colons are for class/type and method/property separation. So I would guess that your code would need to look something like the below.
USING GetPrice.*.DEFINE VARIABLE PriceInfoRec AS GetPrice.PriceInfo NO-UNDO.
PriceInfoRec = GetPrice.PriceInfo:GetNCSPrice(PriceYear, Part, OrderQty, PriceList, InvLang).
The OO ABL doc is at http://documentation.progress.com/output/OpenEdge111/pdfs/dvoop/dvoop.pdf which may help for these kinds of questions.
-- peter