|
Looks good. I would expect to be picking up a large Open Source code base with this approach which might be a lot of work to bring up to whatever standards your shop requires. If this isn't a problem then it looks like you might have yourself a cool solution. I might even have a peek at some of it myself. I had to implement syntax colouring in an RTF based editor a few years ago and it was extremely difficult with very few code samples at the time. It woudl be interesting to see how it's supposed to work
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Please help me do a query based on date.
I have m_pSet (a pointer to CRecordset) and a filter m_strFilter
my date is a ColeDateTime in the form of "mm/dd/yyyy"
I need to set: m-pSet->m_strFilter to select records with birthday=1/1/1970
Any ideas.
Paulo
|
|
|
|
|
paulosuckow wrote: I need to set: m-pSet->m_strFilter to select records with birthday=1/1/1970
So what's the problem?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The problem is that it doesn't return any thing. If I remove that the date part from the query it works. what is the right way of adding the date to the query .
Thanks
|
|
|
|
|
paulosuckow wrote: If I remove that the date part from the query it works.
What does your (incorrect) query look like?
Is this with Access, Microsoft SQL, or some other?
BTW, posting the same question barely two hours later is considered bad etiquette.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: BTW, posting the same question barely two hours later is considered bad etiquette.
What about 4 times in < 22 hours
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am using a List box in my appln... When new items are added the new items are added down. I want the scroll bars to be always posistioned next to the last item being added.. Can any one help me how to achieve this ...
|
|
|
|
|
You can easily accomplish this selecting the last added item either with (MFC) CListBox::SetCurSel or (plain Win32) LB_SETCURSEL message.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks its working . . . but
can we just avoid that selection part . .. i jus dont want it to be selected..
is it possible to posistion the scroll bar alone...
|
|
|
|
|
Hi,
I am trying to display images for tree control nodes. My bmp file is having 256 colors. Problem is that at run time of the application, tree control is displaying blurred images. So I want to know is it not possible to display the tree control node images with 256 colors? If it is possible then how do that? Please help.
Regards,
Raj
|
|
|
|
|
Rajkumar Rachoti wrote: So I want to know is it not possible to display the tree control node images with 256 colors? If it is possible then how do that?
It should be possible.
How are you displaying the images?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks a lot Mark for your time.
This my code to display the images:
m_imageList.Create(IDB_TREE_IMAGES,16,1, RGB(255, 255, 255));
m_navigationTree.SetImageList( m_imageList, TVSIL_NORMAL );
m_navigationTree.SetItemImage(m_hDisplay, 0, 0);
And IDB_TREE_IMAGES is a 256 colors bitmap.
Raj
|
|
|
|
|
I don't know why the images would be "blurred" unless the buttons aren't enabled.
Are the buttons enabled? Is bright white the "transparent" color for the bitmaps?
You could try this (although your code always works for me )...
Note I'm assuming 16x16 bitmaps in the imagelist -
CBitmap bitmap;
bitmap.LoadBitmap(IDB_TREE_IMAGES);
m_ToolBarImageList.Create(16, 16, ILC_COLOR8|ILC_MASK, numberofimages, numberofimagestogrowby);
m_ToolBarImageList.Add(&bitmap, RGB(0xFF,0xFF,0xFF));
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks a lot Mark. That worked. Issue was with Image List which default takes 4 bits for color.
Raj
|
|
|
|
|
Thanks a lot Mark. That worked. Issue was with Image List which default takes 4 bits for color.
Raj
|
|
|
|
|
Cool! Good to know I was thinking all my bitmaps (except the 24-bit ones) were 8 bit, so I
thought it should work, but they are 4-bit
Cheers,
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello board, I have programmed more than four years with MFC and I'm comfortable with it but I like to know should I consider programming in .Net? I specially want to know whether .Net is significantly faster than MFC or not and are there other advantages?
Thanks alot
|
|
|
|
|
How could it conceivably be faster, considering its a quasi-interpreted environment.
|
|
|
|
|
I don't believe .Net code is any faster than C++ one (I believe the contrary), albeit there is a strong controversy about. Anyway, for the average programmer, that is absolutely irrelevant. On the other hand, passing to .Net programming (on big projects and IMHO) may speed up noticeably coding activity and this usually matters.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
.Net Code is intrisically slower in almost everything except heap memory management. Because managed code uses the managed heap it can perform 10x faster than poorly written but otherwise similar C++/MFC code. However if speed is the issue you can ~always optimise the C++ code to end up faster than the best .Net equivalent.
The highly simplified version but basically sound version of things as far as I can tell is:-
It's a trade off between -
Moving to .Net makes poor-average MFC/C++ a lot - a bit faster.
Moving to .Net makes really good or really simple (i.e. very little heap usage) MFC/C++ code a bit slower.
You pays your money and you takes your choice
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: Net Code is intrisically slower in almost everything except heap memory management. Because managed code uses the managed heap it can perform 10x faster than poorly written but otherwise similar C++/MFC code.
Even that is questionable - CRT is much smarter than .NET marketing wants us to believe.
|
|
|
|
|
Sure it is smarter than the average bear but the CRT is also a catclysmic mess. Seven levels of function calls to do one allocation is already a high price to pay for a few bytes before you get into actual heap management. Granted it's not as bad in release code as the view you get in the debugger.
I wrote my own page memory manager that buy's pages off Win32 on a private heap and it beats the CRT by >10x in 1Gb of random <1MB size, allocations deleted in random order (Which is pretty much worst case for my implementation). <1s on an old Athlon 2100+. Doesn't suffer badly from fragmentation either .
It needs a hell of a lot more refining and tidying up before I post it to CP though and the average memory footprint at runtime is a little larger than with the CRT. Making that tunable is one of the refinements needed.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Electronic75 wrote: I specially want to know whether .Net is significantly faster than MFC
.NET is inherently slower than C++ (MFC or not) and, even worse, memory footprint of a .NET application is much bigger than the one of a similar C++ application.
|
|
|
|
|
|
CPallini wrote: Oh, where are you when some of CP gurus claimed, against my opinion, that C# was faster then C++, basing substantially their assumptions on a benchmark result?
Oh I believe it is possible to write a benchmark where C# would outperform C++. For instance, just use iostrem library a lot on C++ side, and here you are
|
|
|
|