I maintain a PowerBuilder Classic 12.5 application which has functionality to print checks on a Source Technologies MICR printer. The application has been running fine in a Windows XP environment. We are trying to move to a Windows-7 operating system and the check printing no longer works.
Here is the issue. PowerBuilder issues a PrintOpen followed by several Print commands to send command strings to the printer to unlock MICR mode and various secure fonts:
il_job = PrintOpen( )
Print(il_job,'&%STF[password]$')
Print(il_job,'&%SMCPFFFF$')
Print(il_job,'&%STP10003$')
Print(il_job,'&%STP10002$')
Print(il_job,'&%STP10001$')
Print(il_job,'&%1B$&u600D')
Print(il_job,'&%1B$*t600R')
This works fine on XP, and if you redirect the printer to "print to file", you can see the command strings right there in the file.
In Windows-7, the printer does not recognize the command strings, and in fact, just prints the commands on the check stock. If you do the same "print to file", you can see the commands in there, but each character in the command string is separated by other characters.
The following is a sample taken from the "print to" file, and you can see the string '&%SMCPFFFF$' by looking at each character that precedes an asterisk (*).
*p171Y&*p50X%*p100XS*p150XM*p200XC*p250XP*p300XF*p350XF*p400XF*p450XF*p500X$
This would seem to be a print driver issue, and in fact, Source Technologies now provides a "Universal Print Driver" which we have been told to use. Our PC support person was able to get the check printing working temporarily by re-installing the old print driver that we used on Windows XP, but as soon as the printer is turned off and on again, it resets to the new universal driver.
I tried using PrintDefineFont and PrintSetFont, to set the font to Courier Regular 8pt (which is what the Tech Support guy at Source Technologies told us we needed), but that didn't help:
PrintDefineFont(il_job, 1, "Courier", -8, 400, Fixed!, AnyFont!, FALSE, FALSE)
PrintSetFont(il_job, 1)
Can anyone help me with this issue? Or suggest where I might get help.
Thanks.
Try this: Add a new printer. Select the port your printer is connected to. Select Manufacturer: Generic, Printer: Generic/Text only. When you print to this printer it should send exactly what's in your Print statements to the printer.
Thanks Hugh, I tried your suggestion which sounded good, but unfortunately it had no effect.
As it happens, as of yesterday I did resolve the last of the printing issues. I had to address each of the special fonts (micr line, signature, check amount etc.) individually, and used a combination of using PrintDefineFont/PrintSetFont, embedded printer command strings to reset the font, and changing a Column control in the datawindow to a Text control (a printer command string is moved into this field as well as the data, and the one worked, the other didn't).
Appreciate your help.
Les
Please right click on your software and go to compatibility mode and select "Windows XP with SP3" in it, click APPLY and OK.
Confirm if the software now send print commands perfectly?
Related
I am asking the first question on this site because I'm stuck in a problem.
Sorry for my bad English.
I'm creating a DataBase with some coding on VBA.
Some days ago I wrote some code which creates a folder on a ftp server. And it was working fine!
Today I picked up the database and testing this function and it creates a folder but with a different weird name every time.
I tried everything such as: change the windows encoding, reading the ftp server manual (there aren't changes from the last time!), testing it on a different database...but nothing happened.
I post the code maybe there is something I accidentally change.
thank you for your support!
Private Sub Tester_Logger_Click() ' TESTER
Dim hConnection, hOpen As Long
' Open Internet Connecion
hOpen = InternetOpen("FTP", 1, "", vbNullString, 0)
' Connect to FTP
hConnection = InternetConnect(hOpen, "IP", "21", "MYUsername", "MYPassword", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0)
FtpCreateDirectory hConnection, "\\TestFolder"
' Close Internet Connection
Call InternetCloseHandle(hOpen)
Call InternetCloseHandle(hConnection)
End Sub
EDIT:
I can create folders with FileZilla and from Windows Command Line.
I also used the command "status" (from the windows command line) to see the proprieties:
Type : ascii, Verbose: On, Bell: Off, Prompting: On, Globbing: On, Debug: Off, Hash: Off.
The weird name when i create a directory with the code above is: "xӺ �" If I run it the second time it creates a directory with this name: "(j��"
EDIT 2: I don't have a second computer, but i tried to change ftp host service and it happen again. I don't know if it's a problem of Office/Windows Upragrading. I'm sure that i did not touched anything. I tried to use a old backup version of the Database and nothing change... i have always this strange characters when i'm creating a new directory.
When I try to upload something it seems that it can't read the name of the folders. The Folders are created correctly with FileZilla and they are there, i Checked!
I read somewhere that maybe it's a problem of encoding. There is a note on FileZilla that says if there is no matching with encoding there will be problems with characters reading.
EDIT 3: I tried to reset to default settings VBA and Microsoft Access whit regedit and nothing happened.
I also tried to use different functions;
I used InternetconnectW,InternetOpenW, and FtpCreateDirectoryW instead of internetConnectA etc... because is written on the Microsoft guide those are functions for the Unicode encoding. But it's always the same.
Please someone can help me?
Thank you.
I have an LP2844 that seems to take a print job just fine, but ignores it, I don't get any errors, and no change to the LED on the printer to indicate that it got the message.
The diagnostic prints out when I hold the button down at start up, so I knew the print head and things worked.
I managed to find that you could use the button to switch the printer to EPL1/Line Mode, and when I did that, all the text I send to it prints out, but none of the drivers are written for this anymore.
So I know the print head works, the USB cable works, and so on, because I can print in line mode, but when I switch it back to Page mode, it stops responding to commands.
I tried to do a factory reset as described on Zebra website, but when I hold down the feed button, it just keeps feeding, and never does the blinking that is described there.
Has anyone seen anything like this.
What you're experiecing looks like an issue with the EPL syntax.
Does the led blinks when you send the data and have you also checked if the EPL syntax is correct?
Have you tried to use zebradesigner to create and print a label?
I'm automating some reports using visual basic. I've recorded some scripts that worked fine by seem to have stopped working for reasons unknown. I record the following (comments added) and the script fails at a file dialog box.
session.findById("wnd[0]").resizeWorkingPane 95,22,false
session.findById("wnd[0]/tbar[0]/okcd").text = "se16"
session.findById("wnd[0]").sendVKey 0
' Run AGR_TCODES
session.findById("wnd[0]/usr/ctxtDATABROWSE-TABLENAME").caretPosition = 10
session.findById("wnd[0]").sendVKey 0
'Select Extended Name, Multiple selection
session.findById("wnd[0]/usr/btn%_I3_%_APP_%-VALU_PUSH").press
session.findById("wnd[1]").sendVKey 23
' select file
session.findById("wnd[2]/usr/ctxtDY_PATH").text = "c:\my_directory\"
session.findById("wnd[2]/usr/ctxtDY_FILENAME").text = "myfile"
session.findById("wnd[2]").sendVKey 0
Its at this point in script playback that the script just stops with the file select text inputs blank. I can type the information in, but that kinda defeats the purpose. I can't find the reasons or a cause, but lots of various upgrades have occurred, including my laptop and a reinstall of the os to WIN10. I don't really care why - but I do need to find a way around it.
There are 2 scenarios I've identified:
It appears that SAP occasionally loses the focus of dialog boxed. Use gratuitous .setfocus commands on the window to compensate
It appears that uploads via scripts may be blocked by security settings. You can do it manually, but not via script. A telltale sign is that when you record the script, your inputs are not recorded. So the DY_FILENAME.text line will be completely missing from the recording. I'm not sure how to fix this, but at least you know where to look!
Good luck with your scripts.
Operating Environment: Windows 7, Visual Studio 2010, CLR GUI.
So I've been given the unglorious task of enhancing a GUI application that is started from a command prompt. Because it is. Because poor design decisions by previous implementers. Anyway, it launches one of several GUIs depending upon the input arguments.
I'd like to be able to print back to the same command prompt window if (when) the user types something that the code doesn't understand.
Here's what I've tried (none of which output anything):
int main( array<System::String^>^ args )
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
OutputDebugString("hello");
Trace::WriteLine("hello");
Debug::Trace::WriteLine("hello");
Console::WriteLine("hello");
std::cout << "hello";
printf("hello");
return 0;
}
Thanks in advance!
Update: I don't want to use AllocConsole(), as that opens a new console that disappears along with all of the data when the application exits. Similarly, a pop-up message box won't work. I'm looking for a way to make the output persistent.
The only way I can get output from the application to date is via a message box (non-persistent) or opening a new console that disappears when the application exits (via AllocConsole() ). And I'm running from a command prompt, not the debugger's "Play" button.
Update
Why the down-vote for not doing research? I spent a day trying to solve this, looking through dozens of posts trying to find a solution, and to date I've found others looking for the same answer, but not finding it. AllocConsole() or changing the project type is always the solution, but neither is a solution for me.
Update
I added the "full code", which is the 2 statements. THAT IS ALL THE CODE. So simple. I'm skipping the start of the GUI because I don't care about that right now, I just want it to print back to the console where the application was started. The most basic HelloWorld. If there are project settings I need to post, I don't know which ones would be relevant. This is where I want to print to the console, before the GUI is ever up. I can't show the GUI if there is an error in the user input.
Right click on the project, select Properties
Under Linker -> System, Change Subsystem from Windows to Console.
A Windows subsystem application cannot write to console, but by changing the subsystem to Console (which can write to the calling console), the Form part of the application can still work (tested in Visual Studio 2010).
Is there some way [software or VM] that will let me run VP in a larger box - this is really frustrating me.
I thought, from the display, that VP21 was running in DOS, so I tried "DOSBOX", but when I tried to run the VP.exe file, it came back with:
"This program must be run under Win32", so it seems to be Windows with a weird display.
The simplest is to change the setting in VP: set Options->Environment->Screen Size to "Keep original". Then exit VP, size the window the way you want it, and run VP again.
From the command line, you can do it with the mode command:
mode 120,60
is nice and large.
It is very simple (or I missed something obvious): Make a shortcut for vp.exe and edit the proporties. You can change the layout/window size to any values that your monitor allows.
I don't think you can - the app itself preventing full screen mode. And you cannot use DOSBOX because VP21 is a true Win32bit app. You can download and install "real" TurboPascal - that one will run under DOSBOX and that you can expand full screen.