|
Try this site for a reference: http://www.doc.ic.ac.uk/~ih/doc/par/doc/data.html
Also, you might want to attempt to "open the device", just like you'd open a file. Call _open and specify "LPT1" for the file name. You could open a COM port by specifying "COM1" instead. Then just read and write to the device by using _read and _write .
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Check out this example at MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp
Kuphryn
|
|
|
|
|
How can get the all Windows operating system code pages using VC program
kumara
|
|
|
|
|
use GetVersionEx() .
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Use _getmbcp() , or GetCPInfoEx() .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi
Thanks for the reply.
Actually I need to get all the code page names that the OS use
As example like below
This is some
CodePage Codepage name
1250 windows-1250
1251 windows-1251
1252 Windows-1252
1253 windows-1253
1254 windows-1254
1255 windows-1255
1256 windows-1256
1257 windows-1257
1258 windows-1258
I can use "GetCPInfoEx" but this is not giving the format that I mention in above.
If u have solution please tell me know.
Thanks
Kumara
|
|
|
|
|
Use EnumSystemCodePages() .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
|
Hello,
I want to get all files in specified directory and also in subdirectories using Windows SDK. PPl who know plz send it.
Valan
|
|
|
|
|
There's no direct method, so you'll either have to write your own recursive function, or use an existing class to do it (such as this CFileInfo[^] or this SADirRead[^]).
|
|
|
|
|
Dear All,
I am developing an application for Windows2000 NTFS filesystem specifically in VC++ MFC version 6.0.
I want to get exact path of Info2 located in the recycle bin folder of the specified drive (e.g on my computer it is d:\RECYCLER\S-1-5-21-725345543-1708537768-1957994488-500\Info2)
Can anybody please suggest a way out to get the path of info2 ?
Regards,
Rohit
|
|
|
|
|
To get the IDL of the Recycle Bin folder, use SHGetSpecialFolderLocation(..., CSIDL_BITBUCKET, ...) .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I am writing a MDI application where the child windows contain active x controls that request metering information every 100 ms.
When the child window is deactivated they keep requesting metering information so that the user can tile the windows and see the meters updating.
I want to stop the control reuesting data when it is hidden by another window and not visible. Does anyone know how I can tell when a window region is hidden by another window?
WM_PAINT events are only generated when a part of the window which was hidden is exposed again. I want to know when it was painted over so I can stop wasting processing and comms. band width for a control no one can see.
Any suggestions would be most welcome.
|
|
|
|
|
I just spent the evening creating the first C++ app I've written in years, and everything works as expected. Enter a bunch of text, and it emits Morse Code. Except now I've discovered that the system speaker (or whatever it is that the Beep(...) function accesses) can't respond fast enough to make clearly detectable dit/dah tones. Can anyone recommend a source of programmable tones I can use with PlaySound() or some other function which can be programatically altered to change pitch and duration? Or perhaps direct me to instructions on how to construct .wav files on the fly, especially generating the data chunk from some simple algorithm I can write that converts a series of dits and dahs into PCM in a format that can be readily played back?
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
From . & -> to PCM Data chunks in a few days
Way to go
http://www.codeproject.com/audio/concatwavefiles.asp[^]
looks like this is what you want
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
It's amazing what one can accomplish with only two fingers and a lot of trial and error. Not to mention the assistance of a few friends!
That looks like part of the solution - thanks!
The harder bit is understanding how to get from an array of values for cos(wt) to a PCM chunk properly scaled and formatted. The pitch has to be variable for aesthetic reasons - some like high, squeaky tones, others lower tones - and the duration has to be varied from 30mS (40 wpm code) to 1200 mS (1 wpm code). That rules out storing a bunch of .wav files and joining them. A decent tradeoff would be to generate files of 10, 20, 50,and 100 mS duration for the selected pitch, then join them to make dits and dahs for the selected word per minute transmission rate.
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
Wow you can read morse code? I never did manage to master it (which basically closed the entire area of ham radio to me in the late 60s). It didn't matter much to me at the time but latterly that's been a regret... On the other hand, I did make a TV set using a 5BP1 CRT and 6h6's as a voltage doubler for the EHT. That was fun
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
Rob Manderson wrote:
I did make a TV set using a 5BP1 CRT and 6h6's as a voltage doubler for the EHT. That was fun
You guys have way too much time in ur hands
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
lol this was back in 1970 after reading an article published in 1957 in the Australian magazine 'Radio, Television and Hobbies' which later became Electronics Australia. To this day I get all misty when I smell rosin.
Rob Manderson
http://www.mindprobes.net
Paul Watson wrote:What sense would you most dislike loosing?
Ian Darling replied.
Telepathy
Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003
|
|
|
|
|
Rob Manderson wrote:
To this day I get all misty when I smell rosin.
Wow! You, too?
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
Rob Manderson wrote:
you can read morse code?
Mmmmm... no. But my ham license is coming up for renewal next year and I'd like to upgrade. I passed the General class written test on a lark 8 years ago when I tested for the Technician grade, and the Extra class test doesn't add much to it, so I figure I might as well go all the way next year. But Morse is still required for all licenses above Technician, so I still have to learn it. Rather than forking out $30 for training software I thought I'd spend a day creating my own, and getting more C++ practice while I'm at it. It looks like it's going to take 2 days, though...
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
...fer gosh sakes:
void TD_Hlp_SoundNote(short nNoteIndex, short duration) {
#if defined(_X86_)
int notes[] = { 9121, 8609,
8126, 7670, 7239, 6833, 6449, 6087, 5746, 5423,
5119, 4831, 4560, 4304, 4063, 3834, 3619, 3416,
3224, 3043, 2873, 2711 , 2559, 2415, 2280, 2152,
2031, 1917, 1809, 1715, 1612, 1521, 1436, 1355,
1292, 1207, 1140
};
short note = notes[nNoteIndex];
_asm {
mov al, 182;
out 43h, al;
mov ax, note;
out 42h, al;
mov al, ah;
out 42h, al;
in al, 61h;
or al, 00000011b;
out 61h, al;
mov bx, duration;
pause1:
mov cx, 65535;
pause2:
dec cx;
jne pause2;
dec bx;
jne pause1;
in al, 61h;
and al, 11111100b;
out 61h, al;
}
#else
#pragma message("TDHlpFns.c: i386 specific speaker code removed")
#endif // defined(i386)
Download and modify the _TestDrv1.sys driver code here[^] - add some new DeviceControl call functionality and away you go.
Sigh... these kids today. Now when I was a little girl...
Well, yes, it is a bit of a blatant plug but sometimes when you post an article that starts with a 'Y' on a busy day it doesn't ge into the latest updates and tends to languish in obscurity pining for the fjiords and stuff so what the heck...
|
|
|
|
|
Sweet... Nice article, too, the 1.64% of it I could understand. I guess maybe it's time to install this Windows Driver Development Kit CD I've been using as a coaster for the past 6 months. The asm code above looks lovely - how I miss real programming, the kind where you turn the individual bits on and off yourself. It also looks to be highly dependent on clock speed and processor instruction cycle counts and so would probably not do a great job of sounding a tone for a specified number of mSecs without some additional tweaking.;P
Tim Deveaux wrote:
tends to languish in obscurity pining for the fjiords and stuff
Yes, I do that a lot myself some weeks...
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|
I _think_ the 8253 programmable timer operates on its own 14.31818 frequency, so this code should port.
Still, might sound a bit different depending on your speaker.
And be careful - people who use DDK CDs as coasters run the risk of becoming project managers...
|
|
|
|
|
Tim Deveaux wrote:
the risk of becoming project managers...
I did that for many years - BOOOORRRRRIIINNNGGGGG!!!
Hmmmm, now that you mention it, I think you're right about the 8253.
"Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.
|
|
|
|
|