|
What do you mean by "pure C++"?
If I get your question, the answer is no, you cannot overload + to concatenate two char arrays. At least one argument must be a user-defined type.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Michael Dunn wrote:
What do you mean by "pure C++"?
What I mean is if it possible to create a class with C++ syntax (non-MFC) that could preform exactly the following operation: String = "Hello " + "World";
Michael Dunn wrote:
If I get your question, the answer is no, you cannot overload + to concatenate two char arrays. At least one argument must be a user-defined type.
But can cString preform this operation?
Meaning can cString do this?: String = "Hello " + "World";
If so then why can cString do it and not a custom class?
Aidman » over and out
|
|
|
|
|
Aidman wrote:
What I mean is if it possible to create a class with C++ syntax (non-MFC) that could preform exactly the following operation: String = "Hello " + "World";
No, read my previous post again for why this is not possible.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Ok, but can cString preform this operation?
Aidman » over and out
|
|
|
|
|
|
Ok Thanks
Aidman » over and out
|
|
|
|
|
I have a toolbar control with a multi-line edit box. The buttons in the same toolbar however are not aligned in the middle of the toolbar. It stays the top. When the size of the band is bigger than a button's height, it doesn't look very elegant. But if you look at IE toolbars, like the Address bar, when its height is bigger, the Go button stays in the middle.
Does anybody know how to do that?
The toolbar is similar to the one described by
http://www.codeproject.com/atl/ietoolbartutorial.asp
Thanks.
|
|
|
|
|
This is kind of off-topic so....
What is the prefered background color in order to reduce the strain on the eyes. The setting goes through properties->appearance... (just to clarify what I mean) under MS Win (or maybe under VC properties).
Maybe each and one of you have different prefered color but is there a standard for this
Sorry about the lousy English.
-----------------------
Go USA Go
|
|
|
|
|
|
I use light grey. It seems very easy on the eyes.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
If you use system colors, you can let the user decide.
|
|
|
|
|
I've heard blue and yellow are the 2 easiest colors on the eyes...
I have an 1984 Suzuki RM80 dirtbike and those are it's primary colors. I've always thought it was easy on the eyes.
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hockey wrote:
I've heard blue and yellow are the 2 easiest colors on the eyes...
I have an 1984 Suzuki RM80 dirtbike and those are it's primary colors. I've always thought it was easy on the eyes.
Laughin so hard I almost fall off my chair
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
I think you're asking about what colors to set in the IDE itself? I prefer white text on a black background.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
That's what i meant. Thanks, I'll try both suggestions.
-----------------------
Go USA Go
|
|
|
|
|
the best would be to select dull colors like grey , or even black in the background would do fine .
|
|
|
|
|
hi all,
How to create menu shortcuts in a vc application. I am using dialog based application. I tried out accelerator, but it is not working. Can any one help me...please.
Mahesh
|
|
|
|
|
|
Hai Nish,
I am the Mahesh you know very well.
Thanks..Nish. It's working now.It was a nice article to read.
Mahesh
|
|
|
|
|
Yeah. The subject says it. How to display a true colour icon in the sys tray? It seems my icons change magically to 16 colour when in the sys tray. It's driving me mad. I've been at it for the whole afternoon now without success.
Here's what I'm doing.
void CMyClass::ShowTrayIcon()
{
if(m_bTrayIconCreated == FALSE)
{
if(m_IconList.m_hImageList == NULL)
LoadSysTrayIcons();
ZeroMemory(&m_SystemTray, sizeof(m_SystemTray));
m_SystemTray.cbSize = sizeof(NOTIFYICONDATA);
m_SystemTray.hWnd = GetSafeHwnd();
m_SystemTray.uID = 1;
m_SystemTray.hIcon = m_IconList.ExtractIcon(0);
m_SystemTray.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
m_SystemTray.uCallbackMessage = TaskbarCallbackMsg;
_tcscpy(m_SystemTray.szTip, SZ_APPNAME);
m_bTrayIconCreated = Shell_NotifyIcon(NIM_ADD, &m_SystemTray);
}
}
BOOL CMyClass::LoadSysTrayIcons()
{
CBitmap cBitmap;
BITMAP bmBitmap;
CSize cSize;
int nNoIcon;
if(!cBitmap.Attach(LoadImage(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDB_BMP_SYSTRAYICON), IMAGE_BITMAP, 0, 0,
LR_DEFAULTSIZE | LR_CREATEDIBSECTION)) ||
!cBitmap.GetBitmap(&bmBitmap))
{
return FALSE;
}
cSize = CSize(bmBitmap.bmWidth, bmBitmap.bmHeight);
nNoIcon = cSize.cx / 16;
RGBTRIPLE* rgb = (RGBTRIPLE*)(bmBitmap.bmBits);
COLORREF rgbMask = RGB(255, 255, 255);
if(!m_IconList.Create(16, 16, ILC_COLOR24 | ILC_MASK, nNoIcon, 0))
{
return FALSE;
}
if(m_IconList.Add(&cBitmap, rgbMask) == -1)
return FALSE;
cBitmap.Detach();
return TRUE;
}
You might have noticed that I commented out the mask colour in the LoadSysTrayIcons() function in the line COLORREF rgbMask = RGB(255, 255, 255);/*RGB(rgb[0].rgbtRed, rgb[0].rgbtGreen, rgb[0].rgbtBlue);*/ with the actual RGB value. This was because the correct colour was not being obtained in the rgbMask . Is it the cause of the problem, ie that the function is not somehow reading the bitmap data properly? What am I doing wrong? Or am I taking an entirely wrong approach? I tried loading icons instead of a bitmap into the imagelist, but that failed to load the true colour icons too. I'd really like to have the icons in an imagelist, but whatever works will be fine with me. As long as the icon is true colour.
Please help. Thanks.
Regards,
Rohit Sinha
|
|
|
|
|
Have you checked the icon which comes from ExtractIcon(0) ?
When I look in the MFC source and the MSDN docs, it all boils down to the function ImageList_GetIcon . Maybe it's retarded in the way that it will only create 4-bit color icons?
Try adding your icon in your resources as a true color icon and then put that in the tray and see if it's any different.
--
Some of them wants to abuse you
Some of the wants to be abused by you
|
|
|
|
|
Jörgen Sigvardsson wrote:
Have you checked the icon which comes from ExtractIcon(0)?
OK I'll do that. I admit I didn't do it till now. :feeling_dumb:
Jörgen Sigvardsson wrote:
Try adding your icon in your resources as a true color icon and then put that in the tray and see if it's any different.
Yeah, I've tried that too. Didn't seem to work.
Regards,
Rohit Sinha
|
|
|
|
|
Jörgen Sigvardsson wrote:
Have you checked the icon which comes from ExtractIcon(0)?
I checked it now by displaying it inside a dialog box and the icon is indeed displayed in all its glory in true colour. Dunno why it's not so in the systray though.
Regards,
Rohit Sinha
|
|
|
|
|
Hmm. How odd! I wish I had any more ideas/suggestions, but I don't. Partly because I'm slightly intoxicated.
--
Some of them wants to abuse you
Some of the wants to be abused by you
|
|
|
|
|
Rohit
Prior to Windows XP, the task tray supports only 16 color icons because it used a 4bpp image list. Perhaps there is some technique to replace this image list. But anyway you now know why your icons dont show properly.
HTH
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|