[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Translate dll vb.net code to VFP 9

Posted on 2014-04-25
10
Medium Priority
?
761 Views
Last Modified: 2014-06-02
Hi Experts.

I have a vb.net routine to access a credit card processing DLL. I Need to convert that code to use it in a Vfp9 Application.

Vb.Net code is :
----------------------
        Dim creditCard As New CredCardConnect.CreditCardClass

        creditCard.TransType = CredCardConnect.CreditCardTransTypeEnum.Sale
        creditCard.CardNum = "4012000033330026"
        creditCard.ExpDate = "0115"
        creditCard.MagData = "4012000033330026=15121011000023456789"
        creditCard.NameOnCard = "TESTCARD"
        creditCard.Amount = 1.07
        creditCard.PNRef = ""
        creditCard.ExtData = "<RegisterNum>1</RegisterNum><CustomerID>12634</CustomerID>"

        Dim rt As CredCardConnect.Gateway.Response = creditCard.Process(txtUsername.Text.Trim, txtPassword.Text.Trim, nudDown.Value, True)


        If Not IsNothing(rt) Then
            If rt.Result = 0 Then
                txtPNRef.Text = rt.PNRef
                MessageBox.Show("Approved")
            Else
                MessageBox.Show(rt.Message)
            End If
        Else
            MessageBox.Show("Error")
        END If

Open in new window


-------------------------------
Please let me know how to do it.

Thanks,
RAFARIVE
0
Comment
Question by:RAFARIVE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 16

Accepted Solution

by:
Kalpesh Chhatrala earned 2000 total points
ID: 40024273
you can use Vb.Net Code in VFP9. sample and detailed documentation given on below link

http://www.sweetpotatosoftware.com/spsblog/2007/08/08/ExecutingVBNETAndCCodeInVisualFoxPro.aspx
0
 
LVL 46

Expert Comment

by:aikimark
ID: 40024416
A COM wrapper for your .Net assembly should make it consumable to your VFP application.
0
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 40024422
My Solution is regarding Com Wrapper. please check my solution. it will solve your problem.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 40024786
As you tagged your question with DECLARE: It's not possible to use VFP DECLARE to declare an entry point to a class, neither an OLE class nor an assembly class. DECLARE can only declare a function declaration, it's return type and parameter types.

You can indeed also use OLE classes via CREATEOBJECT(), even without any previous declaration, but that's less common for assemblies, even after regasm you don't have the same access to assembly classes as to OLE classes.

So either try the interop option recommended by Kalpesh or write your own wrapper, there is no direct use option.

Bye, Olaf.


Edit 04/30: Still no time for this?

To test, what you can see and use from VFP directly you could create an instance of CredCardConnect.CreditCardClass via CREATEOBJECT("CredCardConnect.CreditCardClass") or see, if you can find this class listed for your choice, when adding an olecontrol to a form.

Then inspect what you have and can use with intellisense.
0
 

Author Comment

by:RAFARIVE
ID: 40036146
Hi!

I tried your suggestions but did not solved yet.
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 40037062
We might help further, if you share your findings. It's OK, if you still try things, I just remind you EE does start a closing procedure for threads inactive over three weeks (I think).

So thanks for at least returning, this'll keep this up for another while.

Bye, Olaf.
0
 

Author Comment

by:RAFARIVE
ID: 40075336
Hi,

I still trying. Not resolved yet..
0
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 40075353
We're standing by to help, so what are you trying and what results do you get?
If CREATEOBJECT("CredCardConnect.CreditCardClass") causes an error "class definition ... is not found", then your only chance is writing a wrapper in C# or VB.NET.

Bye, Olaf.
0
 

Author Closing Comment

by:RAFARIVE
ID: 40106357
Thanks for your solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question