|
There are many bugs in the version of STL that Microsoft ships. For instance, if you put more than 32,768 elements in a list and sort the list, some elements will disappear. Dinkumware has published some extensive patches at http://www.dinkumware.com/vc_fixes.html.
Another patch that dinkumware does not include is that if you want to sort a list using your own sort predicate (not just greater<>() ), you need to delete the line
typedef greater<_Ty> _Pr3;
in the header and then change the delcarations of sort() to
template<class _Pr3> void merge(_Myt& _X, _Pr3 _Pr) and
template<class _Pr3> void sort(_Pr3 _Pr)
He was allying himself to science, for what was science but the absence of prejudice backed by the presence of money? --- Henry James, The Golden Bowl
|
|
|
|
|
Hi,
I have a Problem with an ownerdrawn combobox. I want a special sort
order depending on the value in itemdata and the string.
In the CompareItem Method i cant get the string. ItemID2 of the
CompareItemstruct is always -1. ItemID1 is 0 or 1, the Itemdata1 is correct,
not the Itemdata2.
Where is my Problem
Chris
|
|
|
|
|
From MSDN docs on COMPAREITEMSTRUCT:
"itemID2: This member will be –1 if the item has not been inserted or when searching for a potential item in the list box or combo box."
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Yes, I know the docs.
It happens after i called the AddString and SetItemData functions (I hope the function names are correct).
chris
|
|
|
|
|
When you call AddString on owner-draw combobox with CBS_SORT and no CBS_HASSTRINGS, its index must be determined. WM_COMPAREITEM is sent to combobox parent, and MFC forwards it to your CompareItem method. This happens *before* item is actually added to the list, so -1 in itemDataX represents the item being inserted.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
im facing a problem while doing my college project.
i want to bind the fields of a property page to fields of a database, but im unable to do so. i would be pleased if somebody could give me a workaround..
Thanks
Tejas.
Email: tejasbj@yahoo.com
TJ
|
|
|
|
|
Hello guys,
1 - anyone know where can I find **simple** proxy program (I mean a source code) ?(no MFC or class )
do you know where can I found a great site for C/C++ source code (I mean simple source code to learn from it so I dont mean a realy or a big program)
sorry for my poor english and thank You
--------------
http://www.SaudiABM.com
|
|
|
|
|
Hi!
I downloaded Windows Installer because I got sick of InstallShield. Way to complicated. My problem occurs when I create shortcuts to my programs.
I live in Sweden. Some of us use swedish windows, some use english. In windows installer, your starting point for creating shortcuts on the start menu is the start menu. So, if I create shortcuts like Programs\myappgroup\myapp, everything is fine if the user has english OS. If the user has swedish, the folder Programs will pop up above the programs folder( Program in swedish ). The problem also works the reverse way. So, how can I tell Windows Installer to only create subdirectories if the parent directory exists?
|
|
|
|
|
Hi all,
I want to know can i write Date in in to DATE field in Ms-Access database ???
It mean, does Ms-Access have Date and Time field,
if YES, then how can i write my data in database ?
hmmm, it mean I must write my data in String format, like = "02-13-2001" for writing in database ???
or i have any other way ???
And can i query and search on the Date field ? how ?
in last excusme ... because i don't know english.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Access has a Date/Time format format, one of the column types in the table
design view. One sort of quirky thing is Inserting using the date constant.
Access date constants take the form #mm/dd/yy hh:mm:ss PM#
24 hour time also works. You can probably use other formats but these
I've tried.
INSERT INTO [MYTABLE] ([MYDATE]) VALUES (#06/14/2001 2:18:21 PM#);
Hope this helps
--Chrys
|
|
|
|
|
hmmm, ok, you used SQL for writing date in date field
Now, Please write example about writing date in date field by CDaoRecordset object.
Thanks for reply.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I'm starting work on an already-existing project that has an 80-column source file limit. While I don't really care about 80 columns, I'm catching heat from my colleges for not abiding by it. Can I set a vertical line in the IDE like Borland does?
Thanks in advance.
-Jason
|
|
|
|
|
Check out Visual Assist from www.wholetomato.com, it has the option you looking for -- plus lots of other cool things. Aside from that you'll just have to make a mental note to always press return when you reach 80-column width... not exactly dificult, just tedious.
-Ben
"Its funny when you stop doing things not because they’re wrong, but because you might get caught." - Unknown
|
|
|
|
|
Hello.
As I need to rotate a bitmap before displaying it I'm trying to access the actuel pixels of the bitmap, the bitmap is in my resources.
I'm using the following code to load the bitmap and get a pointer to the data:
HGLOBAL gBmp;
HRSRC resBmp;
BITMAPINFO *bmpInf;
char *bmp_ptr;
resBmp = FindResource(ProgID, MAKEINTRESOURCE(IDB_BILD_TREK), RT_BITMAP);
gBmp = LoadResource(ProgID, resBmp);
bmpInf = (BITMAPINFO*)LockResource(gBmp);
bmp_ptr = (char *)(bmpInf + bmpInf->bmiHeader.biSize + bmpInf->bmiHeader.biClrUsed * sizeof(RGBQUAD));
Now the BITMAPINFO is okay, biWidth and biHeight at least specify the correct dimensions.
But with some test code I can see that the drawn image is all wrong:
for (int y=0, x;y
|
|
|
|
|
Hi,
I can't comment on Load/Find/LockResource and bitmaps, but think that you should consider using ::LoadImage with LR_CREATEDIBSECTION flag. This gives you direct access to bitmap bits - you'll be able to rotate quickly.
Search for CDibSection on CodeProject if you want to use ready-made wrapper.
Cheers,
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Does anyone know if Whistler sends a WM_UNICHAR message to
send Unicode characters to an ANSI app.
I've compiled everything with this in, but do not seem to be receiving the message
|
|
|
|
|
When using Dialog based application you can't choose what file type the files is to be!
How do I do this in dialog based!
And how does my app know if I storing or loading in dialog?
/*
BETA
*/
|
|
|
|
|
Dialog based applications do not use documents/views, so choosing file types and reading/writing is left to you. What exactly is the problem? Passing correct filter to CFileDialog?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hey all,
First off i'll try and give you as much background wihtout dragging on too much. I wanted to create a custom I/O control for one of my applications. Basically it looks like an altimeter. It has an analog dial, an led section and a buttons section. Still with me? So i wrote a CPanel Class that allows the end user to either create an input or an output control by using some functions to change its behavior.
Now I need six of these bad boys on the screen at once. This control is graphic intensive(lots of bitmaps) and it sucks GDI resources down by a sizeable amount but we are still in the green. Now when i use the Create(..) functions to get 6 of these on the screen, at first it looks like i get them however, just playing with the control elements tells you otherwise. I get 3 of my controls that function normally and then I get 3 "ghost images" of my control. These ghost images are basically like a bitmap of what the control should be but they are not active. They dont respond to any input, they dont show up in the tab order..they are essentially not there.
This is driving me nuts...any ideas?
All six panels are sharing the same resources.CPanel is comprised of 3 other dialogs. CLedPanel, CDisplay1 and CDisplay2. CDisplay1 and CDisplay2 are switched based on what mode oyu are in. Ony one will be displayed at a time.
I know this is a shot in the dark but i had to try
thanks for any input you may have
"DWORD my man!"
|
|
|
|
|
I'd use Spy++ first to look at 'ghost images'. Are they real windows? Style bits set correctly? Do they receive any messages? etc.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Tomasz,
I've already tried that but it has led me nowhere. If you use spy++ on it there is nothing there. It recieves no messages, has no window, etc. The creation for each of the six windows is the same except for the coordinates and a different id. I do not understand why it would stop working after the 3rd instance of that CPanel class.
I stepped through the Creation of the window and everyhting seems normal.It is a window and has a valid handle. Its just when the windows finally get painted there is nothing there.
I am really lost here.....but thank you.
Nice screensaver BTW
Regards,
Eric
"DWORD my man!"
|
|
|
|
|
I need a handler that knows when the mouse is over the button, so it can perform a statement.
Thank you for your Help
Santiago Suarez
|
|
|
|
|
Maybe try to use classwizard to associate WM_MOUSEMOVE with metod:
void OnMouseMove(...)
|
|
|
|
|
I did what you told me but it performs the statement is in the window not in the button, which is what i need.
Please help me clarify this problem.
SSR
|
|
|
|
|
hi,
i get the following error when i use LineDDA ,
C:\WINDOWS\Desktop\Edge\EdgeView.cpp(105) : error C2440: 'type cast' : cannot convert from '' to 'void (__stdcall *)(int,int,long)'
None of the functions with this name in scope match the target type
void CEdgeView::OnDraw(CDC* pDC)
{
CEdgeDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
//ptr is declared in my codes, but i didn't paste it here
::LineDDA(m_PCenter.x, m_PCenter.y, ptr->Coord.x, ptr->Coord.y,
(LINEDDAPROC)LineDDAProc, (long)pDoc);
}
void CEdgeView::LineDDAProc(int X, int Y, LPARAM lpData)
{
CDC* pDC;
pDC = (CDC*) lpData;
pDC->SetPixel(CPoint(X,Y), RGB(0,0,255));
}
does anyone know how can i fix the error?
Thanks
Ehsan
Ehsan Behboudi
|
|
|
|