|
Hey all,
I've got a dialog program with a menu. I want to add a bitmap on the actual menu bar, not in a drop down. I want it next to the items... Example:
(BITMAP) File Edit View Help
Is there anyway to do this, and if so, how? I've tried everything, but nothing is working. Thanks a lot.
Dave
|
|
|
|
|
|
Mickael Dunn'advice is good.but I think there must be a method to do it by using member's function of menu class in MFC.you can refer to Microsoft Internet Explorer, bitmap lies of left of the items in "favourite"
your friend:bobi
|
|
|
|
|
Hey. After posting this, I found modified the 'Real' bitmap on menu and capion bar in the articles section. Thanks tho
Dave
|
|
|
|
|
I need to present the user with a disclaimer . The text is long and i want it to be hardcoded .
char *disclaimer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa......" ;
Is there a limitation on the size of this string ?
for ease of reading I need to be assigning this as
char *disclaimer = "aaaaaaaaaaaaaaaaaaaaaaaa // line 1 (what delimiter to use ? )
aaaaaaaaaaaaaaaaaaaaaaaa // line 2
aaaaaaaaaaaaaaaaaaaaaaaa" ; // last linem
How can i achieve the above . in other words what is the delimiter to use ? is it \\
|
|
|
|
|
Use CString.format.
example
CString myText;
myText.Format("This is line one \n This is line two \n This is the last line.");
AfxMessageBox(myText);
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
act_x wrote:
I need to present the user with a disclaimer . The text is long and i want it to be hardcoded .
char *disclaimer = "aaaaaaaaaaaaaaaaaaaaaaaa // line 1 (what delimiter to use ? )
aaaaaaaaaaaaaaaaaaaaaaaa // line 2
aaaaaaaaaaaaaaaaaaaaaaaa" ; // last linem
How can i achieve the above . in other words what is the delimiter to use ? is it \\
Here is another way to do it (ANSI C):
char *disclaimer = "aaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaa"
"aaaaaaaaaaaaaaaaaaaaaaaa" ;
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
act_x wrote:
Is there a limitation on the size of this string ?
No. I've seen message boxes that consumed my entire 1024/768 screen.
act_x wrote:
what delimiter to use?
The delimeter for the text in the messagebox is \n .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for ur help , but i guess i didnt phrase my question properly
For the string to be displayed in seperate line I know that I have to use \n . but my question is
My IDE is complaining of the new line when i do this
char *disclaimer = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n <what needs="" to="" be="" put="" here="" ?="">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n";
|
|
|
|
|
act_x wrote:
My IDE is complaining of the new line when i do this
The code snippet provided by rbid is what you are after.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I'm wanting to add a OnTimer event to me UI thread class, but cannot seem to get it to work. I assume that the time only works with some kinda dialog, but my thread does not have that, only my main app does. Is there a way to add this event to my thread with out adding a dialog?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
So what does not work? When you create a timer via SetTimer() , it communicates back to the application in one of two ways: the function pointer that was provided, or by posting a WM_TIMER message.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It's never getting to my OnTimer function.
When you say function pointer ...what do you mean?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
When you say function pointer ...what do you mean?
A callback function.
void CALLBACK TimerProc(...)
{
}
SetTimer(..., TimerProc);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Never worked with callbacks....guess it's time to learn.
Thank again David
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Let me ask you this. According to the MSDN is says that the hWnd is
Handle to the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored.
My thread does not have a window associates to it. And I need for SetTimer to look at the nIDEvent parameter because I have three timers doing three different things.
Can I just pass the handle from my main app and still have the timer work in my UI thread?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I havent done DX programming before but I found out that you can enter fullscreen mode by SetCooperativeLevel and pass DDSCL_FULLSCREEN as one of the params.
For OpenGL I ran accorss the following line of code: ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);
How do I determine if an app is running in the fullscreen mode?
|
|
|
|
|
Hey all.
I've searched for a few days and the best class that I've found where I can easily read data from a spreadsheet was one that is posted on this site named CSpreadsheet. It works great, with one exception, I cannot get it to read check boxes (and to see whether or not they are checked). In the sheet in Excel, I can see the name of the checkbox is Check Box 1 ... but I can not find any class(es) or code samples that shows me how to read them. Can anyone point me in the right direction? I would really appreciate it
TIA
|
|
|
|
|
huh? Why would you have to write a function for each edit box. Just read in the float and dow what you want to do to it. Else you can to what David Crow suggests which seems the easiest way.
Maybe you could give more detail in what you are doing and trying to accomplish
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I'm trying to find the number of directories (subfolders) in a certain user-defined folder.
I'm having to retrieve files from these subdirectories according to extension, and recursive algorithms traverse ALL subfolders, making my application very slow.
What I am planning on doing is retrieving the number of folders, partitioning them, and creating three or four threads to traverse each partition. This should enhance my execution time considerably.
Please help! Is there a function that will retrieve the number of directories in a folder?
Thanks
When the going gets tough... write a computer program to do it for you
|
|
|
|
|
FayezElFar wrote:
What I am planning on doing is retrieving the number of folders, partitioning them, and creating three or four threads to traverse each partition. This should enhance my execution time considerably.
Doubtful, since the extra time that is involved in context switching would add to the overall time. If you had a true multiprocessor machine, then the threads would truly operate independently of each other.
I tried something very similar to this a few years ago for finding files. For each file pattern that was sought, I created a thread. As each thread worked, the results were added to a listbox of some sort. While it was neat to watch, it was definitely slower than had I processed each file pattern separately.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks for the warning. Is there anything else you would suggest? Below you will find the heirarchy of the folders (and files) I'm trying to access. My goal is to retrieve all files of a certain extension.
USER DEFINED DIRECTORY LEVEL 1
|
------------------------------------------
| | | .................. . . . |
Dir1 Dir2 Dirx LEVEL 2
|
---------------------
| | | | | |
SD1 SD2 SD3 SD4 SD5 FILE! Level 3
SD: Subdirectory
I need the file in the third level. However, the class I'm using right now will go through all the SDs in search for it.. I cannot specify how deep the recursion goes. Plus I don't have much time to create my own class. Deadlines deadlines deadlines.
When the going gets tough... write a computer program to do the thing for you
|
|
|
|
|
What does the "search" method of the class look like? Perhaps it can be tweaked just a bit in hopes of shaving off a second here and there.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I'm using a class I got off of codeproject, calles CSADirRead. It's an amazing class, written by a guy at Smaller Animals Inc. (props).
Please let me know of anything you can find.
When the going gets tough... write a computer program to do the thing for you
|
|
|
|
|
You might ask Chris Losinger if he has any performance suggestions.
In the interim, see if you can build upon this:
int FindFiles( LPCSTR lpszFolder )
{
CString strFolder(lpszFolder);
CFileFind find;
BOOL bFound;
int nCount = 0;
bFound = find.FindFile(strFolder + "\\*.*");
while (TRUE == bFound)
{
bFound = find.FindNextFile();
if (find.IsDirectory() == TRUE)
{
if (! find.IsDots())
nCount += FindFiles(find.GetFilePath());
}
else
{
if (find.GetFileName().Right(4) == ".txt")
nCount++;
}
}
return nCount;
}
...
int x = FindFiles("c:\\winnt");
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|