2012-07-16 32 views
0

我正在研究EPOS pos打印機(EPOS TM -T88III)。我推遲了它的驅動程序,EPOS ADK和POS for .NET我可以使用PrintDocument函數從我的pos打印機打印,但我想使用EPOS ADK。我嘗試使用「Hello OPOS for .NET」示例,但它不起作用。 因爲,我無法獲得pos打印機實例

deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName) 
m_Printer = posExplorer.CreateInstance(deviceInfo) 

我能得到deviceInfo但是,posExplorer.CreateInstance(deviceInfo)沒有返回。 Icant解​​決這個問題。 我怎樣才能解決這個問題,成功返回從posExplorer.CreateInstance(deviceInfo)的東西或有無論如何或示例代碼使用EPOS ADK打印的東西。

回答

0

你必須把它印到PosPrinter。那是正確的方法。

m_Printer = (PosPrinter)posExplorer.CreateInstance(deviceInfo) 

有關示例:在爲EPSON安裝.net ADK的OPOS時,您將獲得許多示例應用程序。你可以在你的安裝目錄中找到它們。

同時檢查您的操作系統版本和使用的IDE,PosPrinter的對象初始化不會發生在某些操作系統和IDE上。