|
|
Is there any way to use icons in a CImageList instead of bitmaps?
[insert witty comment here]
bdiamond
|
|
|
|
|
Yes. You create an image list that can expand and use
imgList.Add(HICON)
If you vote me down, my score will only get lower
|
|
|
|
|
What Roger said. You can also use the macro ImageList_AddIcon() .
FWIW, I've found icons to be more pleasant to work with than bitmaps. You don't have to deal with separate masks or transparent colors.
Another nice benefit with icons is that when you load icons from the resources, the icon loader pays respect to the current bit depth of the screen. This means that Windows will pick out the icon which best matches the current screen bit depth.
--
Arigato gozaimashita!
|
|
|
|
|
Shorah All
I new to everything I just got MS Visual C++ .net and when I compiler my first Program.
I got syntax errors like iosteam.h is not declare. used Visual c++ ver 6.0
and there is a way to link other files and lib to the program.
I look for the same thing in the menus but cant find them.
come some one please tell is there a book for the comlier I can read or web site I can goto.
Please dont tell me goto MicroSoft Cor.
It one big frustration and I get lost and side tract.
|
|
|
|
|
Hey guys...How would I go about writing this method in the .cpp file?
METHOD
playTurn gives a player the opportunity to place a chip into the board. This should be a Boolean function to return true if this turn produces a winner (otherwise false should be the return value).
This is what I have for the .h file ...is it right?
bool playTurn();
I'm Not very good with bool.
|
|
|
|
|
That looks fine to me. You can treat a bool as you would nay other type. Its just limited in values, false or true
If you vote me down, my score will only get lower
|
|
|
|
|
Hi,Dears
How can i use Edit Control in View of SDI application?
Or How can i use View of SDI application such as Edit Control?
Best Regards.
MJM.
|
|
|
|
|
mostafa_pasha wrote:
How can i use Edit Control in View of SDI application?
Use a CFormView -based view.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks For your attention.
But when i use CFormView class , alerted me
CFormView does not support Printing service !
this means i write routin to support Printing ?
Best Regards.
MJM.
|
|
|
|
|
It helps to keep threads short by mentioning all of your requirements up front, rather than one at a time.
mostafa_pasha wrote:
CFormView does not support Printing service !
By default, printing and print preview are not supported by the CFormView class. To add printing support, override the OnPrint() method in your derived class.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks a lot.
But u say Threads!
i am writing application that use serial port to communicate
with PC.
I use two threads for Write and Read but i do not know how can i
Synchronize between these threads !
I wanna use Critical section But i do not have any expirement can u
know refrence or example about these?
Best Regards. ;)
MJM.
|
|
|
|
|
mostafa_pasha wrote:
But u say Threads!
Not that kind of thread. A thread is a set of posts on a newsgroup, composed of an initial post about a topic and all responses to it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Oh, sorry to barge in on this thread. But this is something that is coming up that I'll eventually have to do also. I thought I remember being able to add printing support for a CFormView-based app in VC6, but now in VC7, I'm told the support won't be available. I haven't done anything with built-in print and print preview in a while, but in my OnPrint() how would I be able to use MFC's print preview? instead of the regular printer? Before it was pretty much taken care of for you.
BTW, there was also a feature in VC6 where you could make a custom appwizard and select "base on existing project" so that once I had the barebones code for a certain type of app, I could more or less make a template for that app a lot easier. I don't see this anymore either, and it makes me
[insert witty comment here]
bdiamond
|
|
|
|
|
Background.
I have an App. written by me, that is a win32 console App.
It does some processing and produces some console output, as they usually do.
Now, I am quite happy with the output, as its simply a dump of some data. But, I have developed a GUI which ShellExeceuteEx's the console App as the user requires. So, I can have many instances of the console App running at the same time.
I would like to know if it is possible, that when the user presses the keyboard pause key, only the console window with the focus is paused. At the moment thay all get paused, which of course is expected.
I have looked around and I can not find any general solution. My only idea is to create a keyboard hook DLL, test if the main window focus is on one of the spawned console Apps and to issue a pause/suspend against that thread.
If anyone knows of a better or any other elegant solution I would be interested to know.
Oh, and one more question. Does anyone know how to specify which font is used for Stdout for a console application.
Thanks.
James.
|
|
|
|
|
Hi,
The CHINESE CHARACTERS that I entered for the COMBOBOX control by its property tab(DATA) under chinese OS could not be displayed correctly under English OS. Even though I compile the source code with UNICODE. Does anyone know?
Robert
|
|
|
|
|
Does the PC with the English OS have any Chinese fonts installed?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yes. The Chinese fonts have been installed. Because I can input the chinese characrer under English OS. Especially, the other controls such as static and button with chinese characters can be displayed properly under English OS.
Futhermore, If I inser or add items using the source code instead of using combobox property TAB(DATA), they can be well displayed.
I don't know why it does not work with the property TAB(DATA.
Robert
|
|
|
|
|
Hi.
I got one dimensional array with integer numbers in it. I want to reverse the numbers. The fisrt number should be last and last should be first e.g. [1,2,3,4,5,6,7,8,9] reverse to [9,8,7,6,5,4,3,2,1]. How can I do it fast?
Regards.
|
|
|
|
|
With STL it's simple:
#include <algorithm>
...
int array[]={1,2,3,4,5,6,7,8,9};
...
std::reverse(array,array+9);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi.
The fastest way to 'reverse' the array, would be to traverse it backwards. This requires no copying.
James.
|
|
|
|
|
|
Hello I was wondering if there was a simple way of getting the difference between two times for example
using Ctime, get the current time and 5 hours later get the current time and see what the difference in hours and minutes is, for example
Tuesday September 12 2004 10:42 AM
Tuesday September 12 2004 2:21 PM
One more question is there a way of displayhing text on a dialog box, i have a login box, and i would like to display a greeting message to the employee, right now i display a message box with an ok button, but i was wondering if i could skip the message box and just add text.
|
|
|
|
|
Take a look at CTimespan - it should do what you need.
Adding text to a dialog is very easy. What version of VC are you using? In VC6, (and probably most earlier versions) you just place a static control on the dialog template and change it's text. If you need to do it from within the program, you can use SetDlgItemText(...) or use a member variable.
|
|
|
|
|
I have a couple of CControlBar derived classes floating control bars.
when the application starts, I create them , and load their state, either visible or docked, or floating; but when I try setting the text on the floating frame ( CMiniDockFrameWnd ) but it does not really work well.
I had a peek at Cristi Posea's CSizingControlBar , and in one method, there's :
if (IsFloating() && GetParentFrame()->IsKindOf(RUNTIME_CLASS(CMiniDockFrameWnd)))
{
m_pDockBar->SetWindowText((LPCTSTR) lParam);
GetParentFrame()->DelayRecalcLayout();
}
but if I call a method with this in the OnCreate of my MainFrame ( where the CControlBar are created ), they are not yet floating; but they actually are floating.
if I call the same code from an test menu command, it works like it should and change the caption of the floating frames.
Is there a "Post Create" handler that I can use when creating the mainframe ?
Thanks.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|