|
Hi All
Iv'e tried adding an icon for my app to the system tray using
the usual Shell_NotiyfyIcon() call, but everytime the mouse moves over it
It dissapears.
Any ideas on this behaviour
thanks
|
|
|
|
|
|
Does anybody know where i can find a description of the file format for color palettes (like used in Paint Shop Pro) ?
Thanks in advance
Michael
|
|
|
|
|
I do not know anything about this but I found on WEB
The Dr. Halo Palette (PAL) file header has the following content (40 bytes):
struct Hpal
{ BYTE ID[2]; Should be AH
int version, size;
char filetype, subtype;
WORD brdid, grmode;
int maxindex, maxred, maxgreen, maxblue; Colors = maxindex + 1
char signature[8], filler[12]; "Dr. Halo", 12 0's
} ;
The palette data is integer triples (R, G, B) for each color in the palette.
The palette file data (including the header) is in 512 byte blocks. If there
is not a full integer triple at the end of a block, the data should be
ignored and the next block started.
|
|
|
|
|
I have a MFC AppWiz generated explorer style application that requires the user to be presented with a dialog box when the file open command is selected. Unfortunatly, I cannot seem to find a way to use the OnFileNew() method and call a method in both the TreeView and ListView update their data, as well as allow the framework to properly deal with the document object. I'm also not sure which class I should be placing the OnFileNew() override into. Can anyone offer some assistance?
Thank you,
Ritch
|
|
|
|
|
Hello Ritch,
If I do understand your problem well, then provided you are using doc/view arch in your application then use the ClassWizard to override the OnFileNew in your document class, ie the id ID_FILE_NEW.
Let me know, if this does not solve the problem.
Regards,
Paul.
|
|
|
|
|
Paul,
Thanks for your response. However, I had initially tried that approach and the problem is that the OnFileNew method gets called when the application is initially created. I only want the dialog to appear when the user selects the File New item from the app's Menu. My theory (I've set this issue aside temporarily) is that I need to change the ID for the menu item. Then when the user selects the menu item, I call the base class FileNew member to allow the MFC architecture to create the document, aftewords I present the user with some dialogs that intialize the newly created document.
|
|
|
|
|
how do you play a WAV audio file as a resource.
I have tried to use the sndPlaySound function, but when I compile it says it is undeclared.
I think I need to include some library... which one do I need??
|
|
|
|
|
how do you find the name/path of the file/files being dropped on a control on a dialog.
|
|
|
|
|
Did you notice "Search" on the home page?
You need to subclass the control and handle WM_DROPFILES.
See http://www.codeproject.com/listctrl/filedroplistctrl.asp for how...
|
|
|
|
|
how do you make the selected item highlight the full, entire length of all the columns
in a CListCtrl. this is hard to explain... please look at the attached picture to see what I
am talking about.
|
|
|
|
|
Either
ListView_SetExtendedListViewStyle(m_hWndYourListViewHwnd,LVS_EX_FULLROWSELECT);
or
SendMessage( m_hWndListviewhwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)LVS_EX_FULLROWSELECT );
==================
The original message was:
how do you make the selected item highlight the full, entire length of all the columns in a CListCtrl. this is hard to explain... please look at the attached picture to see what I am talking about.
|
|
|
|
|
...
or
CListCtrl& ctlList = GetListCtrl();
ctlList.SetExtendedStyle( LVS_EX_FULLROWSELECT );
|
|
|
|
|
You need to call SetExtendedStyle with the LVS_EX_FULLROWSELECT after the window has been created. A good place to do this may be when you add the columns to the list control object. It requires Version 4.70 of common controls dll which is available with IE3+.
Hope it helps.
|
|
|
|
|
Hi there,
i have a really annoying problem with exceptions. On my system (Windows 2000, VS 6, SP3) the following code produces an unhandeld C++ exception:
class TEST {
public:
TEST() {};
};
try {
TRACE("before throw TEST\n");
throw TEST();
} catch (TEST x) {
TRACE ("test catched\n");
} catch (...) {
TRACE ("unkown catched\n");
}
TRACE("after throw TEST\n");
The debug window shows the following:
>before throw TEST
>test catched
>after throw TEST
>Nicht abgefangene Ausnahme in TESTEXCEP.exe (KERNEL32.DLL): 0xE06D7363: >Microsoft C++ Exception.
What's going wrong?
Any help is welcome.
Thanx
Klaus
|
|
|
|
|
Hello Klaus,
What do you really expect of the program? To me, not an expert in exceptions anyway, it is the normal flow.
Probably you may gain some confidence from the ff. MS own codes under the topic "C++ Exception Examples"... Check the MSDN for the expected results and see how this is different or similar to yours. Again, I am not an expert, so take this as my humble piece!!!
#include <iostream.h>
void MyFunc( void );
class CTest
{
public:
CTest(){};
~CTest(){};
const char *ShowReason() const { return "Exception in CTest class."; }
};
class CDtorDemo
{
public:
CDtorDemo();
~CDtorDemo();
};
CDtorDemo::CDtorDemo()
{
cout << "Constructing CDtorDemo." << endl;
}
CDtorDemo::~CDtorDemo()
{
cout << "Destructing CDtorDemo." << endl;
}
void MyFunc()
{
CDtorDemo D;
cout<< "In MyFunc(). Throwing CTest exception." << endl;
throw CTest();
}
int main()
{
cout << "In main." << endl;
try
{
cout << "In try block, calling MyFunc()." << endl;
MyFunc();
}
catch( CTest E )
{
cout << "In catch handler." << endl;
cout << "Caught CTest exception type: ";
cout << E.ShowReason() << endl;
}
catch( char *str )
{
cout << "Caught some other exception: " << str << endl;
}
cout << "Back in main. Execution resumes here." << endl;
return 0;
}
|
|
|
|
|
Hi,
I'm writing a MDI application and I want to put each pair of Doc-View rinning in a separate thread.
Does anyone know how to do this?
Thanks in advance!
|
|
|
|
|
AFAIK, it's not safe or desirable to put user interface elements in separate threads with MFC. Use threading to do the jobs that will take a long time to do in the user interface (and which usually lock it up), for example: Loading a large file, or performing a calculation on a large set of data can be usefully done in a separate thread.
==================
The original message was:
Hi, I'm writing a MDI application and I want to put each pair of Doc-View rinning in a separate thread. Does anyone know how to do this? Thanks in advance!
|
|
|
|
|
Hello,
Check the MS Advanced MFC sample -- MTMDI. It does exactly
what you want. When I studied this the first reaction was why will someone do anything like this, since the sample will still run correctly without the threaded support. Now, I realize such a need do exist!!!
Regards,
Paul.
|
|
|
|
|
Hi,
i am looking for an example which use
a TRANSPARENT(both button and window) toolbar
not in a rebar control
i am trying to host the tool bar in a CWindow(ATL)
derived,and i always get a white background
although the CWindow OnPaint draw a red background
thanks
tomer
|
|
|
|
|
How to load a bitmap from the disk (NOT as a resource) to a CBitmap or some other ... to be able to display it or put it in an image control ?
|
|
|
|
|
use this code...
CString fileName = "c:\\pics\\picture.bmp"; // this should be a path to the file to load, can also use CFileDialog to get path
// this wil load the image from disk into an HBITMAP
HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), fileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
CBitmap cBmp; // create a CBitmap to hold the image
cBmp.Attach(hBmp); // here is the CBItmap that contains the image
==================
The original message was:
How to load a bitmap from the disk (NOT as a resource) to a CBitmap or some other ... to be able to display it or put it in an image control ?
|
|
|
|
|
I have a view based SDI application. It monitors other process.
If no problems are detected I would like it to be invisible to the user. I do not want it to show on the task bar, nor should someone be able to Alt-Tab to it.
How do I hide the frame and the view?
|
|
|
|
|
Towards the end of your application InitInstance method,
the following lines exit
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
Changing the show (SW_SHOW) to hide (SW_HIDE) or something similar will prevent the window from showing. It will actually initial show and then hide. If you wish to prevent this too, you may have to take care of the actual creation functions in the mainframe class.
|
|
|
|
|
This may have been covered in a previous post, but I don't know because there are just too many previous posts to wade through.
I am trying to print a bitmap graphic that is generated from data. It is in a view, so currently I am just printing the view using the whole doc/view printing made easy functions. Actually, I didn't even have to do any programming at all because somehow it was all set up pretty well already just by the MFC standards. Only I have two imposing problems:
1) My bitmap's y axis is reversed or something, because it isn't just printed upside-down, it is printed with the entire y-axis completely reversed, but the x-axis normal. So my graphic is innacurate.
2) My bitmap is being printed really tiny, which makes it hard to see. Because it is generated from data, it needs to be able to be seen clearly.
So can anyone help me flip the y-axis and enlarge it when it gets printed but leave my view as it currently is (unflipped and not enlarged)? I can't seem to find any useful information on how to do either, because I'm not working with text. Any help would be appreciated.
If you would like to email me, you can do so at: ALeonard@bruker-axs.com
|
|
|
|