Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Visual Basic program from a Visual FoxPro program
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00146763
Message ID:
00146772
Views:
26
>How do I call a Visual Basic program from a Visual Basic program with a sending value/parameter. Please help...
>
>Or if anyone know Visual FoxPro equivalent of command: printer.hDC (Visual Basic.) hDC returns a unique value (set by Windows) of the device context of an object (in this case it is the printer.) I was using a custom AcitveX control to interact with scanners in my VFP program. It works fine but I cannot print the scanned image stored in the ActiveX control. I know that I need to get the unique value defined in Windows for the printer (and in VB it is printer.hDC) There is no where in VFP could I find something similar to hDC in VB.
>
>Thank you very much for your help.

Hi Monique,

You'd have to call the Windows API to get a device context. Here's the code:
DECLARE INTEGER CreateDC IN Win32API;
   STRING @lpszDriver, STRING @lpszDevice,;
   STRING @lpszOutput, STRING @lpInitData
* lcprinter is the name of the printer as would be returned
* in the first column of an array returned by APRINTERS()
    nhDC = CreateDC('WINSPOOL', lcPrinter, 0, 0)
hth,
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform