|
I have a Visual C++ application. In my application I show a list of all the
printers installed. I get the
list of priters with EnumPrinters() function and level 2. However I am
interested only in fetching a list of physical printers and not the Virtual
Priters like "Microsoft Office Document Image Writer" and "Adobe PDF".
How does one distinguish a physical printer from a virtual printer?
I have already looked up DeviceCapabilities() API and DEVMODE structure and
EnumPrinters() with different values for the parameter "Level". But nothing
seems to return valid information to identify if a pinter is virtual or
physical printer. Can someone provide some pointers? Links to some sample
code? thanks in advance.
|
|
|
|
|
You should enumerate the different buses like the USB bus to get all connected devices.
Even then it is not guaranteed that a detected printer is not virtual because some packages like the Device Simulation Framework (DSF) from Microsoft installs a bus driver at the lowest layer in the stack which helps create virtual devices like printers.
|
|
|
|
|
lek258 wrote: In my application I show a list of all the printers installed. I get the list of priters with EnumPrinters() function and level 2. However I am interested only in fetching a list of physical printers and not the Virtual Priters like "Microsoft Office Document Image Writer" and "Adobe PDF".
How does one distinguish a physical printer from a virtual printer?
Did you, or someone that looks like you, ask this same question over four years ago?
Also see here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
What do you have against virtual printers? I think a pdf printer is one of the best IT tools...
And it saves tons of paper.
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
Hi sir,
I have some data in combo box,
First if i select any data from ComboDropDown.
The value is coming as "empty"
Second time if i select and data ,its displaying the value
Any idea,For your information,here is the code
void CTest1View::OnSelchangeCombo1()
{
CString SelectedOption;
m_ctrlCombo.GetWindowText(SelectedOption);
AfxMessageBox(SelectedOption);
}
For Example :
ComboBox Contains values "A","B","C".
If First i select any value from ComboBox i.e either A,B or C
Its showing empty,second time its working fine.
Am i doing anything wrong
|
|
|
|
|
See here [^] (i.e. Please don't cross-post).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OK, I've been away for a while and it looks like you're faster than you were ever.
I am nothing special; of this I am sure. I am a common man with common thoughts, and I’ve led a common life. There are no monuments dedicated to me and my name will soon be forgotten, but I’ve loved another with all my heart and soul, and to me, this has always been enough. - The Notebook
|
|
|
|
|
Rajesh R Subramanian wrote: OK, I've been away for a while
St. Peter & Paul is a holyday in Mumbai as it is in Rome?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Try this instead:
CString str;
m_Combo.GetLBText(m_Combo.GetCurSel(), str);
AfxMessageBox(str);
I am nothing special; of this I am sure. I am a common man with common thoughts, and I’ve led a common life. There are no monuments dedicated to me and my name will soon be forgotten, but I’ve loved another with all my heart and soul, and to me, this has always been enough. - The Notebook
|
|
|
|
|
Just a sidenote: GetCurSel might return CB_ERR (-1 i believe), you might want to handle that case differently (i think GetLBText used to raise an ASSERT if you fed it with a negative value, that might have changed since i saw it though)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hi sir,
Thanks a lot,its working fine.
Raj
|
|
|
|
|
hi,
I have been using strip chart to draw XY line chart. I was using both Counter and Time domain for my plotting. Can any one tell how to use strip chart for scatter plotting. Is it support this type? If not, kindly suggest free scatter chart.
-Parthi
|
|
|
|
|
I don't know what you are looking for exactly, but you can look at a link in my signature for a charting control that I developped. It could maybe be used for your needs.
|
|
|
|
|
I have seen ur chart control. In that OSC control, is it allow to update data in run time? resizing is possible if i resize the form or dialog which holds the control? Auto-scaling option for both axis supported?.
|
|
|
|
|
Parthiban wrote: is it allow to update data in run time?
Yes, you can perfectly add new points in a series whenever you want. You can also add new series to the chart whenever you want.
Parthiban wrote: resizing is possible if i resize the form or dialog which holds the control?
Yes (using the standard way of resizing windows and controls).
Parthiban wrote: Auto-scaling option for both axis supported?.
Yes. However, if your data rate is very high, and the axis have to be scaled for each point, this could be a problem.
|
|
|
|
|
Thanks. I am trying ur control. Is it support scatter drawing like plotting of "Z" shape data. My application has to draw a pressure values based on load which will incremental linear in loading and decremental linear while unloading. Pressure in Y and Load in X. Load will go 0 to 50 and than return to 0.
|
|
|
|
|
Parthiban wrote: Is it support scatter drawing like plotting of "Z" shape data.
Sorry, I don't understand what you mean. Could you please elaborate what you are trying to draw. Please keep in mind that I have no clue about your application.
Are you looking for something where you have simple points drawn on the chart ? If yes, this is perfectly possible with the control.
|
|
|
|
|
Take the following points. A(1,3), B(3,6), C(6,11), D(10,14), E(8,10), F(5,7), G(1,4) I have to draw the points in the order A to F. If i draw it in strip chart control, one line is connecting from A->G->B->F->C->E->D. But my requirement is A->B->C->D->E->F->G. ie, line has to start in A end in D, and return line starts at the position D to E end in G.
|
|
|
|
|
All right, I see what you mean. Yes, this is possible: look at the oscilloscope example, this is something similar as what you need. You have to make sure to disable the point ordering (see the code example for the oscilloscope example at the bottom of the article).
|
|
|
|
|
I got it. I have told earlier post OSC control ie oscilloscope control. Thanks. I ll post u the result.
|
|
|
|
|
So I was bored and wanted to try out Code::Blocks and MinGW with something that I knew works so I got a copy of a console RPG that works and I typed it all out myself in a separate project. The original example program compiles perfectly and runs while mine throws errors that do not make any since. I deleted the examples project file, started a new one and imported the .cpp/.h files and it still compiles so I know its not a project config error.
#ifndef RANGE_H
#define RANGE_H
struct Range
{
int mLow;
int mHigh;
};
#endif
#ifndef RANDOM_H
#define RANDOM_H
#include "range.h"
int Random(Range r);
int Random(int a, int b);
#endif
||=== RPG, Debug ===|<br />
C:\Documents and Settings\Administrator\Desktop\RPG\RPG - ERR\random.h|6|error: new types may not be defined in a return type|<br />
C:\Documents and Settings\Administrator\Desktop\RPG\RPG - ERR\random.h|6|note: (perhaps a semicolon is missing after the definition of `Monster')|<br />
C:\Documents and Settings\Administrator\Desktop\RPG\RPG - ERR\random.h|6|error: two or more data types in declaration of `Random'|<br />
C:\Documents and Settings\Administrator\Desktop\RPG\RPG - ERR\random.h|6|error: extraneous `int' ignored|<br />
||=== Build finished: 3 errors, 0 warnings ===|<br />
The error does not make any since, I even copy paste the contents of the example project into mine and it trows the same errors. Can someone see whats wrong?
Both project can be downloaded off my 4shared: LINK
|
|
|
|
|
C:\Documents and Settings\Administrator\Desktop\RPG\RPG - ERR\random.h|6|note: (perhaps a semicolon is missing after the definition of `Monster')
Have you investigated this clue?
|
|
|
|
|
These situation are typical when a file is included after something else, that -in a same translation unit- doesn't close properly some scope.
The compiler is actually treating your declarations as if they are part of some other precedent not closed declaration (and thus messing everything around).
Try the following:
- Find the C++ file that includes your snippet (either directly or via #include )
- Look if there is some #include BEFORE the inclusion of this snippet.
- Look in that file:
- if {}[]() and <> are properly paired
- if after the '} ' that closes a declaration there is the '; ' (otherwise what follow is treated as declaration of a variable ...)
In some worst cases the error may be even two more #include back.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
In the CPP file you're building with are you inclusing something like monster.h before random.h? If you are is there a structure or class in there called Monster which isn't terminated with a semi-colon?
Create a new cpp file, include random.h in it and try compiling it from the command line. That should show whether the file that's doing the including is the one that's got the error in it.
Cheers,
Ash
|
|
|
|
|
Currently I am using CTreePropSheetEx – an extended version of CTreePropSheet[^] to design a flow project with subtree structure.
I would like to update my interface so it doesn't look so dialog base. I like my UI to look like
Spywareblaster[^]
OR
Kaspersky Antivirus[^]
Pretty much majority security software interface these days.
1. Can it be done in MFC?
2. Since a lot of vendors have adopted this type of UI is there a standard library I can use?
3. Is the library free?I am aware that BCG, codejock, prof-UIS may help me but they are paid commercial software.
4. Is there a book or website that can point me in the right direction.
Right now I am clueless what term to search for.
|
|
|
|