|
I think that I am doing this all correctly. I am setting timeout to 15000 which should be 15 seconds. Also here is how I am setting the size parameter.
m_TrayIcon.cbSize = sizeof(NOTIFYICONDATA);
m_TrayIcon.hWnd = this->m_hWnd;
m_TrayIcon.uID = 1;
m_TrayIcon.hIcon = this->m_hIcon;
m_TrayIcon.uCallbackMessage = WM_TRAY_MESSAGE;
m_TrayIcon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
strcpy(m_TrayIcon.szTip, "Update Client");
Thanks,
Matt.
|
|
|
|
|
From MSDN docs for NOTIFYICONDATA.uFlags
NIF_INFO Use a balloon ToolTip instead of a standard ToolTip. The szInfo, uTimeout, szInfoTitle, and dwInfoFlags members are valid.
Don't worry about it. I make daft mistakes all the time. I nearly broke a monitor when I thought my computer was playing tricks on me. I'd define nLoop, and used mLoop. I now use a clearer font...
Iain.
|
|
|
|
|
Hi!
I am starting from ground up. I am with simple Win32 Application and I want add ATL functionality in it by fooling wizard. I planned:
1)a cpp file that has the same name as the project .
2)an ATL object map (the map can be empty, but it must be present).
3)an IDL file with the same name as the project and this file must have a Library block.
Need feedback on 2 and 3.
|
|
|
|
|
Is there any way to extract dialog from .rc and paste in doc by program? I am trying to make user interface spec generator.
Shin
|
|
|
|
|
Your program could open the .rc file, load it's dialog resource, then implement a CDialog based on this resource. After the dialog is drawn, display it, get it's handle and through the handle, it's device context. Then copy this device context into a new bitmap, and display the bitmap inside the document.
The easier way is just create a blank space in the spec generator with a comment "Add captured image here"
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Can someone tell me how I can use an array to display this grid in my program.
9 - - - - - - - - -
8 - - - - - - - - -
7 - - - - - - - - -
6 - - - - - - - - -
5 - - - - - - - - -
4 - - - - - - - - -
3 - - - - - - - - -
2 - - - - - - - - -
1 - - - - - - - - -
1 2 3 4 5 6 7 8 9
|
|
|
|
|
Depending on the grid cell types, the array declaration would be
type-id declarator[10][10];
This code fragment creates a 10x10 matrix, in which each cell is of type type-id.
If you are wondering on drawing the actual grid, I suggest you go see some of the examples here in CodeProject. There are a set of grid controls available. The solution I presented here is relevant only to the actual data types concerned, that is, the contents of the cells.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
<code>
char grid[8][8] = {0};
int i, h = 0;
for (i = 0; i < 9; i++)
{
for (h = 0; h < 9; h++)
{
grid[i][h] = '-';
}
}
</code>
|
|
|
|
|
That script keeps comming up with an error saying
array.exe has encountered a problem and needs to close.
|
|
|
|
|
Has anyone experienced a MFC Dialog application hanging and become non responsive when using GetSaveFileName? You can get the same problem when using CFileDialog since it calls GetSaveFileName. If you had this problem how did you correct it?
|
|
|
|
|
Do you have a code snippet that exhibits the problem?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hey all.
I'm wondering what the best way is to just completely end your program. I am building an auto-update-from-the-internet feature in one of my test programs (it's a school project).
What I want to do, is download the file, execute the file, and exit the program as soon as I execute the file.
Currently, I have this working fine. The way that I am "quickly ending" my main program, is right after I do the shell execute functions to call the setup.exe program, I am doing "OnOK();". That kills my program immediately ... which is perfect because just as the program ends the setup program is beginning to run.
I'm just wanting to make SURE that this is the right way to do it. I don't have any "cleanup" to do (ie, write contents to disk ,etc...) just exit out of the program.
BTW: I have tried using "DestroyWindow();" as well, and that seems to work just fine too. Just want to do it the right way.
Thanks
|
|
|
|
|
There are multiple ways to end a program.
-If you are using a dialog-based solution, calling 'EndDialog' of the dialog class will do.
-If you have an SDI/MDI application, using 'PostQuitMessage' on the main window class will do.
-If you have a standard Win32 application, just make it's WinMain function to return some value.
Basically, after you've done any clean-up such as resource-freeing or reserved memory freeing, any method to end your application is just as fine.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I am using Win32SDK.
What I want to do is to pass a BSTR from a ATL DLL to a Client? Now since Interface method can return only HRESULT. I will store the values in a Global Variable and use it in the client. Is there in Flaw on Design? I need feedback.
|
|
|
|
|
you can use
yourMethod([out,retval]BSTR **str);
in VB u can use like this
string str = yourMethod()
Abhishek Srivastava
Software Engineer (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
The physical return value from an interface method is an HRESULT; however, you can also return a logical value if need be. For example in your coclass:
<code>
STDMETHODIMP InterfaceMethod1([out, retval]BSTR* pBSTR);
STDMETHODIMP YourCoClass::InterfaceMethod1(BSTR* pBSTR)
{
*pBSTR = SysAllocString(OLESTR("Hello World!!"));
return S_OK;
}
</code>
Your client will need to call SysFreeString(BSTR bstr) when finished with the BSTR.
JS
|
|
|
|
|
Could anyone pls tell me how to programmatically (VC++/VB6) get the CPU time & mem usage of a process, given the process name(or PID), under WIN2K?
Th...x
|
|
|
|
|
for mem usage,refer to GetProcessMemoryInfo
for cpu time, refer to GetProcessTimes
and you can also get all information of processes by using Performance Montoring Functions: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/performance_data.asp
but i don't like to use them,because this library uses much system resources, even a simplest program using this library will have at least 7 threads and 5K memory usage.
|
|
|
|
|
This article might be of some help. The Heap32First() /Heap32Next() functions can be used to walk the heap of a process, examining each of the blocks and summing their size if necessary. I've not actually tried this, however. See GetProcessMemoryInfo() .
Also look at this article. It does not report numbers like Task Manager does, however.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I created an SDI MFC app, and print preview shows the correct range of pages, but when actually printing (on any printer) it will print a trailing blank page. I have overloaded the functions OnPrint, OnBeginPrinting, OnPreparePrinting (for a CRichEditView derived class). Ive tried calculating the value for SetMaxPage() using char heights and lines per document, etc. but it never comes out right. Any suggestions as to how to get the framework to stop printing the extra blank page every time?
nak
|
|
|
|
|
Have you tried different printers?
|
|
|
|
|
Are your calculations based on the display DC or the printer DC? There is a slight difference. Mainly in that the actual paper size is not the "printable area". Printers have a non-printable margin area (on laserjets, usually 1/4 inch) that is not addressable. So, your 8 1/2 x 11 paper is really 8 x 10 1/2 printer addressable. See GetDeviceCaps with the opcodes of PHYSICALWIDTH, PHYSICALHEIGHT, PHYSICALOFFSETX, PHYSICALOFFSETY, etc.
onwards and upwards...
|
|
|
|
|
Yes, Im using DEVICECAPS and other methods to calc the drawable area. The extra page does not print my headers and footers on it, so it must not be calling OnPrint for the last blank page. As per the other response I have tried it on different printers and different documents and it always prints the extra page. I was wondering if theres any way to override OnEndPrint or some "cheap" way to just stop it from spitting out that extra page. (Could the printer be receiving some line feed or something after the actual document that makes it print a blank page?)
|
|
|
|
|
Yes it seems that the printer gets some extra line feed or something like that. If the print preview is ok, it seems to be a hardware problem. Did you try your program on an other PC?
You may also check how often your OnPrint method is called during printing.
|
|
|
|
|
Actually its nothing like that. If you research the MFC underlying infrastructure, the CPrintInfo object has default min, max page values of 1 & 0xFFFF respectively. Thus when printing it will print to those pages, until it encounters a page with no data. As far as Ive found the only way to get rid of this is to SetMaxPage to the correct number of pages. But the textmetrics & sizes that some Printer DeviceContexts return to you arent correct, so Im still having problems determining exactly how to calculate this. Also strangely, in my font, the boldface char's seem to take up barely more space than the regular ones. Im still working on this problem, so Im not sure what the solution is yet
|
|
|
|