|
another trick might be:
switch (val<=300?1:(val<=750?2:3))
{
case 1:
break;
case 2:
break;
case 3:
break;
}
--
Joel Lucsy
|
|
|
|
|
oh, i don't think it really works...
the compiler might say that val<=300?1val<=750?2:3) is not a constant expression.... (i don't know why but... )
TOXCCT >>> GEII power
|
|
|
|
|
You're right, my mistake. But, you can do the calculation just before the switch and stuff it into a variable and it'll work just fine. I use this type of technique occasionally so I know it works.
--
Joel Lucsy
|
|
|
|
|
hi
I have created a application for supporting another application.
So before installing my program i want to check if the main application is installed. If so i will have to move certain files from my application folder to the main applications folder.
Could anyone tell me how to accomplish this using installshield.
Thanks in Advance
Shiraz
|
|
|
|
|
Try the forums on InstallShield's site. This forum is for Visual C++, a programming language. FYI, though, there are wizards in InstallShield Developer that help you accomplish this and plenty of documentation to explain the manual steps.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello all I have normal images list that I use to display the CTreeCtrl item normal images
this is the way i set the images of the item.
<br />
m_NormalImageList.Create(IDB_BITMAP_NORMAL, 16, 6, RGB (255,255,255));<br />
smptree.SetImageList(&m_NormalImageList, TVSIL_NORMAL );<br />
<br />
treeStruct.item.pszText = nametoshow;
treeStruct.item.iImage = File_Or_Folder;
Parent= aTreeCtrl->InsertItem(&treeStruct);
they seem to works.. coz all the item has the right images as i wanted them to have.
but the problem is when you click on those images after display, the images are changing.
if you dont' click on the image, it stay the way it is.
for example, c:\tempfolder has the folder image, a.txt has file image, a.zip has zip file image but when I click on folder image which is c:\tempfolder, the image change from the folder to file, when you click again, it change file to zip file image, and you click one more time, it goes back to folder image.. like going entire IDB_BITMAP_NORMAL images list... and it is never stop changing if you dont' stop clicking on the images.
how can i prevent that effect? i want folder name to have always folder image, file name to have file image, zip file to have zip file image. diable to change image to image when you click on it.
thank you
|
|
|
|
|
There are two "normal" image indexes for each tree item: the normal-normal and the selected. Insert the following:
treeStruct.item.iSelectedImage = treeStruct.item.iImage;
|
|
|
|
|
Hey Guys
Does anyone know how i can get my software to put a drive icon in explorer and then when the user enters that drive it calls my software.
Peter
|
|
|
|
|
Sorry Guys completly pointless post i found michael's guide.
|
|
|
|
|
If you are reading my namespace extension article, keep in mind that a namespace isn't a drive. If you want an actual new drive letter, you'll need to write a device driver.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.
-- Michael P. Butler in the Lounge
|
|
|
|
|
I have an ansi c string, and I'd like to convert it to Unicode and stuff this into a std::basic_string<wchar_t>.
So, I thought I could do the following :
void transformAnsiToUnicode( const char* str, int stringLength, std::basic_string<wchar_t>& newStr )
int size = MultiByteToWideChar( CP_ACP, 0, str, stringLength, NULL, 0 );
newStr.resize( size );
int err = MultiByteToWideChar( CP_ACP, 0, str, stringLength, (wchar_t*)newStr.begin(), size );
if ( 0 == err ) {
err = GetLastError();
}
Now on VC6 this works perfectly (with either the default STL or with STL Port). On VC7 it bitches about
(wchar_t*)newStr.begin()
Is there away around this?
Is this even *legal* to do? Or do I have to allocate a new wchar_t buffer, use that with MultiByteToWideChar(), and then assign to the newStr variable, and then delete it?
Thanks
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Check out USES_CONVERSION and its conversion macros, they are easy to use.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Yes you have to create a new buffer and assign it. basic_string doesn't (and shouldn't) allow you direct access to it's internal buffer. You can only get a const wchar_t* from it by using c_str(). But if you try to modify it, you will wreak havoc on the basic_string. The only way to change a basic_string's contents is through its public access members (like operator=() or the contructor, etc.)
The maximum characters for the signature is five hundred. I was wondering how long a five hundred characters message would be, so I decided to make my signature 500 characters long. I'm sure if I had some cool html stuff in my signature, I could eat up five hundred characters, but just typing five hundred characters takes quite some time. The trick I think is finding something to say, but I'm usually a man of few words. So I guess I'll tell you what I've discovered is the secret to life. It
|
|
|
|
|
Jim Crafton wrote:
(wchar_t*)newStr.begin()
generates a warning because you cannot assume that an iterator is a pointer to anything. It may actually be a pointer, but making that assumption in your code is unsafe.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
Damn.
I understand the reasons for that, but it's just so damn annoying to have to allocate/copy/delete a tmp buffer for no other reason than that I can't get access to the buffer in std::string.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hi,
does anyone know how to get the secondary display monitor dimensions? GetSystemMetrics cannot do it, if I got it wright.
Tnks
Bernardo
|
|
|
|
|
Anonymous wrote:
GetSystemMetrics cannot do it, if I got it wright.
Isn't that what these are for:
SM_XVIRTUALSCREEN<br />
SM_YVIRTUALSCREEN<br />
SM_CXVIRTUALSCREEN<br />
SM_CYVIRTUALSCREEN
SM_CXSCREEN and SM_CYSCREEN are for the primary display, so maybe you could subtract the overall from the primay to get the secondary.
I do not have a dual-monitor system so these are only guesses on my part.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I'd like to be able to share a tree control or another child window between different parent windows. The tree control needs to be the same between them. Is this possible and if so, how?
"We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld
|
|
|
|
|
Simply not possible. By the design of windows a window cannot have 2 parents that creates it.
Notification will go only to one parent window only.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Only one parent window would be visible (or even exist) at a time. Is it possible to create the window in Mainframe and pass it to 2 different windows setting one as the parent?
"We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld
|
|
|
|
|
yes you can pass it to any no of windows for internal use, but only one window can be a parent.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hi.
I'm interested in being able to intercept calls to Dialup Networking. Ideally, I'd like to replace the dialog box that lets you connect to the internet with one of my own design. This means that all the calls (from contol panel, or starting internet explorer before connecting etc.) that result in the Microsoft dialup network dialog being displayed, should result in my own dialog being displayed instead. I want the only way to connect to the internet to be through my dialog.
Any suggestions about the best way to do this?
Cheers,
Harrold.
|
|
|
|
|
I have the memory test. It can find bad byte in memory`s array. I need to know what chip on memory module is bad.
Can you help me?
|
|
|
|
|
I'm just guessing, but if a utility could tell you what byte in memory was bad, I'd think it could also locate a bad chip on a module. How did you come to learn that your computer's memory had a bad byte?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You are running memtest? As in http://www.memtest.org/[^]
Your best bet to find the bad chip is to pull out a DIMM and see if the problem still occurs. If you only have one DIMM buy a new one. They are very cheap now as you should be able to find a 512 MB DIMM for less than $100US.
John
|
|
|
|