|
I am trying to change the tab stops on the printer before I send formatted text (w/Tabs) to it. I can change the tab stops in stringFormat and use it when calling DrawString but they are completely ignored, e.g.,
Dim string_format As New StringFormat
Dim tabs As Single() = {20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20}
string_format.SetTabStops(0.0F, tabs)
e.Graphics.DrawString(txt, m_Fonts(para.FontNumber), _
Brushes.Black, layout_rect, string_format)
Anybody got any ideas? One would 'think' that this should be pretty straight-forward.
|
|
|
|
|
I am creating a UMDF driver which needs to change the brightness of the LCD back light.
The following line of code works in a Console App and successfully returns a handle to the device:
HANDLE hDevice = CreateFile(L"\\\\.\\LCD", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
However, when I use the exact same piece of code in my driver it returns INVALID_HANDLE_VALUE and GetLastError() gives code 5 which is 'Access is denied'
The driver is being debugged remotely on an x64 Windows 7 machine using the standard WDKRemoteUser profile.
Does anyone know what the problem might be? Do I need to set permissions and, if so, how?
|
|
|
|
|
I'm not sure that you can use a normal CreateFile() call in a driver; see here[^] for further information.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
He would get a compile error of CreateFile() was not part of the UMDF (User mode driver frame work) API,, so it he wont need to use the kernel equivalent.
He could try MAMIMUM_ALLOWED, always a usefull trick to get at least something open, and then look at the privileges his shell is running and what his driver set.
|
|
|
|
|
I'm not sure why you are telling me this, I would think the OP would be more interested. Although almost a month on I doubt it.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thought you might be interested to know that UMDF is a usermode driver so will use the win32 API and not the kernel API. Of course you are free to not give a sh*t if you like.
|
|
|
|
|
My computer is connected to 2 Local Area Network.
One of them have internet access, and the other one don't.
But while browsing, the internet seems like working periodically.
Why I use two LAN?
It's because the one which had internet access is Mifi. (ZTE)
I'm not good about networking.
I need to connect both of them with my internet working properly, is it possible?
Sorry for bad english.
Edit :
Solved !!
Yes, your computer can access more than one network at a time, but it can't be through the same network interface.
IE, you can't be connected to two different wireless networks, or two different wired networks at the same time, through the same "card". Now, if you had an internal wireless adapter, and then a PCMCIA or USB adapter, then each could connect to a separate network.
The easiest way, since you're using wireless right now to access the internet, is set up a wired connection to the new router that's going to be stand alone.
The only thing you'll have to make sure is that the two networks are on different subnets. What I mean by that is:
If the wireless IP is currently 192.168.0.X, then the wired would have to be anything above 192.168.1.X. To avoid network confusion, don't put a default gateway in on the wired network, so the only adapter the computer will try to use for internet access is the wireless link.
modified 24-Oct-12 3:18am.
|
|
|
|
|
When does windows read its inf (usb driver) files?
Does it do it during the boot process?
Or as part of device enumeration?
Or something else?
Thanks.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
info file is read by windows when you insert your USB to your machine(under some condition). It also can by executed by windows when you double click on the drive icon in mycomputer.
In my case, I never let info file to be executed. If I see any info file I dont care the owner of the usb device, I simply delete the file.
I wish I could believe there is an after life.
|
|
|
|
|
This is bad advice, ignore it.
|
|
|
|
|
An inf file is a setup file. It associates a hardware ID, such as you will see in the Manufacturers section, with various registry entires, the most important of which is the service entry since it determines the form of the HKLM\sys\CCS\Services\ entry for that device (or filter or whatever).
You will also get a Hardware entry in the Registry that associates that Service for a particular Hardware ID, if it is a driver for hardware.
Check the DDK/WDK for more info on inf files and driver installation.
|
|
|
|
|
I've got an Acer Aspire 8920 laptop which I bought about four years ago. It's still going okay with one annoying habit and that's its inability to keep proper time. When I power it on after a few hours switched off the date and time could be as daft as 2003 as it is 2033. Neither the month, day or time bear any resemblance to the actual.
I've never had to replace the CMOS battery in any PC or laptop but maybe this is the first time I now need to. The CMOS battery isn't a traditional coin-like battery. Instead, it's a sort of loom-connected type of battery which is buried in some awkward to get at location.
Question is: do you think it's the CMOS battery that's doing it? Once I've powered on I can eventually synchronise the date and time and it keeps time okay. Only during power-off does the time go a bit mental. If not the CMOS does anything else come to mind?
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
|
It's not quite the same but the battery is similar in design. So it looks like it is the culprit. It's borne out by the fact that I no longer switch off the mains plug in the wall. I leave it on now and following several reboots the time hasn't failed once. If I switch off at the mains and reboot with an hour or two the time is also fine. Overnight without power is when it gets really messed up. The problem with the time isn't just making the file system look odd but it affects the lifetime of certificates as well.
I'll look around the another battery. I did once pull the case apart to get to it but it was a pig to get at and the connector is so tiny you need a micro surgery machine to put it back!
Thanks for the confirmation.
"I do not have to forgive my enemies, I have had them all shot." — Ramón Maria Narváez (1800-68).
"I don't need to shoot my enemies, I don't have any." - Me (2012).
|
|
|
|
|
It's pretty easy to find 15" quad core laptops with anything up to 24MB but 17" is harder to come by. Asus sill supply the N75 but you can only get it with dual core (in the UK), their 15" equivalent N55 has been superseded by the N56 which does have quad core options but the 17" hasn't had the same upgrade yet (and by the reviews I've seen the Nx6 versions have better build quality to boot).
Dell supply a 17" consumer quad core laptop with 6MB (4 + 2), requiring a manual installation of a replacement 4MB memory module to get the 8MB, and they have a business version with 8MB as standard.
After that you have to look at gaming laptops which tend towards £1500.
The most demanding tasks I'll use it for involve Visual Studio, the occasional linux / Virtual Box session, maybe some GIMP work plus the other usual stuff, browsing, e-mail plus very occasional gaming.
Anyone got any recommendations?
Thanks,
Mike
|
|
|
|
|
Hi,
A bit of an odd one. Does anyone know what file system\format Canon EOS cameras use for there CF cards?
Thanks.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
Donated, free, Inspiron One (Dell) won't stay up for more than few hours.
After failure ( blue screen) the Setup (F2) shows NO internal HDD.
(Sorry, I have not figured it out on Win 7 how to stop restart after blue screen, so have no chance to read the blue screen)
Usually, not always, the box will recover after taking an over-nite nap.
This piece of cheap(ly build) PC gets pretty warm. So – I figured HDD going south.
Win 7 occasionally, not always, runs Check Disk on start up and reports no problems.
My question to the forum – Dell's “warranty” runs one year, I had HDD failures in past and recall that reputable manufacturer had THREE years warranty on HDD itself.
Am I living a dream or does this manufacturer warranty still applies?
I have no desire to talk to Dell.
|
|
|
|
|
Vaclav_Sal wrote: I have no desire to talk to Dell. Unfortunately, they are the only people who can answer your question. And, unless you have documentation to support any claim on warranty you are unlikely to get any help.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Tonight I was listening to an album ripped from CD to my WD MyBook. About 2/3 of the way through the album, one of the tunes broke up badly, as if it was a scratched vinyl record. The original CD was not damaged, and the ripped files used to play perfectly - a year ago or so. I thought it might be just a communications problem, buffer overruns come to mind, since it's a USB connection. But after I was done with the entire album, I went back and tried to play the single track separately. It was still f'ed up. Is my external hard drive failing? Is there a way to refresh it, like a DRAM? Or do I have to re-rip the original CD to restore the proper bits?
Will Rogers never met me.
|
|
|
|
|
Do I need to call WinUsb_FlushPipe after every write, if I need to be sure all the data is sent immediately?
Or is it only needed under certain conditions?
Thanks.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
Flushing will discard cached data in the receive buffer. This is probably not what you want during normal operation. It is usually done upon errors.
As far as I know data is always send immediately. But the USB device may not read it immediately. You may use the SHORT_PACKET_TERMINATE PolicyType to send a zero-length packet after each write request. This may trigger the USB device to read in all data. But before doing this I would check it it is really necessary.
|
|
|
|
|
Thanks Jochen,
The USB device in question is implemented by me, so I know that ZLP's are not required and under normal operation all packets will be read imediatly (pretty quick anyway).
So I should not need to call WinUsb_FlushPipe.
Thanks again.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
I've been looking for new hardware to build a mini-ITX server. USB 3.0 support is a must as are SATA 6.0Gb/s, ECC DDR3 RAM, and gigabit Ethernet. Disappointingly, no such motherboard exists with all the features described.
Instead, after so much browsing and searching, I've noticed how so much hardware out there are USB 3.0-enabled and curiously, despite USB 3.0 being backwards-compatible with its predecessors I find that computer cases and motherboards will almost always have USB 2.0 ports coexisting with the newer USB 3.0 ports.
If USB 3.0 is the new standard and is backwards-compatible, why half-ass the hardware by providing "crippled" ports adjacent to the super speed ones? I'm just curious since I have been coming across computer cases with both USB 3.0 and 2.0 ports.
modified 28-Nov-12 22:06pm.
|
|
|
|
|
I have the weirdest problem and am hoping someone with a greater mind than mine can help me figure it out.
I am running Windows 7 Home Edition Service Pack 1, Internet Explorer 9.0.8112, and Windows Media player 12.0.7601
Windows Media player will not play .wav files. It will play all other types of audio and video files that I throw at it.
I downloaded the VLC media player[^] and it plays .wav files just fine.
The reason it has become a problem for me is that I am writting a little app the makes use of the PlaySound[^] API to play short .wav files. This API will also not play the .wav files.
Anybody have any ideas where to start looking to solve this problem?
[EDIT]
I ended up going into the device manager and unistalling all the audio drivers and then rebooting. Upon reboot the system reinstalled the audio drivers and all is now good.
Dang that was simple, should have done that long ago
[/EDIT]
Independent ACN Business OwnerNeed a new cell phone? We supply most of the major carriers. Telus in Canada. Flash, Verizon, T-Mobile and Sprint in the USA. O 2, talkmobile, tmobile, orange, three, and vodafone in Europe. See my website for details.
Within you lies the power for good - Use it!
modified 15-Sep-12 12:33pm.
|
|
|
|
|
XP keeps checking one of my hard drives. Runs check disk every time on start up. There are no errors found.
It is annoying, but I can live with it.
How can I get rid of it?
Any help is as always appreciated.
Cheers Vaclav
|
|
|
|
|