|
Abris wrote: Hmmm, seems like threads is the solution then?
Correct.
Abris wrote: Threads I have so far never tried, seems like a complicated
solution? I'll take a look, but I would have guessed there was
some simpler way to do it....
See http://flounder.com/workerthreads.htm for more.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi all,
I'd like to add a "print in progress dialog" in my applicaiton when some printing is going on. How can I do this?
Thanks in advance,
Sarvan AL
|
|
|
|
|
There is no direct way to determin if something is in the process of printing or if it has finished. Once you have created your document and passed it on to the print spooler your app has finished with it.
One thing you could do is hook the spooler window, and display your messages that way.
|
|
|
|
|
Hi all,
In my MDI application, I've used ResizeParentToFit() function for all of my formview children. If the MDI parent window is maximized, everything works fine. If it is in default size, the child windows are getting the scrollbars. I'd like to have the child windows without scrollbars.
If anybody could show me some path, I'd be very thankful.
Thanks in advance,
Sarvan AL
-- modified at 2:16 Monday 3rd April, 2006
|
|
|
|
|
Hi all,
I've fixed this problem by setting some fixed size to ChildWnd in its PreCreateWindow(..).
Sarvan AL
|
|
|
|
|
Hi,
I place some line , rectangle, ellipse graphic elements in the view.
As the application goes background and them come in the front..
all those things are lost. So how to bring those back when the view
gets painted in this case.
Do I have to use CMetaFileDC and play the meta file back in paint.
But in this case the file gets created in the current directory. I dont
want this.
Thanks
Lee
|
|
|
|
|
Use a memory DC.
Nibu thomas
Software Developer
|
|
|
|
|
Hello,All!
I've two problem want to question :
The First,I am using Win32,I've a button(label"Browse")
I want that when i press this button ,will display
"Browse" Dialog (like Start\Run\Browse).
The Second,I've a "Help.chm" module,I want to call this
module in win32 (like Help in software of microsoft).
if who know about one of them(or all),please help me.
Thanks !
|
|
|
|
|
Hi Tran Ngoc Minh
you can use GetOpenFileName
|
|
|
|
|
::OPENFILENAME ofn;
char *szFileName=new char[1024];
ZeroMemory(szFileName, sizeof(szFileName));
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW
ofn.lpstrFilter = "*.bmp;*.*";
ofn.lpstrFile =szFileName;
ofn.nMaxFile = 1024;
ofn.Flags = OFN_EXPLORER | FN_FILEMUSTEXIST|OFN_ALLOWMULTISELECT|OFN_READONLY;
ofn.lpstrDefExt = "bmp";
CString str;
if(GetOpenFileName(&ofn))
{
CString str=ofn.lpstrFileTitle ;//szFileName ;
CString temp;
str.TrimLeft();
int index;
while(str.GetLength()>0)
{
index=str.Find('\0') ;
temp=str.Left(index);
str=str.Mid(index+1,str.GetLength()-1);
}
}
From the above you can get the name of the selected file
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
To show the Browse dialog use CFileDialog class.
nave
|
|
|
|
|
Tran Ngoc Minh wrote: I've a "Help.chm" module,I want to call this
module in win32
You need to include htmlhelp.h and html.lib, then from your code call the HtmlHelp() function.
A point to note, the .lib file will add extra size to your exe, I little too much in my opinion. But the function gives you the ability to do more than simply open the file. If you want to leave this out call either the ShellExecute() or WinExec() function. This will open the help file, though your program will have no control over it.
|
|
|
|
|
Hi.
a menu:
menu1
...Item1
...Item2
...Item3
If TrackPopupMenu() this menu, How can get it string (menu1) and item ID or string(item1,item2...) form WM_INITMENU or WM_INITMENUPOPUP message
Thanks.
|
|
|
|
|
Well your description doesnot explains your question.
Anyway if you need the ID of your menu Items you can get it in WM_COMMAND
you see it under wParam. and check your ID's. Which menu Item is selected.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
Hello
How about GetMenuItemID, GetMenuString methods of CMenu.
|
|
|
|
|
menu1
...
...
umm, if get menu1, GetMenuString can get? it id is?
|
|
|
|
|
If u want to find id of menu item then try using GetMenuItemID method.
int nPos = FindMenuItem(pMyMenu, _T("MyMenuItem"));
UINT menuItemID = pMyMenu->GetMenuItemID(nPos);
|
|
|
|
|
how can we dump every char in an multiline edit box???
HelpMe
|
|
|
|
|
What does 'dump' mean. Do you want to clear the text box ? Do you want to grab all the text to a string ? What ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Maybe he wants to display one of every character in the full character set in his text box?
Maybe he solved it himself already.
Doesn't look like he's going to tell you, though.
|
|
|
|
|
How do i write text on a bitmap file where only the path of the bitmap file is given?
|
|
|
|
|
If it's a bmp, LoadImage will load it. Otherwise, GDI+ will probably load it. Then you need to select it into a DC, draw text on it and save it again ( which probably means you need GDI+ and will load it into a Graphics object ). I have several articles on gDI+ here, one of them is called 'doodle' - it will show you how to load and save an image, and draw on it. Just change the code to draw text instead.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I cant find the the article... would u mind giving me the link?
Its a bmp but not not necessarily in the resource folder...
|
|
|
|
|
I don't see how you could miss it. I typed 'doodle' in to the search and it was the first hit. You could also click on my name and 'view articles'.
http://www.codeproject.com/vcpp/gdiplus/doodle.asp[^]
The bmp would have to be on disc, not a resource.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
CImage m_Image;
m_Image.Load("d:\\picture.bmp");
in the function OnPaint(event WM_PAINT)
CPaintDC dc(this); // device context for painting
BitBlt(dc.m_hDC,0,0,800,600,hdc,0,0,SRCCOPY);
dc.TextOut(40,40,"test",5);
|
|
|
|