|
GetKeyboardState(...)
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
WM_SYSKEYDOWN
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
Maybe this is an insane question, but I am confused in understanding about the 'rotating pointers' concept. I am having 2 'ptr16' pointers each pointing to different memory sizes (1200x1050) and (1024x1231) respectively. My actual data is of size 1200x1050, but I have to use another buffer of 1024x1231 as per the requirements of one of our hardware board's specs (must be multiples of 1024). So they (the board techies) suggested me as follows-
"simply use the buffer size you feel comfortable width (that is still a multiple of 1024) and add data to it using source and dest pointers, with the dest pointer wrapping around to the beginning of the FIFO buffer"
where FIFO buffer is of size 1024x1231. Source and dest pointers are of same size (1200x1050). I would like to know the actual meaning of the above sentence
thanks,
-Pav
|
|
|
|
|
Sounds like a ring buffer. You'll find information about such datastructures in any well written book on datastructures and algorithms. Ring buffers are often used rapid communication with hardware, as memory allocations are quite costly in terms of performance. Hence a static buffer (an array basically) is used, upon which one slides two windows on: a window of "used bytes" and a window of "free bytes". It's a smart and easy technique, which I'm sure you'll learn in no time.
--
Pictures[^] from my Japan trip.
|
|
|
|
|
Hi,
Thanks for ur reply. At present i am not having a data structures book with me, it would be great if you can give me a simple example code, so that I can understand the basic technique of implementation. I will try to get a data structures book from my library meanwhile
-Pavan
|
|
|
|
|
|
Thanks for the tutorial.
-Pav
|
|
|
|
|
I own a palm os handheld that is able to beam data back and forth, I recently have been programming on it and testing all the functionalities that it has; but one of the functionalities that I saw was infrared TV frequency tapping, then control. That application is also able to learn the frequency of the TV as well. The problem that I face is that the list of frequency that the application is able to learn is only 4 other frequencies. I would like to create a program that has a larger scan for those frequencies and is able to pick up any frequency over time. Another problem is, I have found nothing on the web that talks about "ways to communicate with a TV using frequencies on you palm". So I’m asking for some help in learning how to communicate with a TV through my palm's infrared!
Thank you.
|
|
|
|
|
For point 2:
Check for a technical specification of a "universal" remote control for a TV, they usually give the frequency and the function associated with it.
~RaGE();
|
|
|
|
|
One more Question.
Is it possible to finger any device that i beam at?
Mainly a way to identify something by its return ir signature!
ie: printer, other palm devices, televisions!
When i say finger i mean to get device name, device type, device *frequency* ext…
Thank you.
|
|
|
|
|
Heres a new question that will probably go unanswered again.
I have a list view on my main Dialog. I am trying to perform actions when the user presses the direction keys. Now the VK_UP and VK_DOWN are left alone, they do the default of moving through the listview items.
I have no problem catching the VK_LEFT and VK_RIGHT, but I want to perform an alternate function when the user hits left or right in combination with VK_SHIFT.
So far everything I have tried has failed. The first problem is I am unable to distinguish between the two types of user input.
if(((LPNMHDR)lParam)->code == LVN_KEYDOWN) {
if(((LPNMLVKEYDOWN)lParam)->wVKey == VK_SHIFT)
break;
data->display_navigate(((LPNMLVKEYDOWN)lParam)->wVKey);
}
the display_navigate() function examins the keycode and performs an action. But it gets called even if the user holds the shift key.
|
|
|
|
|
Use GetKeyState(VK_SHIFT) to check if the shift key is down when you catch the other keys.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Wow, that was a fast reply. Thankyou, your suggestion works a treat
|
|
|
|
|
i am using vc++6 MFC and dialogs
i want to connect to my remote mysql database and put the results in a CListView, any example i find uses ODBC, where a window box is poped up and a you have to select a ODBC. can i not just connect directly to the mysql server?
Or if a OBDC has to be used can i hard code one in and how?
thanks
|
|
|
|
|
1. go to mysql.com to download c library, which contains c functions for accessing mysql database and is free.
2. go to your host to add your PC's IP address to mysql database, otherwise you can not access your mysql database.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
ah right, im am using a mysql wrapper already (MySQLWrapp), was just wondering how to get the data into a CListView. like all the columns and rows. all the examples show how with ODBC
|
|
|
|
|
if u can read records from mysql db, why can't u add them to CListView?
is ur question about mysql or CListView?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
i think his problem is MFC because he's been asking so manu times about data binding...
see by your eyes[^]...
|
|
|
|
|
I have a CDialog derived class, and want to programmatically close it. I tried:
cd->PostMessage(WM_CLOSE);
where cd is the pointer to the non-modal window. However it doesn'tclose. In the message map of cd's class I put ON_WM_CLOSE()
BEGIN_MESSAGE_MAP(CDlgTimeSeries, CDialog)
ON_WM_CLOSE()
END_MESSAGE_MAP()
What do I need to do to close this cdialog?
thanks,
sb
|
|
|
|
|
call function OnOK() or OnClose().
OnOK() returns IDOK.
OnCancel() returns IDCANCEL.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Use DestroyWindow() to close a modeless dialog
cd->DestroyWindow(); Your dialog will then recieve a WM_DESTROY and a WM_NCDESTROY message.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks! That worked great!
|
|
|
|
|
WM_CLOSE is sent to windows (generally top level windows, or child MDI windows) by the system, asking them to close. The default handler (DefWindowProc()) for WM_CLOSE calls DestroyWindow(). It would seem that DefDlgProc() doesn't call DestroyWindow() (which makes sense, since a dialog may be modal, and is handled a bit differently).
--
Pictures[^] from my Japan trip.
|
|
|
|
|
I have a series of 32 frames of data (all the same size in RGB format) which I would like to show in an AVI format. I don't need any audio, just video. I tried my luck at AVIFileInit() followed by AVIFileOpen(&pfile, name, OF_WRITE | OF_CREATE, NULL);
These worked (no error code) and AVIFileCreateStream(pfile, &ps, &strhdr); even worked.
When I made my data into a bitmap and tried to insert it with
hr = AVIStreamWrite(ps, i, 1, buff, bi.biSizeImage, AVIIF_KEYFRAME, NULL, NULL);
my luck ran out.
Presumably my strhdr isn't properly defined
memset( &strhdr, 0, sizeof(strhdr));
SetRect(&strhdr.rcFrame, 0, 0, (int) bi.biWidth, (int) bi.biHeight);
strhdr.fccType = streamtypeVIDEO;
strhdr.fccHandler = mmioFOURCC('M','S','V','C');
strhdr.dwScale = 1;
strhdr.dwRate = 1;
strhdr.dwQuality = -1; // default quality
I have no idea what MSVC in fccHandler means, for example.
I would like it to work like clock.avi in c:\windows which clicks away at 1 second clicks and it cycles back on itself. Does anyone have any suggestions on a tutorial?
Thanks,
Ilan
|
|
|
|
|
As usual, searching CodeProject articles is a good place to start - there is an article called "A simple interface to the Video for Windows API for creating AVI movies from individual images" (and here's the link: http://www.codeproject.com/audio/aviutil_.asp[^])
I have no idea how well this article works - it didn't get a great score, but it may give you some tips.
|
|
|
|