• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 60
  • Last Modified:

Could you give me a way to convert a VB printer driver DLL code to a corresponding VFP one?

Hi Experts

I need to use a printer DLL ( Mp2032.dll ) that  drives a printer guillotine after a ticket print.
The manufacturer gave this VB code to do the job:

Accordingly to (in Portuguese):
Manufaturer instructions

Public Declare Function AcionaGuilhotina Lib "MP2032.DLL" (ByVal Modo As Integer) As Integer Public Declare Function ComandoTX Lib "MP2032.DLL" (ByVal BufTrans As String, ByVal Flag As Integer) As Integer

'After declare the functions, to execute ComandoTX, do like that:

'To drive the guillotine
sComando = chr(27) + chr(119) 
iRetorno = ComandoTX( sComando, Len( sComando )

'or I guess, optionally

iRetorno = AcionaGuilhotina(1)

Open in new window

Could you give me a way to convert this VB printer driver to a corresponding VFP one?

Thanks in advance!
Eduardo Fuerte
Eduardo Fuerte
  • 4
1 Solution
Paul MacDonaldDirector, Information SystemsCommented:
I LOVE VFP, but it's been dead 20 years now.  I have to ask: Why convert to it?
Eduardo FuerteAuthor Commented:

I guess last VFP release (patches) at about 10 years ago

The reason is: I have an "in production "app developed in VFP that needs this convertion.

In a similar manner that huge companies have COBOL app (40+) years old running and receiving actualizations.

I couldn't develop this app to an up to date platform. It attends philantropic institutions (no profit job, free of cost for them - very, very util for them)
This conversion is very easy but we cannot say the code is "VB or VFP printer driver".  The code just calls some printer driver represented by MP2032.DLL.
* The MP2032.DLL must be in the current folder or available on the path and it has to be 32 bit. 
* Of course, you may use full path to the DLL file

DECLARE Integer AcionaGuilhotina IN MP2032.DLL Integer MoDo
DECLARE Integer ComandoTX IN MP2032.DLL String BufTrans, Integer Flag

sComando = chr(27) + chr(119) 
iRetorno = ComandoTX( sComando, Len( sComando ))

iRetorno = AcionaGuilhotina(1)

Open in new window

As you may see VFP code is very similar to VB code. The best you can do is to test the code in Visual FoxPro Command window.

BTW, unofficial VFP patches are still under development. And official VFP tools are still supported by the community.
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Eduardo FuerteAuthor Commented:

I misconcept on the way to ask, I know that the VPF only commands a printer driver.

I'm going to make another question about details on what's going on VFP - unofficial patches etc.

Thank your always excelent help!
Eduardo FuerteAuthor Commented:
(*) Thank you for your always
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now