|
Hi Niklas,
thank you for your feedback.
What are those keywords
For example
Path = C:\My Files\Sun.jpg
Keywords:
how many of those have you got for each path
Hard to say, but to give you a number, each path has about 10 keywords on average.
The problem must reside in the layout of your data.
Are there any more sophisticated ways to 'cross-link' data ?
Regards
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
...coming to think of it, this layout is really expensive. One solution would be to use four containers instead of two.
set<string> allMyKeyWords;<br />
set<string> allMyPaths;<br />
map< set<string>::iterator, set< set<string>::iterator > > m_path2keywords;<br />
map< set<string>::iterator, set< set<string>::iterator > > m_keyword2paths;<br /> Thus, in the maps you will only store iterators to the external sets (pointers to strings) rather then storing all strings hundreds (?) of times.
|
|
|
|
|
Aargh, formating formating
set<string> allMyKeyWords;<br />
set<string> allMyPaths;<br />
map< set<string>::iterator, set< set<string>::iterator > > m_path2keywords;<br />
map< set<string>::iterator, set< set<string>::iterator > > m_keyword2paths;<br />
|
|
|
|
|
Yes, this is really an interesting alternative.
What happens if I delete any items from these two sets ?
Are the remaining iterators (that are stored in the maps) still valid ?
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
What happens if I delete any items from these two sets ?
Are the remaining iterators (that are stored in the maps) still valid ?
Nope. They are NOT. There are at least two ways to go here:
1. When removing let say a keyword, you will have to look up that entry in both maps (this is really not different from what you probably would have done with your original datastructure.) Removing items this way could be a lengthy operation on huge sets.
2. Depending on how you use the data, when removing a keyword, you could just set the actual keyword string to something that is invalid as a keyword, maybe an empty string? If you keep these structures as long as your app is running you will eventually get a lot of 'holes'. But the removal process is as fast as it could get, leaving (minor) performance penalties for other operations where you have to determine if an entry is valid or not. You could even run a clean-up pass to remove those holes whenever the app has nothing else to do.
|
|
|
|
|
Sorry for the delay, I had visitors.
I think I can get along with 'holes' very well, so I'll try to realize the 'iterator solution'.
Thanks for your ideas.
Regards,
Achim Klein
We can do no great things, only small things with great love. - Mother Theresa
|
|
|
|
|
hi guys.
i am trying to use pointers to functions in my dll to call a function in my .exe
i am storing my pointer in a global variable, so it can be called by any function.
the trouble is, i am finding that it can be only called by my addeventCallback function
i.e.
Code:
#include "dll.h"
EVENTCALLBACK evtcb = NULL;
BOOL WINAPI AddEventCallback(EVENTCALLBACK ptr) {
evtcb = ptr;
evtcb("pass on the message!");
evtcb("pass on the message!");
}
LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam) {
if(nCode < 0)
return CallNextHookEx(0, nCode, wParam, lParam);
evtcb("pass on the message!");
this displays "pass on the message" twicein the console, but when i try to cal evtcb() from GetMsgProc, it does not show again, meaning it has failed somewhere.
i know my GetMsgProc is fine as i have used other indicators such as MessageBepp(0) to show it is working.
what is the problem here?
cheers.
-- modified at 8:50 Thursday 8th September, 2005
|
|
|
|
|
How to create a wizard based project .
Plz send me a simple application to create a wizard based program
Praveen Chowdam Kumar
|
|
|
|
|
|
how can I retrieve the text from windows text editors using the keyboard cursor position
thank u
|
|
|
|
|
Samik Karmakar wrote:
windows text editors
What do you mean by that ? You mean Microsoft Word ? If yes you have to look for 'Word automation'. Otherwise be more specific.
|
|
|
|
|
i want to retrieve the text from any text editors notepad, wordpad.
i want to retrive the text when the cursor is over the letter.
example: say i have the word : text and my cursor is on 't'. so i want to retrieve 't' . now if i move the cursor from t to 'x' then i want to get 'x' retrieved say in a message box .
thank u
|
|
|
|
|
You'll need to use the EM_CHARFROMPOS message.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I have a pattern brush I would like to modify. The brush itself is to be used by windows internals.
My question is if it's at all possible to do something like
<br />
LOGBRUSH lb;<br />
::GetObject(hBrush, sizeof(LOGBRUSH), &lb);<br />
hbm = (HBITMAP) lb.lbHatch;<br />
::SelectObject(hdc, hbm);<br />
and the draw to the dc? If I already sent the hBrush to a win API function, will it be the very same I am trying to modify, or is windows using a copy of it (which means there's no point in doing the above)?
The win func is SetMenuInfo() but I doubt that matter.
|
|
|
|
|
To play mp3, I use MCIWndPlay macro. I want to make the tune to be played repeatedly until user wants a stop. Does anyone know how to do it?
|
|
|
|
|
|
(I am bing daft here - I have not much knowledge of mm programming.)
I wanted to use mci functions but hit a rock, because I do not know how to retrieve device id, and the device id is required to send the commands. Can you shed some light or point me to relevent sites? I tried but could not find any example telling me how to get the id, i.e. what name should I use in
MCIDEVICEID mciGetDeviceID(
LPCTSTR lpszDevice
);
I think once I know how to retrive the device Id I should be able to cook. PS I looked at the system.ini file, as a few internet findings suggest, but found nothing under the [mci] section.
|
|
|
|
|
Assuming you know the name of the .mp3 file (I'm boldly assuming it's a file), you can simply do:
<code>
char szMp3File [MAX_PATH];
strcpy (szMp3File, "C:\\myFile.mp3");
VERIFY (::sndPlaySound (szMp3File, SND_LOOP | SND_ASYNC));
...
<code>
VERIFY (::sndPlaySound (NULL, 0));
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I tried the sndPlaySound(...) and passed in a .mp3 file but the mp3 file did not get played. instead, a wav file was played. I guess it is because this func works only for wav file so a default sound was played rather than the mp3 specifed.
In fact before I use the mp3, I was playing a wav file instead, using the PlaySound(...), which is similar to this one you suggested. I thought I should move up the ladder a bit by tackling more advanced multimedia stuff, which means the application can be more flexible. This is the background info of how I got here...
Do u happed to know how to get device id? It is really nice to know.
|
|
|
|
|
Perhaps this[^] article will help? Btw, I use BASS[^] to play MP3 files. I've also heard good things about FMOD[^]. Good luck!
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
if i have a handle to a msn chat window ... how can i send messages using it ... i read the article about retrieving text from the chat window ... also how for example can i get the email of the person ... ?
- i want to make an auto replier for msn ...
|
|
|
|
|
I haven't much read about its architecture. But Generally interfaces should be exposed, as it is COM based architecture. Look for interface of your interest and use it. It should have api's like sendmessenge.
|
|
|
|
|
I am getting a very strange prob ... I get a messagebox in english when I run it through French XP ... I am not understanding what can be the prob ... I have checked my resource file ... I have set the Language ... Some one with any suggestion .. I have read the articles on codeproject .. SOme one gone through similar problem .. Any Solution ?
|
|
|
|
|
1. You better go for custom message box, the code you can get it by google search.
2. Or if you use windows NT based operating systems, you can try to use French localized dlls.
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
How to add an Icon to the SystemTray.
When I run my application ,Application is executing
(dialog based appli) as well as icon is adding to system tray.
But my requirement is when I run appli., It initially added
to Taskbar(tray).,When I right click on icon a menu will display .
After I clicking a menu item (Start) application will Starts.(i.e,ShowWindow(SW_NORMAL))
----
>I added code(code to adding to tray) in OnInitDialog.
But It is displaying as previous .
>Initially I dont want to show window.
Plz Send a simple code to add an icon initially to system tray.
Praveen Chowdam Kumar
|
|
|
|