|
you could try a Long, since in Win32 a HANDLE is a void*, and a void* is a pointer. and pointers are 32 bits long, just like a long.
-c
"Do you mind if I smoke?"
"Madam, I don't care if you burn."
-Oscar Wilde
Smaller Animals Software, Inc.
|
|
|
|
|
Thanks for the idea!
It worked!
|
|
|
|
|
Hello
I want to create a function that compares two words (char*) and returns a percentile representing how much the two string are identical.
I have some problems making the function perfect and I was wonderig if someone can tell me if there's an algorithm that do that or have some code already written.
Thank you very much.
Eric
|
|
|
|
|
Eric Moisan wrote:
how much the two string are identical
Can you define what this means? Is it as simple as how much of the strings (starting from the first char) are identical?
If so, just loop from the beginning of each string until you find 2 chars that aren't the same. The progress divided by the length (of one of the strings) should give you your answer.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Maybe i'm not perfectly clear.
My function does exactly what you told me. I loop from the begining of each strings until I find 2 chars that aren't the same. But if I have the words "Hello" and "ello", I don't want to have a value of 0% since the two words are pretty identicals.
Thanks for the answer.
P.S. I like your sentence..."There is always one more bug..."
Eric
|
|
|
|
|
if u want this,just consider the tokens..on Substring....
and if the substring found substringlength/main strin length *100 give the percentage
strstr()
strtok()
and many other bulilt in routines here for it..
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
char str1[MAX_PATH],str2[MAX_PATH];
strcpy(str1,"HELLO");
strcpy(str2,"HALLO");
int nLen=strlen(str1);//or which string u want to compare
int nTotalMatchedChars=0;
for(int i=0;i
|
|
|
|
|
Not quite. This will return a match value of zero for these 2 very similar strings: "abcd" and "bcd".
The algorithm should return the length of the longest same substring present on both strings. The "similarity" factor would be the length of the substring divided by the length of the longer string.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
The algorithm should return the length of the longest same substring present on both strings. The "similarity" factor would be the length of the substring divided by the length of the longer string.
So "abcd" and "lbcd" would be more similar than "abcd" and "acbd"?
That sounds wrong...
(the first pair has a three character substring in common, but the second pair has only one character substrings in common. I personally would not consider the first pair to be three times as similar as the second pair.)
|
|
|
|
|
How could I get information about system performance (System Meter utility of Windows 9x), like free resource, free RAM, used RAM, processor use ...
Anyone knows some class or function in VC6 ?
Thanks,
Cris ...
|
|
|
|
|
hi friend
here is an Function GetSytemInfo()
and the argument u sulply is address of SYSTEM_INFO structure..
like SYSTEM_INFO sInfo;
GetSytemInfo(&sInfo);
u can get the processor type,the pagesize(yaaa..!! it is the VirtualAlloc() Used..),Pointer to the lowest memory address accessible to applications and dynamic-link libraries (DLLs) etc....
try it...
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
hey friend
the spelling Mistake..!!!
GetSystemInfo() not GetSytemInfo()
i missed a 's' Sorry...!!
RRenjith
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
Having created a dialog application with MFC in Visual C++6, is it possible to attach a small database to it?
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
That's perfect! Thanks a million.
|
|
|
|
|
what's the easiest way of getting the timestamp of a file using VC++/MFC. i am using CStdioFile.
any help would be appreciated!!!
thanks!!
|
|
|
|
|
CFile::GetStatus()
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks!!
|
|
|
|
|
Does VC++ 7 code compile into IL as well?
If so wouldn't that take all the glory out of VC++?
|
|
|
|
|
Yes, ALL .NET "compilers" compile IL code too!
doesn't it!?
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
I have dialog based application,If user click on a button I waana exit from application.Can some one tell me the code?I know it must be one or two line.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I think if you call OnOK() in the main Dialog it should work. If not
PostQuitMessage(0) always does
|
|
|
|
|
Thanks.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
The function used to close a dialog box is EndDialog(int nResult) .
OnOK() or OnCancel() will automatically call EndDialog for you -- OnOK passes 1 (IDOK) for the nResult and OnCancel passes 2 (IDCANCEL).
Regards,
Alvaro
Intellectuals solve problems; geniuses prevent them. - Albert Einstein
|
|
|
|
|
Thanks.)
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|