nice hm... any other way getting this info ? through the printer handle from OpenPrinter ?
sstoyan
Posts
-
how to recognize "real" printer in EnumPrinters? -
how to recognize "real" printer in EnumPrinters?hi, im using EnumPrinters to detect local printers on win2k. however this returns all printer devices found on the system, incl. for example also "Microsoft Office Document Image Writer" or "Adobe PDF Writer". How to programatically found out which of the detected handles is for a 'real' hardware printer? thanx
-
check if cd is burning a dischmm...i've searched a bit - is MCI_STATUS what i should be interested in ?
-
check if cd is burning a dischi! can anybody give me a hint how i can check if my cddrive is currently burning a disc? i know win xp comes with an api to burn discs, but is there a notification of some kind when the cddrive starts burning? thanx
-
activex - save graphics to filethanx, Roger, i didn't notice anybody replied to the post. i found a solution, check my previous post. i guess your idea is close to what i finally implemented - thanx !
-
activex - save graphics to filemy search led me to GdipCreateBitmapFromGraphics method and this post: http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=37541&lngWId=1 where this guy - "Avery" - gives a great hint
-
activex - save graphics to filehi - i have an mfc activex control and want to save its visuals to a file. how should i do this? the graphics on the control are created through GDI+, so should i go through Graphics contents to an Image, or may be through CDC? thanx so far i have this: CDC* pdc = GetDC(); RECT rect; GetClientRect(&rect); Graphics graphics(pdc->GetSafeHdc()); Bitmap bitmap(rect.right - rect.left, rect.bottom - rect.top, &graphics); CLSID pngClsid; GetEncoderClsid(L"image/jpeg", &pngClsid); bitmap.Save(fineName, &pngClsid, NULL); but it just outputs a black screen, which is understandable
-
add scroll bars to an activexhi, i have written an activex control in vc++ and now i want to add scroll bars to it as its graphics area is too big and may not fit into users VB Forms. so how can i do this ? thanx
-
GDI+ nonrectangular forms problemany idea why i have different results on different pc-s? my development pc is windows 2k server, i reinstalled the os, .net framework, .net sdk, and still cant get a correct window. no problems though on the xp i run on it for test
-
GDI+ nonrectangular forms problemyes, it looks very good on the picture - exactly how i want it. but to my utter dismay i cannot achieve this locally. i tried through vs.2003, then with command line csc.exe - nothing helps, and all i do is copy & paste the code you posted ... amazing .... im using .Net Framework v.1.1.4322..an idea that just came up - could you post your compiled exe file? i decided to upload mine too, here. Change: this is insane - i run the application on another machine and it is fine there! so from the very beginning the problem was in the configuration on my machine, which is obvious now, because from the start my code was exactly as the one you posted. i guess i'll have to reinstall stuff.... thanx for your patience and support! have a very merry Christmas !
-
GDI+ nonrectangular forms problemthis is still not it :( this is what your code and mine so far achieve. sorry, maybe i have mislead you, but in my code i do use FormBorderStyle.None, havent pointed it out, my mistake. however what i want to achieve is this (the part in purple). do you see the difference? i am very thankfull for your time and help.
-
GDI+ nonrectangular forms problemdont worry i would bother you for something as silly as this :) i've compiled your code and i got what i have achieved already: http://viewmoresoft.com/rez1.jpg but my goal is http://viewmoresoft.com/rez2.jpg i've setup the form so it is without the title bar etc when i do a fill of the region it fills the entire visible area, but when i want to get my poligon filled it does it not the way i want. can you see what i am trying to achieve now ?
-
GDI+ nonrectangular forms problemhi, heath, thanx for bearing with me :) no this is not a custom tab control, but a non rectangular window. the intent is for the upper poligonal(nonrectangular) part to be used as a handle to mousedrag the window by. the first part of the code is in the contructor, and the second goes inside the OnPaint override. im copying the code again - in the constructor: GraphicsPath p = new GraphicsPath(); Point[] points = { new Point(0, 0), new Point(100, 0), new Point(150, 50), new Point(250, 50), new Point(250, 350), new Point(0, 350) }; p.AddPolygon(points); this.Region = new Region(p); in the Paint override: GraphicsPath p = new GraphicsPath(); Point[] points = { new Point(0, 0), new Point(100, 0), new Point(150, 50), new Point(0, 50)}; p.AddPolygon(points); g.FillPath(new SolidBrush(Color.Aqua), p); g.DrawPath(Pens.Red, p); if you paste this directly into a windows form application code you will see what i mean (i would have posted the entire solution if i knew how to do it here :)
-
GDI+ nonrectangular forms problemhow about some ASCII art ? :) the initial window: xxxxx xxxxx xxxxx xxxxx the nonrectangular window: yyy xxxxx xxxxx xxxxx i want the yyy part colored. and thats where the coords fail me - i get something like yyy yyyyx xxxxx xxxxx all the code i use is in my first post
-
GDI+ nonrectangular forms problembut my region starts from (0, 0) and i want to fill a region starting from (0, 0) too - so it does start from there, but when i give a bottom right corner of (150, 50) it does not match with the (150, 50) point i used for the region before! and this is my problem. i understand that the root coordinates are unchaged - thats what i count on - why does the fill go with wrong coords ?
-
GDI+ nonrectangular forms problemhi i have this in the form constructor: GraphicsPath p = new GraphicsPath(); Point[] points = { new Point(0, 0), new Point(100, 0), new Point(150, 50), new Point(250, 50), new Point(250, 350), new Point(0, 350) }; p.AddPolygon(points); this.Region = new Region(p); which creates a poligonal form. i want to have the upper part colored, and im using the same coordinates, like: Graphics g = e.Graphics; Point[] points = { new Point(0, 0), new Point(100, 0), new Point(150, 50), new Point(0, 50)}; Rectangle r = new Rectangle(points); g.FillRectangle(new SolidBrush(Color.Aqua), r); but the colored part doesnt match the part of the window i expect! do i have to make coordinates shift or something? i tried rectangletoscreen etc but nothing worked ...
-
ado, ms sql server 'text' columnsthank you WideCharToMultiByte is exactly what i used
-
ado, ms sql server 'text' columnsthank you, but i know all of this already. i think i found the problem: it turns out that whenever i call _bstr_t bstr_text = adoStream->ReadText(adoStream->Size); no matter if the file is unicode or not, the data is saved to the wide char member of _bstr_t so some hacking is needed to get correct results with C char* data
-
ado, ms sql server 'text' columnsi'm stuck im trying to save a text file to sql server(in a 'text' column ); have no problem with unicode text, but with non-unicode strings after saving to the sql server i read garbage from the columns here's my code _bstr_t bstr_text = adoStream->ReadText(adoStream->Size); // dumping bstr_text shows the text here in bstr_text is ok recSet->Fields->GetItem(item)->Value = bstr_text; // debugging down to Field20::PutValue shows that correct data is being put in the field
-
CRichEditCtrl and UNICODEthank you agan. i decided not to detect if it is unicode programmatically, but still a have a small problem left - when i display unicode string there is some garbage at the beginning of the text (1-2 bytes, "FF FE" usually), any idea how to avoid it? may be i should start reading the file with StreamIn from the first ASCII code ?