|
Jörgen Sigvardsson wrote:
Uhm. You call this maintainable? CRC checksums?
With the proper tools, yes. All I have to do to update a string is highlight the checksum and corresponding string, including the comments, press a toolbar button and it's updated. Perhaps it's just me, but I dislike seeing a bunch of if statements. I'd rather see a switch. Note that I would not attempt this if I didn't have a add-in to regenerate the checksums. I even toyed with the idea of writing a small app that could be used in a pre-build custom step that would automatically refresh or generate any of the checksums. But I haven't run into any problems keeping up to date with the dozen of projects and numerous locations within each project. It just seems to work. If you have a better idea (and don't say a bunch of if's), then let me know. I realize it's not the most elegant, but it is quite efficient and, for me, quite readable.
Joel Lucsy
|
|
|
|
|
hey everyone, simple question
it seems like it should be so easy too, i just need to call use
CAboutDlg hey;
hey.DoModal();
from my main App Class.
its a dialog based project, and I get compilation errors like the app class cant see the cabout class.... please help, thanks
Deleting intermediate files and output files for project ' - Win32 Release'.
--------------------Configuration: - Win32 Release--------------------
C:\WINDOWS\Desktop\Eye.cpp(121) : error C2065: 'CAboutDlg' : undeclared identifier
C:\WINDOWS\Desktop\Eye.cpp(121) : error C2146: syntax error : missing ';' before identifier 'hey'
C:\WINDOWS\Desktop\Eye.cpp(121) : error C2065: 'hey' : undeclared identifier
C:\WINDOWS\Desktop\Eye.cpp(122) : error C2228: left of '.DoModal' must have class/struct/union type
EyeSpy.exe - 4 error(s), 0 warning(s)
todo....
:: insert inpirational text here ::
|
|
|
|
|
You need to #include the file that CAboutDlg is defined in.
he he he. I like it in the kitchen! - Marc Clifton (on taking the heat when being flamed)
NEW: Awasu v0.7[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
it is included. thats whats strange, and was the first thing i checked.. ill post code when i get home tonight.
todo....
:: insert inpirational text here ::
|
|
|
|
|
Here's a weird bug: whenever I clean up my list control (before repopulating it with data), I loop through it and delete memory I allocated for each entry. At the same time, I make a call to the SetItemData() method. The code looks like this:
delete node;<br />
m_PhotoList.SetItemData(i, 0);
For some strange reason, when I do this my OnItemChanging() method gets called. In that method, I set some data (in the node that I created). Obviously, since I've just deleted the node (because I'm cleaning up the list control), an exception is thrown (for accessing memory not available).
Anyone have [b]ANY[/b] idea why this is happening? This has really gotten me stumped...
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
LVN_ITEMCHANGING sends an NMLISTVIEW struct. The uChanged member tells you what changed in the item, so I bet if you inspect that member, it will contain LVIF_PARAM , meaning the LPARAM (ie, item data) changed. Your handler can ignore the notification in that case.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I have a CFormView that has an edit control, and my program has an accelerator key binding to the Delete key. When I select a word in the edit control and press Delete, the accelerator binding is invoked rather than the word being deleted in the edit control.
So, in other words, I want the delete key to act normally when my edit control has the focus. How can I correct this problem?
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
Do Arab fonts require UNICODE???
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I don't think so, if the system locale ( and codepage ) is set to some arabic language country/region, it might work. I know that the resource editor is not UNICODE, and will work in codepage.
but UNICODE will make life easier.
Max.
|
|
|
|
|
Thanks
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
I'm doing this project with ATL and I needed to use PumpMessage(..) but it's only available through MFC. So I looked at Mike Dunn's FAQ
http://www.codeproject.com/cpp/cppforumfaq.asp#ui_workerthread[^]
and did this:
void CSomeDlg::ProcessMessages()
{
MSG msg;
while ( PeekMessage ( &msg, NULL, 0, 0, PM_NOREMOVE ))
{
GetMessage (&msg, NULL, 0, 0);
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
And I'm calling every few lines of code. Looks to work ok... Is this safe?
Thanks!
|
|
|
|
|
It's pretty boiler plate. I reckon that is what MFC is doing, and I'm sure it's safe.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Boiler plate? I'm sorry, I'm not familiar with that expression!
Luc
|
|
|
|
|
It means code that is often needed and is always the same.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Yes, that's fine, although you can use the PM_REMOVE flag in the PeekMessage() call so you won't have to call GetMessage() right away.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Sorry, I posted this a couple of days ago then disappeared. I didn't post much info either (the problem then was me being totally dippy) so I thought I'd risk the wrath of you lads and post it again with more info, save the flogging for later please
Anyway, short story is that I have to extract email addresses from a lot of files which have been exported from a database. There is no general format to these files, so its a hack & slash search to find them. The only things I have guarenteed is that there will be a space before & after the address and that the @ character will only be in the email addresses, not in any other fields. A sample of the file would be something like this but a lot bigger (roughly 2000 characters each) and they can contain more than one email address.
asd98a7098a70d98as abc-def@hotmail.com as8709-898 Dundee Geffen oiu7098
What I'm trying to do just now is write a ParseEmail(CString wholeFile) function that gets the file passed to it, and it works through picking out the email addresses. My problem is that CString isn't behaving how I would expect
while(whoIs.Find("@",0) != -1)
{
int index = whoIs.Find("@",0);
TRACE("@ character at position %d\n",index);
int end = whoIs.Find(' ',index);
TRACE("end = %d\n",end);
int pos = index-1;
CString ch;
ch = whoIs.GetAt(pos);
while(ch.GetAt(pos) != ' ')
{
pos--;
TRACE("ch = %s\n",ch);
}
CString email = whoIs.Mid(pos,end);
TRACE("email address = %s\n",email);
whoIs.Delete(0,end);
}
The problem after all this long windedness that the finding of the space before and after the @ doesn't work as I expect. It usually ignores spaces and other characters and returns me 50 letter email addresses
Does anyone have an idea of how I could improve this function so that it actually works? Cheers and sorry for the 10,000 word essay
|
|
|
|
|
Strange, this had a 1.0 rating. Anyway...
Perhaps try CTokenizer: http://www.codeproject.com/string/tokenizer.asp[^]
The code would be something like this:
CTokenizer tok( YOUR_INPUT_STRING, " " );
CString str;
while( tok.Next( str ) )
{
if( str.Find("@") != -1 )
{
}
}
|
|
|
|
|
Larry Antram wrote:
Strange, this had a 1.0 rating.
One of the great things about having a high post count is that my vote one a post counts for more than most people ( possibly everyone except Nish). I gave it a 5 to bring it back up. I don't get why some people vote posts the way they do.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Why use C++ for this?
|
|
|
|
|
|
looks like a spammers tool to me
feed it some files (webpages, usenet dump)
and extract away ;
bryce
|
|
|
|
|
ack! i hope not.
|
|
|
|
|
eh, don't mean to be rude but f**k no I wouldn't work on something like that. Anyone who works on them deserves to have all of the spammers in the world thrown into a room with them and nuked alongside the <insert sweary="" word="" here="">.
Its all part of a contract I've been working on with an accountancy firm. Its a whole bigass project but the thing with the email address relates to them needing a central database with all the email addresses of their clients/partners/co-workers in the Far East and USA. The email part of it is pretty insignificant in the scheme of the whole project hence the bodge job before the demo next week
|
|
|
|
|
Don't shoot me, shoot bryce.
|
|
|
|
|
/me gets out the gun
Nah, I just think that helping people spam more crap about getting a bigger ehhhhhh member or sending your cash to a king fleeing his country so he can pay you back double is just asking to be shot. Spammers should have their testicle hairs pulled out by a lion, the people who write the mass-senders just need a good slap and to have their internet connections taken away.
|
|
|
|
|