This is solved. I never found the problem but started again with an older file and worked my way back to functional.
Type: Posts; User: MAtkins
This is solved. I never found the problem but started again with an older file and worked my way back to functional.
I'm writing a php extension that allows users on an Intranet to print documents. PHP, and therefore the extension is written in c.
I had this just about wrapped up when a new error cropped up....
Thanks Salem. Yea I'm thinking I've started chasing a wild goose here.
I'm trying to print text using Windows GDI.
I need to specify the font size in points (ie Arial 12 point). The GDI prints it...
Thanks for your reply.
It looks *to me* like most of these solutions could cause an overflow because they could end up with a 128 bit number.
I looked at the ones using strings but I wasn't able...
I'm currently using the Windows MulDiv function to do what I need but apparently, it only works for 32 bit systems.
I'm trying to convert the size points from the screen to any given printer....
For 32 bit systems I can use the function, MulDiv to convert the screen resolution to the printer (or any device) resolution.
For my purposes, I need to convert my computer screen's points to my...
I solved this one on my own.
The problem was that the function TextOutEx is part of the Windows gdi.
When I 'set' the option changes in VALID_OPTIONS I needed to reset the device context so that...
Revision: I'm getting the correct option values both before and after I I set the values using DocumentProperties.
Still, the printer completely ignores them.
Also, I changed this line in...
Thanks Salem. You've been here a *long* time and you helped me with something unrelated to this about 4 or 5 years ago.
The code here is real old code, not written by me. It may have worked once but...
I've tried a few more things with no success.
I changed the DocumentProperties function in VALID_OPTIONS so that it ran twice, once to input the DEVMODE object and again to retrieve it.
I added a...
I'm writing an app. in c that can print.
This is a php 7 extension for printing in windows.
Here is another php extension link for the newer php 7.
I can't get certain options set which are in...
I can't tell you how much I appreciate your help (algorism especially).
I finally got this thing to return a list of printer feeders in an array to the Web page.
Again, it's PHP7 so I'm stuck...
This much worked.
I kept working with it & compiling it with more & more code.
This works. I had to remove the free(pi2) and that stopped the HTTP 500 error.
So, I think we're finally on to the...
This is strange. I tested it again. It returned an HTTP 500 error.
But - here is what was in the file:
cbBuf: 2008
GetPrinter succeeded
Port: USB001
This returned an HTTP 500 error too:
if (GetPrinter(resource->handle, 2, (LPBYTE)pi2, cbBuf, &cbBuf) == 0) {
fprintf(fp, "Error: %u\n", GetLastError());
fclose(fp);...
I get an HTTP 500 error.
I've attached the file & the header.
Well, I thought I was getting somewhere.
I still can't get the port name.
From above, this works if I replace sprintf with just a value in RETURN_STRING.
If I use sprintf to try to access...
Thanks again for your patience.
I did read the info about BINNAMES but don't know how to make a string array and wasn't sure what to put into that param.
I haven't tried your code yet but I've...
Does this work?
The output is supposed to be a string array.
I don't know how to cast/convert it.
LPTSTR *arCapabilities; //this is a pointer in Windows types...
Thanks
What does this mean?
(PRINTER_INFO_2 *) piBuf
I've got about 5,000 questions, which of course I won't ask.
But - what is the difference between:
PRINTER_INFO_2 *pi2 = (PRINTER_INFO_2)piBuf;
//and this:
PRINTER_INFO_2 pi2 =...
Boy, I wish I knew half of what you know.
How in the world do you think of this stuff?
It worked. On to the next part.
Sadly, all I wanted was the printer's port.
Thanks soooo much!!
Sorry, I've been trying to consolidate & try different suggestions.
This produced an answer "GetPrinter failed!"
It did print a file and the error code was just 0.
FILE *fp;
byte...
I still can't get this to work. It just throws an HTTP 500 error.
Unless I missed something the vars are defined & instantiated the same except the 2 that are filled by the first call (above).
...
I got this much to work (failed, no HTTP error) and it returned 0.
I also tried to return the value of pcbNeeded. It returned 2004
byte *piBuf;
long cbBuf;
char sRtn[1024];
long pcbNeeded...