|
may you describe it a bit more?
but... if you create a "normal" hashkey which
is suitable for the hashspace, and then transform it to ASCII?
LOWELL = 76 79 87 69 76 76
-> S = 7679 + 8769 + 7676 = 24124
your hashspace is 19937 (should be prime)
24124 % 19937 = 4187
and now put it to ASCII 41 and 87
|
|
|
|
|
I have a 2D array (1024x1024) of intensity values of an image in my VC++ code(which is not stored on disk as a bmp or jpeg), and I have a dialogbox which contains an image within a frame of 400x400 pixels already. I want to compress my 1024x1024 array of pixels and set a transperent mask of this on top of the existing image in my dialog box. I am trying to find the best way to do it. Any suggestions would be appreciated.
|
|
|
|
|
Does anyone have a small C++ example on how to use the Image Mastering API (IMAPI) in Windows XP?
In what file does the type library appear in? There is an executable called imapi.exe in the System32 directory but it does not contain the type library.
Regards
Martin
|
|
|
|
|
I have been messing around with the start menu caption.. it's easy in WinXP as once you have EnumChildWindow'ed your way down to it, it's just a case of ::SetWindowText(). However, it's not so easy in W2K as the window text does not correspond to the text in the button... I see that is has the BS_BITMAP style so it's all a bitmap??
any suggestions?!
cheers
Ad.
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
adamUK wrote:
I see that is has the BS_BITMAP style so it's all a bitmap??
Yes that's correct. Windows explorer creates the bitmap at runtime from the text and the flag icon. You can do the same, if you want to
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
adamUK wrote:
any suggestions?!
See http://www.winguides.com/registry/display.php/791/
|
|
|
|
|
|
Hi,
I am trying to create a Modeless Dialog Box with a RichEdit Control using Visual Studio.Net. I am not using MFC as my project is a Win32 project using just the Windows API, but the Rich Edit Control Does not get created when I pass the Dialog Template to CreateDialog(), when I change the resource to a normal Edit control everything works fine. I tried another option of Creating the control using CreateWindow("RICHEDIT"....), this does not seem to work too, I tried getting the Last Error and found that the "RICHEDIT" class is not registered, I tried "RichEdit20A" and that failed too, can someone let me know what I am missing here? Note that this is not an MFC application but plain Win32 API application.
-TIA
Sundar
|
|
|
|
|
Have you initialised it using BOOL AFXAPI AfxInitRichEdit() in the initinstance of your app? I can't remember if it is purely and MFC requirment or not...
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
"I suppose if it was a choice between bon jovi and the interior of a car, the car would win, even it didnt have a radio and I had to sit in silence" James Simpson on Light Metal.
|
|
|
|
|
You need to load the rich edit ctrl library before creating any rich edit controls. Load "riched20.dll" for rich edit version 2+, or "riched32.dll" for version 1.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Hello all,
My App needs to load a a list of configurations into a list view at load time. The list will then be user modifiable (add, delete, edit).
What would you all consider to be the best way to do this. An INI file storing each configuration and stored in a folder under the working folder, and loaded at runtime? Or, doing the same thing in the registry.
And, how would you keep track of the items so that the correct number are re-loaded back at runtime. For example:
At startup the list contains 4 items. Item0, Item1, Item2, and Item3. The user deletes Item2. Now there is no real index to keep track of, I can see there are 3 files, but loading them in any logical progression is no longer an option.
Thanks for any suggestions you may have.
Frank
"Keyboard Error - Press F1 to Continue"
|
|
|
|
|
What is the maximum size of the list of configurations? If it is relatively small, one solution is registry. Otherwise, one solution is to save the configurations on disk.
Kuphryn
|
|
|
|
|
Hi All,
I want to write Windows Service in VC++. How should i do it? can someone give me sample code for this?
Thanking u in advance.
Bye,
Prasad
|
|
|
|
|
|
Hello all,
I'm writing an application in which requires the list of processes currently running. Is there any to do it and also I would like to know whether we can can get handle to a specific process or not. I anyone knows how to do it, please help me.
Thanks for your help.
|
|
|
|
|
Look at EnumProcesses() in the psapi library.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi!
Are memory mapped files typically used for loading/saving speed, or is it just to handle incredibly large files?
I'm currently in a situation where I need to load and parse large
files (~20 MB) and I'm wondering about the different strategies for doing that as fast as possible.
Thanks
Shawn
|
|
|
|
|
They eliminate the need to hit the disk multiple times. With a 20MB file, you will notice a difference. With smaller files, the gain, if any, is negligible.
|
|
|
|
|
For some situations it's more convenient to use memory mapped files (e.g. if your file is structured with offsets to given items), and so that you can have a disk-backed data structure. It really simplifies programming such a shared structure - you don't have to explicitly read or write the file, you just read from or write to memory.
Note that there isn't any particular improvement in speed, nor any fewer disk hits: pages of a mapped view of a memory-mapped file are still paged in (and out) on demand.
SQL Server makes a lot of use of memory mapped files, IIRC.
If you're just reading a file sequentially, rely on the file system caching. It'll do much the same thing and is typically less complicated to program. To optimise the caching behaviour, pass the FILE_FLAG_SEQUENTIAL_SCAN or FILE_FLAG_RANDOM_ACCESS flags, depending on how you're using the file. If you specify one mode but your program actually reads the other way, performance is typically worse than if you hadn't specified either flag. Essentially FILE_FLAG_SEQUENTIAL_SCAN tells the system to read-ahead a lot and not at all behind, whereas FILE_FLAG_RANDOM_ACCESS tells it not to read ahead or behind very much. Specifying neither gives a compromise mode that does a little read-behind and some read-ahead. FILE_FLAG_SEQUENTIAL_SCAN causes pages behind the current file pointer to be discarded aggressively.
For information on how Windows 2000 file caching works, see Inside Windows 2000[^], chapters 7 (Memory Management) and 11 (Cache Manager). Basically the system implements caching by memory-mapping the files.
|
|
|
|
|
Mike Dimmick wrote:
Note that there isn't any particular improvement in speed, nor any fewer disk hits: pages of a mapped view of a memory-mapped file are still paged in (and out) on demand.
True, but for the last project I changed, I simply read from a CMemFile instead of a CFile, and the subsequent processing time could be measured in minutes instead of what used to take days. That's quite an improvement.
|
|
|
|
|
CMemFile is not a memory mapped file. It's a block of memory that conforms to the CFile interface, i.e., you can treat it as if it's a file.
True memory-mapped files are a different thing entirely.
|
|
|
|
|
I disagree. A CMemFile object is a memory file that behaves like a disk file except that the file is stored in RAM rather than on disk. A MMF, by definition, provides you with the capability to map a view of all or part of a file on disk to a specific range of addresses within your process's address space. Once that is done, accessing the content of it is as simple as dereferencing a pointer in the designated range of addresses. I fail to see how they are THAT different. In either case, once the file is read from disk and into memory, you operate on the file in its memory-mapped state, using the appropriate functions. The MSDN article Q142377 offers another view.
|
|
|
|
|
How do I send a carriage return and line feed through a serial port?
|
|
|
|
|
Do you know how to open and send data to a serial port using OpenFile() and WriteFile()??
char data[] = "\n\r";
DWORD dwBytesWritten;
WriteFile(hSerialPort,data,strlen(data),&dwBytesWritten,NULL);
John
|
|
|
|
|
John M. Drescher wrote:
char data[] = "\n\r";
Ummm, you might want to try "\r\n" instead
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|