Send raw data to the printer

I

Iouri

I have tried the code posted by Microsoft here
http://support.microsoft.com/?scid=kb;EN-US;322090

It works fine in VS2003. But when I try the same code in VS2005
I am getting the following error

PInvokeStackImbalance was detected
Message: A call to PInvoke function
'WindowsApplication2!WindowsApplication2.RawPrinterHelper::OpenPrinter' has
unbalanced the stack. This is likely because the managed PInvoke signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature.

The error is generated in the line

If OpenPrinter(szPrinterName, hPrinter, 0) Then
..........


in the class RawPrinterHelper
in the Function SendBytesToPrinter

Can somebody explain to me why it works in 2003 and geneartes an error in
2005. And what can I do to make it work in 2005

Thank you
 
R

rowe_newsgroups

Don't repost questions.

This question was replied to in the original thread.

Thanks,

Seth Rowe
 
R

rowe_newsgroups

sorry I posted this question before I saw the previous one sent by somebody

Actually, that was me ;-)

The reason I asked you to not repeat the question (or at least so
soon) is that it makes it difficult to track the progress of an issue,
since we now have to watch two threads (if we know about the other).
So others could be working to solve an issue that was already solved
in the other thread, or they might post the same suggestions as
another person in the other thread, etc. Basically, it just causes
some confusion which is annoying at best.

Thanks,

Seth Rowe
 
M

Michael M.

You can send RAW data to the printer, but, never send reheated data to a
printer!!!

sorry in advance

Mike.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

printing with rawprinter helper 1
Error Message 1
"CreateFile" APIl 2
GetKeyState 5
LPCGUID and System.Guid 1
Windos XP/2000 reboot 1
CreateToolhelp32Snapshot 2
Passing a string from a C# program to a C\C++ dll 2

Top