|
Alexinuk wrote:
will this work on all windows (95/98/....etc)?
Yes. Use the WindowsHookEx for the latest versions, or WindowsHook for backward compatibility.
Alexinuk wrote:
Is this the only way?
Yes.
~RaGE();
|
|
|
|
|
Win98 doesn't have an MSGINA.DLL though does it?
|
|
|
|
|
Replacement of MSGINA.DLL is only needed for disabling Strg+Alt+Entf. All other key events can be handled by hooks.
Alexinuk wrote:
Win98 doesn't have an MSGINA.DLL though does it?
Well I think it's only provided for WinNT and higher
|
|
|
|
|
Alexinuk wrote:
Is this the only way
I don't know if it's the only one, but it should be the best! You could possibly write you own keyboard driver - but that won't be easier. And system-wide hooks (that one's inside DLLs) even work for catching all input.
Alexinuk wrote:
will this work on all windows (95/98/....etc)?
Sure - do you expect anything else from MS?
|
|
|
|
|
i get:
<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__closesocket@4<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__send@16<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__accept@12<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__bind@12<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__htons@4<br />
SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8<br />
wenn i start my programm, here is my programm:
<small><br />
#include winsock2.h<br />
bool ServerStart;<br />
<br />
......<br />
<br />
......<br />
<br />
UINT ServerThread(LPVOID Param)<br />
{<br />
SOCKET server;<br />
WSADATA wsaData;<br />
sockaddr_in local;<br />
ServerStart = TRUE;<br />
int wsaret = WSAStartup(0x101, &wsaData);<br />
<br />
if (wsaret != 0)<br />
{<br />
return 0;<br />
}<br />
local.sin_family = AF_INET;<br />
local.sin_addr.s_addr = INADDR_ANY;<br />
local.sin_port = htons((u_short)20248);<br />
<br />
if (bind(server, (sockaddr*)&local, sizeof(local)) != 0)<br />
{<br />
return 0;<br />
}<br />
SOCKET client;<br />
sockaddr_in from;<br />
int fromlen = sizeof(from);<br />
<br />
while(ServerStart == TRUE)<br />
{<br />
char temp[512];<br />
client = accept(server, (struct sockaddr*)&from, &fromlen);<br />
sprintf(temp, "Your IP is %s\r\n", inet_ntoa(from.sin_addr));<br />
send (client, temp, strlen(temp), 0);<br />
closesocket(client);<br />
}<br />
closesocket(server);<br />
WSACleanup();<br />
return 0;<br />
}<br />
</small>
|
|
|
|
|
i already found the solution, i had to link my compiler with the file: ws2_32.lib
didn't pay attention...
thnx anyways
|
|
|
|
|
Have you tried WM_SETREDRAW (MFC: CWnd::SetRedraw)? IIRC it can make a significant difference.
|
|
|
|
|
i've done some basic socket programming so far and there's one thing i'm unable to explain. it works, but i don't know why.
i'm sitting behind a proxy-server here and when i write a program using sockets, i just use the usual socket-functions provided by the socket-api.
my program works fine here behind the proxy and without any changes at other locations, where there is no proxy.
why?
other programs like browsers, winamp and the like have an extra proxy-settings dialog and in fact they're unable to connect to the internet, when i don't specify one there.
can someone explain that to me, please...
:wq
|
|
|
|
|
Need more information about what you are connecting to.
"No matter where you go, there your are..." - Buckaoo Banzi
<pete>
|
|
|
|
|
Hi there!
Recently, I've noticed something that should interest you.
On one of my hard drive, I have a folder where I put all the junk I download from Internet. There is much more than 500 files in there. This is because I download from WinMX and others file-sharing software like others do...
What sucks with this kind of software is that you need to download so many files to be able to get a correct one. And the result, your disk are full of junk that you share with others...
So, you have a lots of files of different names and extensions that contains almost the same thing. (It could be jpg, gif, mp3, wav, mov, avi, asf... doesn't matter.)
You need to retrieve just what's good and delete everything that is partially downloaded or everything that is not what you were looking for. (ie : you were looking for a PetShop Boys picture, you have downloaded "boys_live.jpg" and retrieved a BackStreet Boys pic... )
I already tried to sort and delete using explorer. Arrrrgghhhh!!!! It tooks me hour and hour !!! So I gave up!
But like every programmers, I think that, when something is hard to do manually or when it takes ages to do it manually on a computer, you should program the computer to do it at your place. The first computer was exactly invented for that.
What I thought is to scan my folder and look for every file within this folder. During the scan I do a sort of pre-sorting with the first 128 bytes of each file, it should be sufficiant to compare jpg from mp3, mov... I verify every first 128 bytes of each files, put each filename and its first 128 bytes on an resizable array called CURRENT. Notice that if a file contains 0 bytes, it should be deleted immeditaly.
After, the first 128 bytes block of each files are compared one to eachothers in an iteration. Everytime a new match is did, a new array group is created containing the 128 bytes block fingerprint, and all files matching this fingerprint will be added to this group. When done, the program will have created muliple groups containing filenames of 'matching' files.
Now it will have to scan completly each file fingerprint within each group. Some files may be incomplete too. It should be long and complicated I think. I don't know if I have to work with checksums, scan and compare each byte of the file ... It could be long if we have 12 files of 8M to compare bytes to bytes! (What it seems to appear frequently !) Again, everytime a new match is did, a new array group is created and all files matching this fingerprint will be added to this group. We end with with a table that is sorted from a totalt match to a partially match.
The result expected is to show to the user what is on its HDD and let him do the final decision with the scanned files. In a column, files that are OK, without error...
In the other one, a treeview showing each groups found with filenames associated. Filenames with the higher bytes size must be on top under each node, other files will show a percentage of the highest one. Filename with "_incomplete_" should be marked too. User will be able do delete files by right clicking on each first nodes and selecting delete. It should be able to rename, move and view file too. Simple...
I don't know if this kind of program exist or if someone has coded something like that. I didn't start yet, it's just an idea. But I will work on soon...
If you have any suggestions, idea, infos...
Or if you think I should jump off from a bridge...
Leave me your impression!
Sorry for my bad english.
Boolean Tatoo
Progamming looks like taking drugs...
I think I did an overdose.
Boolean Tatoo
|
|
|
|
|
No ones have an idea ???
Progamming looks like taking drugs...
I think I did an overdose.
|
|
|
|
|
hello,
I am planning to generate a unique hardware ID. This should be unique for each and every machine.I am planning to take parameters like processor ID or motherboard serial number etc.Is there any function in vc++ to get these parameters.Can any one help me please..
Thanks in advance
Mahesh
|
|
|
|
|
Well... Even Wintel failed on this one (remember CPU ID? Its switched off by default in every BIOS by now). The nearest thing you can get seems to be the Ethernet MAC-address of the network-card(if any). Since most of those are nowadays built into the mobo, almost all newer PCs will have one.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
On a second thought, I remembered the TCPA, which is right now introducing spy-chips into computers (DELL and IBM have it by now): These chips (and OSses depending on it) can lock out unwanted software from that computer. AFAIK it contains a unique serial no. for every computer.
But it will probably need several years until all computers have it installed (and free software is history at last - SCNR).
It does not fulfill you current need.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
AFAIK there is but one way to get a unique hardware ID: A dongle with a unique harware ID. Seriously, that is the only way.
|
|
|
|
|
Greetings everyone!
Can anybody help me with this problem
I have try to rebuild the *.clw for classwizard, but got this message for some of my class files.
"a duplicate insert block exists for class ......" and class wizard cannot view the affected class information after the rebuilt.
Anybody pls help!!!
Tahnks you
|
|
|
|
|
Rename the *.clw file to *.bak
MSDev will create a new file as soon you will try to use the Class Wizard. It will tell you that the database xxx/xxx/xxxxx/*.clw doesn't exist and ask you if you want to build it from your source files. Click yes. Then a dialog will open, select the *.cpp file that is matching with your class. That's it!
Notice that later, you will probably have some messages asking you to point wich files goes with wich class. But it's very user-friendly. When all your classes within this project will been covered, you won't be asked anymore.
Good Luck!
Boolean Tatoo
Progamming looks like taking drugs...
I think I did an overdose.
Boolean Tatoo
|
|
|
|
|
I've had this problem before, it was caused because one my classes had two lots of the classwizard entries in it.
Look through your classes for one containing two lots of the following in your header file:
//{{AFX_INSERT_LOCATION}}
--
The Obliterator
|
|
|
|
|
tyanks you saved the day
|
|
|
|
|
Hi... all.
I m looking for a formula ( a way to calculate )
The y root of x.
for example:
<br />
int Multiply(int x,int y)<br />
{<br />
int res=0;<br />
<br />
For (int i=0; i<x; i++)<br />
res+= y;<br />
<br />
return res<br />
}<br />
looking for func(x,y) and that func
will return the y root of x....
Please...
HELLLLLLLLLLLLLLLPPPPPPPPPPPPPPPPPPP!!!
Thank you all for reading this message.
תודה מראש
|
|
|
|
|
To get the root all you need to do is invert the power..
double root(double x, double y)
{
return pow(x, 1/y);
}
You should probably add code to check the value of y in the code above...
Col
|
|
|
|
|
Thanx
But isnt there another way to calculate it???
(* Please say there is *)
BTW:
Do you have by any chance the code of
double sqrt(double)
that defined in math.h???
|
|
|
|
|
I found this solution on the net...
<br />
double sqrt1(double x)<br />
{<br />
double a=0,b = x;<br />
<br />
while (a!=b)<br />
{<br />
a=b;<br />
b = 0.5 * (b + x/b);<br />
}<br />
return b;<br />
}
I did not quite understood how and\or it works...
But it does its job.
Looking to change it from sqrt to root y...
And the most perfect resault...;)
10q all
|
|
|
|
|
Yes I understood....
<br />
<big>b= (b+x/b)/2;
2b= b+x/b;
2b<small>^2</small>= b<small>^2</small> + x;
2b<small>^2</small>-b<small>^2</small>= x;
b<small>^2</small>(2-1)= x;
b<small>^2</small>=x;</big><br />
|
|
|
|
|
Hi
I have a SQL question that looks something like this:
"SELECT DISTINCTROW Table1.strDate AS strDateEx, Sum(Table1.dfValue) AS dfValueEx
FROM Table1
GROUP BY Table1.strDate;"
What i want to do is that i have a table with dates. And i want one row for each day
with the sum for that day in the dfValueEx column. I have no problem on getting the
question to work when i try it in Access.
My problem is that i don't know how i could make this work in a CRecordset. When i try
i get a "Invalid character value for cast specification on column number 1 (strDate)" error.
What does this error mean, and how can i get this to work?
|
|
|
|