|
hi
I have an MFC MDI application, in which i carry out an process and at the end open an log file.
This process involves quite a lot of time. During this process, i want to implement a progress bar, showing the status of the process. How do i do tht.
Can someone, please help me on this. I thank in advance.
cheers
Mughi
|
|
|
|
|
You can have a simple dialog loaded from the MDI - It would be only displaying the progress bar. The value of the progress bar can be set from the parent MDI.
* Artificial intelligence is no match for natural stupidity! *
|
|
|
|
|
I tried that. But that doesn't happen in parallel. Only after the progress completes, my process of loading the file starts.
Mughi
|
|
|
|
|
Hi,
Can anyone let me know how to add a menu to dialog bar?
Thanka
|
|
|
|
|
hi,
Create Menu , Click resource tab,insert resource -> menu
give menu name as IDR_MENU1.
add the Menu Items.
right click the DialogBox -> properties -> Menu name -> specify IDR_MENU1
by
baijumax
|
|
|
|
|
Hi ,
I want to add a menu to dialog bar, not dialog box. For dialog bar, the menu property is disabled.Is there a way to to this?
My Main aim is to have a seperate menu for MDIChild window-form view. So I intend to attach a menu to dailobar and add this dialog bar to form view. I want to use a dialog bar instead of a dialog here.The problem with dialog box is when the focus is on the view, the dialog menu appears to be disabled i.e grayed and vice versa. Or cau you please suggest how to make the dailog appear to be eanbled irrespective of focus
Thanks
madhavi.
|
|
|
|
|
Does anyone have wmstub.lib? Could you send it to me? Thanks in advance.My email id is fuzezheng@126.com.
Fuze Zheng
|
|
|
|
|
Do you known the way to get the serial number of a USB Flash Disk (not a logical serial number which was created when we format the USB Flash Disk). Can you give me some informations: APIs, URLs...
Thanks you very much !
|
|
|
|
|
Hi!
Can somebody help me out?
I get a syntax error, when I try to compile this code.
The syntax error indicates,that I'm missing something before the else if(riid==IID_IX).
Can somebody help me out? Thanks!
if (riid == IID_IUnknown)
*ppvObject = static_cast<iunknown*>
else if(riid == IID_IX)
*ppvObject = static_cast<ix*>(this);
else if(riid == IID_IY)
*ppvObject = static_cast<iy*>(this);
else
{
ppvObject = NULL;
hr = E_NOINTERFACE;
|
|
|
|
|
You're missing the argument to static_cast . Btw, the code looks very suspect. Why do you have a nested if when all you really need to do (imho) is:
if ((riid == IID_IUnknown) ||
(riid == IID_IX) ||
(riid == IID_IY))
*ppvObject = static_cast(this);
else {
ppvObject = NULL;
hr = E_NOINTERFACE;
...
}
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I think you miss ";" at the end of the line " *ppvObject = static_cast ",do you?
free like a bird
|
|
|
|
|
hi every body!!
i have problem that default many child window size.
i want to get that when main window appear different size many child window are default.
i want to know where this sample code.
please give me.
thank all!!!!
phoophoo2004@indiatimes.com
|
|
|
|
|
From MSDN, it says
GetDefaultPrinter is included in Windows 2000 or later.
I am using WIndows XP, and look at the windows.h and winspool.h, I could find the declaration of this function.
In fact I try to run the following sample code provided by MSDN at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/UsingGDIPlus/Printing/SendingGDIPlusOutputtoaPrinter.asp
But it failed by saying the GetDefaultPrinter undefined.
Can anyone help me to fix this problem? Becasue I would like bypass the Printer Diolog using GetDefaultPrinter.
Thanks a lot
David
//-----------------------
#include <windows.h>
#include <gdiplus.h>
#include <stdio.h>
using namespace Gdiplus;
INT main()
{
// Initialize GDI+.
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
DWORD size;
HDC hdcPrint;
DOCINFO docInfo;
ZeroMemory(&docInfo, sizeof(docInfo));
docInfo.cbSize = sizeof(docInfo);
docInfo.lpszDocName = "GdiplusPrint";
// Get the size of the default printer name.
GetDefaultPrinter(NULL, &size);
// Allocate a buffer large enough to hold the printer name.
TCHAR* buffer = new TCHAR[size];
// Get the printer name.
if(!GetDefaultPrinter(buffer, &size))
{
printf("Failure");
}
else
{
// Get a device context for the printer.
hdcPrint = CreateDC(NULL, buffer, NULL, NULL);
StartDoc(hdcPrint, &docInfo);
Graphics* graphics;
Pen* pen = new Pen(Color(255, 0, 0, 0));
StartPage(hdcPrint);
graphics = new Graphics(hdcPrint);
graphics->DrawRectangle(pen, 50, 50, 200, 300);
delete graphics;
EndPage(hdcPrint);
StartPage(hdcPrint);
graphics = new Graphics(hdcPrint);
graphics->DrawEllipse(pen, 50, 50, 200, 300);
delete graphics;
EndPage(hdcPrint);
delete pen;
EndDoc(hdcPrint);
DeleteDC(hdcPrint);
}
delete buffer;
GdiplusShutdown(gdiplusToken);
return 0;
}
David
|
|
|
|
|
I would like to put some sort of tree structure in an internet explorer side bar but I haven't been able to merge my bar with any of the many types of trees I have learned about these past couple of weeks. Something like the view->explorer bar->folders would be optimal. I hope someone can at least point me in the right direction.
Thanks in advance,
Biggie.
|
|
|
|
|
I use the function
int ExtEscape(
HDC hdc,
int nEscape,
int cbInput,
LPCSTR lpszInData,
in cbOutput,
LPSTR lpszOutData
);
at my program.Because of my poor English,I couldn't understand the function's introduction at Microsoft Windows CE.NET Help.Could you give me a introduction about the function and the use of it in detail?
Thanks!
free like a bird
|
|
|
|
|
The documentation in the Platform SDK covers this in detail, but in brief this function allows you to access driver-specific functions that are not exposed by the Windows GDI. The specific device is passed to the function using its handle, hdc. The device driver function is specified by nEscape, while lpszInData is a pointer to whatever data is required as input for the function. The cbInput parameter specifies the size of the structure indicated by lpszInData in bytes. Similarly, the lpszOutData parameter is a pointer to the structure where you want the results to be stored, and cbOutput contains the size, in bytes, of this structure. ExtEscape returns a positive value if the call is successful, and 0 if the requested function doesn't exist. A negative return value indicates an error. Several predefined values exist for nEscape, primarily related to printers, but other than these you are free to specify any value supported by the target driver.
"My kid was Inmate of the Month at Adobe Mountain Juvenile Corrections Center" - Bumper Sticker in Bullhead City
|
|
|
|
|
Hi
I have just started learning C++ GUI programming using Visual C++ (I'm using VC++ 6), and I have two questions regarding it:
1. Let's say I create a dilog-based project, and I put some things (buttons, lists, etc.). The problem is, when the user maximizes the the dialog, the button placements are not automatically modified, leaving a large part of the maximized window blank. Is there a way to automatically reposition ALL the things inside the dialog when the user maximizes the window (or resizes the window, for that matter)? Or do I need to manually recalculate the correct positions and sizes for all the things and apply them one by one?
2.Is there a tutorial/website that explains how I can create other GUIs beside the document/view or dialog-based GUIs that Visual C++ provides (e.g. skin-based GUI, GUI's with shape other than simple rectangle, etc.)?
Thanks!
|
|
|
|
|
Indrawati wrote:
Is there a way to automatically reposition ALL the things inside the dialog when the user maximizes the window
No.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
MFC doesn't come with a layout manager like Java. However, see this[^] and this[^] CP section for answers.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I just want to know the initializtion of the parameter lpCmdLine. Could you tell me how and where to find it?
thanks!
free like a bird
|
|
|
|
|
lpCmdLine is passed into your program from CRT initialization. The CRT just calls GetCommandLine.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thank you very much,Tim!
free like a bird
|
|
|
|
|
Hello,
I'm just wondering why your message subject is: "To Michael Dunn"?
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
It may be more appropriate to be "Dear Mr. Dunn"!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Recently, I write a program.And I write a WinMain function for it. But I don't know where and how to initialize the parameters of the function. Should I to initialize them by myself? Or the system will intialize them?
Where can I find the initializtion of the parameters
hInstC,hInstP,lpCmdLine,nCmdShow?
the function is as follows:
int PASCAL WinMain(HINSTANCE hInstC, HINSTANCE hInstP, LPTSTR lpCmdLine, int nCmdShow)
{..................}
free like a Bird
|
|
|
|