我用VB.net2005开发WinCE程序,我想调用WinCE系统的打印对话框,请问该怎么写才能调用打印对话框?
客户的要求就是用vb.net2005
哪位大侠帮帮忙,在下不胜感激~
请高手帮忙!~~
我补充一下问题:
我在WinCE的机器上放了一个print.dll的文件(客户给的),然后打开一个文本文件,
选择[文件]->[打印],就弹出一个打印设置的对话框,按“OK”就可以打印了。
但现在的问题是需要用vb.net实现这一功能,即是弹出打印设置的对话框。
谢谢大家了,帮帮忙!
WINCE下的打印驱动简单完美解决方案
打印很简单4句话就搞定
CDC* pDC = GetDC();
CPRINTSTATUS CPS;
CPS.PrintImage(pDC->m_hDC,0,0,400,300);
ReleaseDC(pDC);
你可以看看blog.eeworld.net/tayosoft
tayosoft 你好,请问在你的Blog上是哪篇文章?有些都打不开,我没有开到你说的四句话。
CDC* pDC = GetDC();
CPRINTSTATUS CPS;
CPS.PrintImage(pDC->m_hDC,0,0,400,300);
ReleaseDC(pDC);
这个怎么实现,能说得具体点吗?我用的是VB.NET
http://blog.eeworld.net/tayosoft 或则 QQ:19679646 VB.NET 用托管就可以了。我的可以支持C#的。
class CEPRINT
{
public struct DEFAULT
{
static public short DMORIENT_PORTRAIT = 1;
static public short DMORIENT_LANDSCAPE = 2;
static public short DMPAPER_LETTER = 1;
static public short DMPAPER_LEGAL = 5;
static public short DMPAPER_A4 = 9;
static public short DMPAPER_B4 = 12;
static public short DMPAPER_B5 = 13;
static public short DMRES_DRAFT = -1;
static public short DMRES_HIGH = -4;
static public short DMCOLOR_MONOCHROME = 1;
static public short DMCOLOR_COLOR = 2;
};
///
/// 首先必须调用这个函数后其它的函数才有效。否则出错
///
///
[DllImport("CEPRINT.DLL", EntryPoint = "CE_ShowPrintDialog")]
public static extern bool ShowPrintDialog();
/*
[DllImport("CEPRINT.DLL", EntryPoint = "CE_StartPrint")]
public static extern bool StartPrint();
[DllImport("CEPRINT.DLL", EntryPoint = "CE_StopPrint")]
public static extern bool StopPrint();
[DllImport("CEPRINT.DLL", EntryPoint = "CE_ExitPrint")]
public static extern bool ExitPrint();
*/
[DllImport("CEPRINT.DLL", EntryPoint = "CE_PrintImage")]
public static extern bool PrintImage(IntPtr hdc, UInt32 nStartX, UInt32 nStartY, UInt32 nWidth, UInt32 nHeight);
[DllImport("CEPRINT.DLL", EntryPoint = "CE_GetPrintName")]
public static extern bool GetPrintName(StringBuilder strPrintBuffer, int size);
[DllImport("CEPRINT.DLL", EntryPoint = "CE_GetPortName")]
public static extern string GetPortName(StringBuilder strPortBuffer, int size);
[DllImport("CEPRINT.DLL", EntryPoint = "CE_GetOrientation")]
public static extern short GetOrientation();
[DllImport("CEPRINT.DLL", EntryPoint = "CE_GetPapersize")]
public static extern short GetPapersize();
[DllImport("CEPRINT.DLL", EntryPoint = "CE_GetPrintQuality")]
public static extern short GetPrintQuality();
[DllImport("CEPRINT.DLL", EntryPoint = "CE_GetColor")]
public static extern short GetColor();
}
你可以把C#转换成VB.NET 都一样的。2005可以自动转换的。