|
i don't think u can use use readfile or writefile. you need to write drivers..
If u can Dream... U can do it
|
|
|
|
|
What's wrong with WM_MOUSEMOVE? Then it won't matter what mouse is plugged in. Or are you a PS/2 chipset manufacturer, and damn these ^$&^%£* USB people?
If you're writing games, then you could look at DirectInput too.
These are only valid for MS Windows, but if you not using windows, it would be helpful to let us know that in your post.
Iain.
|
|
|
|
|
What is the path and name of physical file to store registry ?
|
|
|
|
|
there is more than one file for the registry.. they are stored in [Windows root drive]\Windows\System32\Config\.. the files are called Components,
|
|
|
|
|
I want to create a button that will force an acton to continue as long as the button is "down." For example, I want to increment a displayed field by 1 as long as the button is down. I can increment each time the button is clicked, but can't hold it down and get multiple increments. What's the general approach to this? Thanks.
|
|
|
|
|
You can start some timers on on mouse down event ,and in the timers you can do
what ever you want.. and kill the timer on mouseup. it may work
If u can Dream... U can do it
|
|
|
|
|
One way would be to respond to the WM_LBUTTONDOWN message for the button control and go into
a modal loop until the button is released:
On WM_LBUTTONDOWN...
::SetCapture(hwnd);
MSG Msg;
memset(&Msg,0,sizeof(MSG));
while (Msg.message != WM_LBUTTONUP &&
(Msg.message != WM_MOUSEMOVE ||
(Msg.wParam & MK_LBUTTON)))
{
if (::PeekMessage(&Msg,0,0,0,PM_REMOVE))
{
::TranslateMessage(&Msg);
::DispatchMessage(&Msg);
}
}
::ReleaseCapture();
A better method would be to do it like the up-down control (spin button) does:
On WM_LBUTTONDOWN
Capture the mouse (::SetCapture())
Create a timer for the desired interval of increments (::SetTimer())
On WM_TIMER
Increment displayed field
Call ::InvalidateRect(hWnd, NULL, bErase) on displayed field control
Call ::UpdateWindow(hWnd) on displayed field control
On WM_LBUTTONUP
Kill the timer (::KillTimer())
Release the mouse (::ReleaseCapture())
-- modified at 21:40 Monday 25th June, 2007
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Check out CBitmapButton in WTL, that class has this feature (it's called "autofire"), so you could take the code from there.
|
|
|
|
|
Cool!
I have a dumb question....is WTL for XP+ or are lower OSs supported?
Thanks!
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I can read
Supported Operating Systems: Windows 2000; Windows Server 2003; Windows Vista; Windows XP
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
It has been a while, but essentially you just need to start a timer that calls a timer message handler of you choice. The timer handler keeps doing the increment until you release the button. When you release the button, then you need to release the timer. This is very similar as to how one selects lines in a text editor (or web page), that is a timer is used to make the window scroll when you mover the mouse cursor near the edge of the window when selecting text.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi,
I read a VC++ 6.0 project into Visual Studio and I need to add a reference using the menu Project -> References. However, the menu item "Add new References" does not give me any items to add.
I created a new sample project and the "add new references" dialog lists all the available com objects.
Is there anything I can do to get these items to show up in the converted project? I suppose I could just rebuild the whole project from scratch but if there's an easier way...
Also, if I could ask about the actual COM item I need - I used the Flexgrid in a dialog in the VCC++ 6.0 project. In the sample project I created they did not list this objectin the Add New References dialog. Is the Flexgrid even useable in Visual Studio?
Thanks
-- modified at 16:11 Monday 25th June, 2007
|
|
|
|
|
Ok, adding a control to the toolbox works and this is the way I did it in VC++ 6.0 so it's probably the preferred or mandatory method for dialog based objects.
Also, from what I can tell I need to find the Flexgrid ActiveX file(s) in the VC++ 6.0 distribution and register it in Visual Studio.
|
|
|
|
|
How _beginthread and _beginthreadex lets you pass multiple arguments to the thread as compared to CreateThread?
How should I one which is the onde to be used?
Is it mandatory that in MFC application it is always required to use AfxBeginThread.
|
|
|
|
|
|
Hello
I'm debugging code created using another programming environment (called AD model builder or ADMB) that generates C++ code. To do this, I have to make the following changes in the project settings:
- Add program_name.tpl to your project. Where program_name.tpl is some sort of template (not in the sense of C++ templates) that has the original code that is then translated to C++.
- Click on program_name.tpl then on the Project menu, choose settings, in the Custom Build tab, Commands window, add:
C:\ADMB\BIN\TPL2CPP.EXE $(InputName)
move $(InputName).htp $(WkspDir)
In the Output window put:
$(InputName).cpp
TPL2CPP.EXE is the aplication that translates the ADMB template into C++.
(a) When creating the new project create a blank 32 bit Windows console application in the folder where the source files are.
(b) In Project/Settings/C++/Code generation, ensure that the runtime library is Debug single-threaded.
(c) In Project/Settings/C++/Preprocessor/Preprocessor definitions add __MSVC32__ to the list so the list is: WIN32,_DEBUG,_CONSOLE,_MBCS,__MSVC32__
(d) In Project/Settings/ C++/Preprocessor/Additional include directories add the folder where the ADM include files are, as well as the source folder for the current program e.g. c:\admodel\include,c:\admodel\examples\kalman-filter
(e) In Project/Settings/Link/General delete the Object/library models shown and add the ADM ones: admod32.lib adt32.lib ads32.lib
(f) In Project/Settings/Link/Input add the ADM library folder - e.g. c:\admodel\lib
Then, while debugging the code, if I have to make changes to the program_name.tpl file and try to recompile the resulting C++ it compiles OK but the linker can't access the exe file for modification because apparently is still in use even when I stop debugging clicking on the "stop debugging" button.... Then I tried deleting the exe file but got a message that it is in use by another application but it doesn't show up neither in the applications or processes running in the system... pretty weird... Any ideas about why this is happening and how to solve it?
Thanks
|
|
|
|
|
Hi all,
I want to define a shortcut key for MFC app,
(example. CTRL+Enter)
Please help me.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
To do what exactly? Your question is too vague, but for a generic answer, just handle WM_KEYDOWN events.
|
|
|
|
|
A Shortcut Key is a way to associate a key press with a shortcut, for example, the way <Windows-E> launches an Explorer window.
Is that what you are talking about, or did you mean a mnemonic, which is used to activate a control on a dialog/window like pressing <ALT+N> to activate a control that has a label of Name: , or an accelerator, which is used to activate a command (menu item) like pressing <CTRL+V> , which a common accelerator for Paste.
There are different ways of doing each.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi All
I am try to create a thread using createthread and this is my code
DWORD dwThrdParam = 10;
HANDLE hThread = CreateThread(NULL,0,WorkerProc, &dwThrdParam,0,NULL);
when i am debuging this then it is not going to "WorkerProc" so i am not able to understand whether this thread is running or not and this the thread
DWORD WINAPI WorkerProc(LPVOID pParam)
And it is returning some value.
may i know why it is not going to that thread while debuging
With regards
RYK
|
|
|
|
|
And what did you put in the function ? If it is empty, it will exit immediately and your thread will be terminated.
Did you put a breakpoint inside to check if you are going there ?
Beware also that dwThrdParam is a local variable to your function and you pass a pointer to this variable to your thread function. If the function from which you started the thread exits before the thread function gets called, the pointer will point to an invalid location.
|
|
|
|
|
Yaa i am putting break point in that thread. yaa "dwThrdParam" is local but i will handle later.
|
|
|
|
|
VC_RYK wrote: may i know why it is not going to that thread while debuging
Are you checking the return value from CreateThread()?
|
|
|
|
|
it is returning some valid value i.e(hThread = 0x00000f9c).
|
|
|
|
|
VC_RYK wrote: when i am debuging this then it is not going to "WorkerProc" so i am not able to understand whether this thread is running or not
Do you mean your break point is not being hit? Post the thread function code and explain in more detail what "it is not going to workerproc" means.
|
|
|
|