Translate some Visual Studio code - Forum - OpenEdge Development - Progress Community

Translate some Visual Studio code


Translate some Visual Studio code

This question is not answered


We need to replace some Visual studio code with Progress code but I have no idea how i need to translate the following:
ExtensionManager.Instance.Invoke(Of IPaymentHandlerExtension)(Sub(x) x.HandlePayment(paymentId, amount, comment))

Can someone give me a direction?


All Replies
  • @Mike: As far as I know there is no documentation available.

    It's a combination of a c#-project written by some guy (doesn't work there anymore) and a vb-project written by another programmer (also doesn't work there anymore) where another programmer makes a call to from on another vb-project (as far as I understand).

    The latter programmer still works there but only knows that his code makes everything work fine for the last # years.

    Now they want to change to our software but still want to keep using this functionality.

    The easiest way to do that is by trying to translate the code of the latest vb-project (it's only a few lines) to Progress code because if we hare to re-write the whole functionality ....

    Maybe you can spare some time in Dublin to take a look @this (ofcourse with some drinks nearby)

    @jquerijero: I'm not sure I completely understand but what I do not understand is why I can not call that HandlePayment function directly. I also do not see how this code will make the whole thing work but ok if this worked in the past with the vb-code it should work with the Progress-code i guess.



  • So you’re translating VB.NET code calling into C# classes.
    Do you have the source code of the C# classes available?
    Maybe we should offer you a few hours of consultancy to get that working?

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • As far as i understand it's like that.

    Now thanks for the offer, I also contacted that latest vb-programmer and asked him if he can make  some class that does everything that is needded and that I just can instantiate.

    I will wait on that answer before I will proceed to contact our managament about your consultancy

  • DenDuze
    I'm not sure I completely understand but what I do not understand is why I can not call that HandlePayment function directly.

    You should be able to if you can get the extension instance.

    The problem you are facing, as I understand it, is that the extensions are loading dynamically. My suggestion is actually iterating through the dynamic instances and then check the instance type. You can save the dynamically created extension instances to a temp-table or a generic collection. While iterating, if the instance type matches iPaymentHandleExtension using TYPE-OF, then you can certainly just call HandlePayment directly using CAST. This code can replace the call to Invoke.