473,382 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Draw an AxHost-derivated class.

Hello,

I have a problem with an AxHost-derived class, this class
represents a barcode for a thermal printer.
To draw the barcode it expose a method call Draw() that
receive as parameter a device context handler.
When I run the following code:

using(Graphics gr = this.CreateGraphics())
{
System.IntPtr hDC = gr.GetHdc();

//AxSerializedBarCode is derived from AxHost
AxIntermecActiveX.AxSerializedBarCode axBarCode =
new AxIntermecActiveX.AxSerializedBarCode();
axBarCode.Width = 100;
axBarCode.Height = 10;
axBarCode.Value = "1234567";
axBarCode.Draw(hDC.ToInt32(), 10, 10);
gr.ReleaseHdc(hDC);
}

an InvalidOperationException has thrown. Is there any
different method to send an activex control to a printer,
the thermal printer is installed as a normal windows
printer.

Thanks in advance.
Carlo Micieli

Nov 15 '05 #1
0 1449

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kuba Florczyk | last post by:
Hi Do anybody know how to show ActiveX whitout AxHost? For example i got wrapper to ActiveX and now i don't know how AxHost shows ActiveX. I must do it, because i think AxHost made it wrong...
2
by: Matt | last post by:
I am writing a recursive program to draw the lines recursively, given the range and number of intervals (n) between the range. The problem is I don't know how to draw the line in point 0.375, as...
0
by: Florida Draw | last post by:
------=_NextPart_000_0012_1D5428A2.65C196F8 Content-Type: text/plain Content-Transfer-Encoding: 8bit Sign-up for the FREE Holiday Giveaway Draw You must register to be eligible for the draw....
5
by: Matt | last post by:
I am writing a recursive program to draw the lines recursively, given the range and number of intervals (n) between the range. The problem is I don't know how to draw the line in point 0.375, as...
3
by: Colin McGuire | last post by:
Hi there. I have written a small procedure to draw various shapes on things. A bit of it is shown below. Private Sub drawShape(ByVal shapeType As Integer, ByRef g As Graphics) Select Case...
2
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I...
8
by: Martijn Boven | last post by:
I created a activex control in c# (vs 2005) -------------------------------------------- public partial class ActiveTest : UserControl { public ActiveTest()
3
by: Daniel Mark | last post by:
Hello all: I am looking the sample code posted on PIL website http://www.pythonware.com/library/pil/handbook/imagedraw.htm ################################################ <<Draw a Grey Cross...
0
by: schao416 | last post by:
Hello all, I'm currently using an ActiveX control that has a property called OcxState that returns a value of type LONG. However, when I try to compile my app, the compiler says OcxState...
0
by: vshra | last post by:
Hello anyone can guide me how to convert Byte Array to AxHost:State pointer?
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.