|
I'd like to write my own keyboard driver for Windows 2000/XP. (I want to move some keys around, and I'm not just talking about keys like CapsLock, Ctrl etc.)
I've searched on MSDN, but I haven't been able to find any information about how to write a keyboard driver. Can somebody point me in the right direction?
|
|
|
|
|
I don't think you want a keyboard driver (though that would work). Search for how to change the charicer map. Windows already has keyboard layouts for things like Dvorak. (control panels->keyboardinput locals->properties -- in windows 2000) Figure out how they work, and you can change your map with a lot less effort.
If you really want to write a driver, you need the DDK, which isn't normally a part of MSDN. Even then I'm not sure how much there is on keyboard drivers, but if you work at it there is enough.
|
|
|
|
|
can we access a pointer to vTable, in C++?? or is it tht pointer to vtable is only for the compiler??
if we can, how do we do it??
|
|
|
|
|
As far as I know it is not possible.
|
|
|
|
|
I m using SQLConfigDataSource( ) to create data source programaticaly
it is creating but it is not attaching the database when i chk it in administrative tools in ODBC on Clicking on New(my DSN name) DSN .. as we attach database with DSN
database name is date.mdb
code is :::
SQLConfigDataSource(NULL,ODBC_ADD_DSN, "Microsoft Access Driver (*.mdb)", "DSN=New\0" "Description=New Data Source\0" "FileType=Access\0" "Database=E:date\0");
reply me thanx
|
|
|
|
|
I use, n works for me :-P
GenLocalDSNString("Microsoft Access Driver (*.mdb)", "DSN=myDSN", "Description=Connection to local database", strPath,"FIL=MS Access");
}
void GenLocalDSNString(CString Driver, CString DSN, CString Desc, CString path, CString FIL)
{
BOOL failed=FALSE;
TCHAR strConnect[256];
int i = 0;
Concat(strConnect, DSN, &i);
Concat(strConnect, Desc,&i);
Concat(strConnect, "DBQ=", &i);
i = i-1;
Concat(strConnect, path,&i);
Concat(strConnect, FIL,&i);
SQLConfigDataSource(NULL,ODBC_REMOVE_SYS_DSN, Driver, strConnect);
//try to create a system DSN - if this fails create user DSN
if(!SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN, Driver,strConnect))
failed = TRUE;
if(failed)
{
failed = FALSE;
if(!SQLConfigDataSource(NULL,ODBC_CONFIG_DSN, Driver,strConnect))
failed = TRUE;
}
if (failed)
{
AfxMessageBox("DSN Creation Failed. Please Contact Support",MB_ICONWARNING);
}
}
void Concat(LPTSTR strDest, LPCTSTR strSrc, int* pnInt)
{
memcpy(strDest+*pnInt, strSrc, _tcslen(strSrc)+1);
*pnInt += _tcslen(strSrc)+1;
}
|
|
|
|
|
Where to place the actual hook code?
In CMainFrm or CWinApp.
|
|
|
|
|
WOW, I found a very good free firewall, and it open full source code!!
The more details: http://www.filseclab.com/eng/products/firewall.htm, http://www.filseclab.com/eng/products/sourcecode.htm
|
|
|
|
|
Hi,
I am a new in MFC.
I want to call a dialog box on Help button on a propety sheet in MFC.How can I do this?
Please guide me.
rajesh
|
|
|
|
|
I use the PlaySound() API function to play wav files when events occur in our app. I would like to give the user the option of adjusting the volumn of each sound.
Im guessing I will need to record the current volumn, set the volumn to the users preferance, play the sound and reset to the original value.
Does anyone know how to do that?
Thanks
Josh
|
|
|
|
|
Hi guys,
I found using the CEdit control in Visual Studio .NET, if the control's ES_NUMBER is set (numbers only), a ballon type of notification is automatically implmented and will pop-up when the users try to type non-number character in the edit box. It works on my first app. However, this special effect no longer works in my second app when using the same standard CEdit control. Typing non-number character will make the error sound, but no longer prompts the ballon notification.
What could have prevented from happening?
Thanks
|
|
|
|
|
Hi
I am currently building a time-critical app that requires a lot of computation functions, like sin(), log(), and sqrt(). I have two questions regarding this:
1. Is there an alternative way that is faster than using those functions? I am working on unsigned ints (32-bit) data, and building a lookup table would not be feasible, since there is no known boundary on the data.
2. Will C++ STL algorithm like for_each(), accumulate(), etc. make my app run faster than using traditional for loop? I am using VC++ 6.0 BTW, without STLPort.
Thanks!
|
|
|
|
|
(1)The FPU can perform the basic sin/cos/ln functions in 'hardware' and therefore presumably quite quickly, more quickly than an integer based hand coded approach. So I suggest you convert your incoming fixed point data to floating, process it, then convert it back, examine the generated machine code and measure the performance. Only then explore the options. If you use the C library functions 'double sin( double ) ' etc then the compiler should generate inline FPU code.
(2)I don't think you'll see a significant performance difference for or against with the STL algorithms, but their use should make the code cleaner.
Paul
|
|
|
|
|
Ex: I want to list all the Folder that shared or shared fully in my Drive. How to do? help me please ??
thanks
|
|
|
|
|
If you don't want to write any program for the same , try following.
If you are talking about C or D drive, go to root of the drive & fire following command.
"dir /S /ON /AD /B > AllFolder.txt"
All the folder will be listed in AllFolder.txt
|
|
|
|
|
Yes, i wanna write a program in MFC to list all the Folder that Shared fully in Hard Drive (C:; D . But I don't know how to approach, Could you help me any more??
thanks
|
|
|
|
|
Hi
If I'm not wrong, an element in STL map is a pair of <key, data>. Given a map of a number of elements, how can I use STL algorithms like for_each(), accumulate(), etc on just the data, ignoring the keys?
Thanks!
|
|
|
|
|
The parameter of the for_each predicate is the result of dereferencing an iterator, which in the case of a map is a map<key,value>::value_type , or pair<const key,value> . So the predicate can look at the second member of the pair :
#include <map>
#include <algorithm>
typedef map<char,int> mymap;
struct TotalIt
{
void operator()( mymap::value_type elt )
{
m_total += elt.second;
}
int m_total;
TotalIt() : m_total(0) { }
};
int main()
{
mymap M;
M['a'] = 1;
M['b'] = 2;
M['c'] = 3;
M['d'] = 4;
M['e'] = 5;
for_each ( M.begin(), M.end(), TotalIt() );
}
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
If my rhyme was a drug, I'd sell it by the gram.
|
|
|
|
|
How about this?
#include <iostream>
#include <map>
#include <iterator>
#include <numeric>
template <typename I> class Pair2ndIterator : public I
{
public :
Pair2ndIterator ( I i ) : I ( i )
{
}
typename I::value_type::second_type& operator* ()
{
return (I::operator*()).second ;
}
} ;
template <typename I> Pair2ndIterator<I> MakePair2ndIterator ( I it )
{
return Pair2ndIterator<I> ( it ) ;
}
int main()
{
std::map<char, int> mymap ;
mymap.insert ( std::make_pair ( 'a', 10 )) ;
mymap.insert ( std::make_pair ( 'b', 11 )) ;
mymap.insert ( std::make_pair ( 'c', 12 )) ;
mymap.insert ( std::make_pair ( 'd', 13 )) ;
mymap.insert ( std::make_pair ( 'e', 14 )) ;
std::cout << "Accumulate ( mymap ) = " <<
std::accumulate ( MakePair2ndIterator ( mymap.begin ()),
MakePair2ndIterator ( mymap.end ()), 0 ) ;
return 0;
}
Paul
|
|
|
|
|
How can I append data to an existing file without overwriting the contents? I thought I could position the pointer at the end using SeekToEnd() and then write to it but it doesn't work that way. Thanks!
|
|
|
|
|
Position the file pointer at the end of the file before writing to it:
SetFilePointer ( hFile, 0, NULL, FILE_END );
[edit]Corrected order of the parameters[/edit]
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Fascinating - in some of my code, I used:
SetFilePointer( hFile,
0,
NULL,
FILE_END);
i.e. I have FILE_END and 0 reversed - this also works fine.
I wonder how often you can swap parameters in an API call!
|
|
|
|
|
|
This means I'd have to open the file using CreateFile(). I'm using CFile::Open() to open the file so is there a way to do it this way? I need to create a report that needs to follow a specific format and I'm writing to the file as I go through each set of data. Does CFile not have a function that takes you to the end of the file in order to append the data or some kind of access rights that allow appending?
|
|
|
|
|
I'm tring to find a way to lookup a particular path in the DFS tree to find where the actual resource from what points to it.
I can't seem to find any API calls or objects which deal with this. The simple way is to pipe 'dfscmd.exe /view \\server\dfsshare /batch | grep path_feaure | awk '{print $4}'' and parse that output but it is ugly and I have to install dfscmd, grep and awk on each machine that needs this code.
Does anyone know where I can find some way to do lookups in a DFS tree programatically?
I know i can use NetShareGetInfo to find out if a path is a DFS root but that's as close as I've come (with a hour of google and msdn searches).
Any points in a relevant direction would be extremely helpful.
|
|
|
|
|