|
It's too much job. I am looking for Windows' direct support this feature.
|
|
|
|
|
Hi Experts,
I am in a confusion.Please guide me.
I am writing a code to get a string from RCR32 value I know different string may have same CRC, It is not a issue.
I need to get the string(whatever) for CRC.
I am creating the string combination of length 1 to n and calculating the CRC of that string and matching the CRC with desired CRC.
But this is very slow method.
What the the fastest algorithm I should adopt to do so?
|
|
|
|
|
AFAIK there is no algorithm for "reverse CRC", other than the brute-force approach you are already taking. So what remains to be done is choosing a fast implementation. One can speed up CRC calculations a lot by using a table-based scheme. Here [^]is one.
BTW: there are a lot of CRC schemes, each resulting in a different CRC value for a given set of data!
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
You may do some reverse engineering to get String from CRC. Although that's not feasible. CRC produce unique set of bytes for any data (in your case it is string). As you mentioned correctly, it may not be Unique. The process is slow unless you know how to optimize it.
One more method is to use MD5 or SHA1. Although the whole purpose of MD5 is to authenticate the data (and it uses Hash function - which may take extra clock cycles), it can also be used smartly to replace CRC. There is a exhaustive list of error-correcting algorithm which I am not mentioning here. Pick any of those according to the importance of the transfered data.
(CRC converts data => Checksums so the only way we can get data be CRC is by trial and error)
CHEERS!!!
|
|
|
|
|
What's the major purpose for the "Customize the toolbox"? As far as I know I can put text in the toolbox to facilitate some coding, is it possible to put a "Color picker"(Color dialog box as in photoshop) in the toolbox?
|
|
|
|
|
|
My software need to use MMC control and run on Windows7.
but when I try to register MCI32.ocx by bat file that include the code "@echo off regsvr32 MCI32.ocx" I've got some error
"The module "MCI32" was loaded but the call to DllRegisterServer failed with error code 0x8002801c"
I have used in Windows XP and never seen this problem before.
Please anybody help me to solve this problem.
|
|
|
|
|
I put "0x8002801c" into Google and a treasure trove of pages came up.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Please try to run the command prompt as "Run as Administrator" and then run the batch file.
|
|
|
|
|
This is regarding privilege to access Registry. The error code "0x8002801c" (Error accessing the OLE registry) says that you don't have write permission to the registry. You may have to run the bat file with high privilege, to do so run the bat file by right clicking on file and selecting 'Run as administrator' option.
|
|
|
|
|
|
I have a home-made app which performs fine, until the system is rebooted/restarted. Then I get the message "Ending program ... please wait", a timeout occurs, and then the app ends. As this is the only app which responds in this way, I assume that I have not coded the response to a system message which is causing the timeout. What system message is being sent and what response should be made to cause immediate termination ? Thanks in advance !
Doug
|
|
|
|
|
Not completely sure but maybe what you need is WM_QUERYENDSESSION[^] or WM_ENDSESSION[^]? This[^] here might also be useful to read.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
AFAIK a Windows app will get terminated automatically if it is a WinForms app (hence a message pump is active) with proper event handling (always responsive, so no long-winding event handlers), AND no extra threads are running in the foreground. If you need background activity, I recommend you mark your threads background ones, so they don't prevent app shutdown.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Found the "problem" ! (Embarresing really !) I wrote this app a long time ago and used a dialog-based MFC app but prevented the dialog appearing so that it effectively ran in the background. The main "routine" was in InitDialog() and effectively prevented messages being handled by the "window". Now create a thread in InitDialog(), let it complete, and hide the window in another way. WM_QUERYENDSESSION is now handled, and all works fine ! Thanks for your thought-provoking comments !!
Doug
|
|
|
|
|
I'm currently coding on a project where I need to post a user-defined message together with a LPCWSTR parameter.
But I don't know how to achieve that coz you know, PostMessage() only provides parameters typed as WPARAM and LPARAM.
Anyone could help?
Many thx in advance.
|
|
|
|
|
Cast[^] your string to LPARAM and do the reverse at the receiving end.
The best things in life are not things.
|
|
|
|
|
but be aware that if your string is transient ((new'd and delete'd) or stack based), it'll possibly be corrupt at the other end if you PostMessage it ...
|
|
|
|
|
I'm well aware of that. However, if the OP is not aware of casting then I doubt he'll be into something as advanced as new and delete .
The best things in life are not things.
|
|
|
|
|
barneyman wrote: but be aware that if your string is transient ((new'd and delete'd) or stack based), it'll possibly be corrupt at the other end if you PostMessage it ... How so? In order to pass strings from one thread to another using PostMessage() , new and delete are highly recommended.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
|
Let's hope both the sending and receiving end is in the same process-space.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
guys, any clue if LZMA could be parallelized to be run in some way that makes it worth being run on a GPU rather than over a CPU?
The idea is to compress text.
Also: which would be better : ctw or lzma ?
thanks
|
|
|
|
|
Don't know much about compression algorithsm and somesuch but to make the GPU do things for you i would look into programmable pixel/vertex shaders, CUDA[^] and ATI Stream[^], maybe one of those can help you get started.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
thx man. There is already a bzip cuda project but none that uses LZMA
|
|
|
|