|
Or the non-MFC solution is FindFirstFile, followed by FindNextFile for each fiel after the first.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt wrote:
Or the non-MFC solution is FindFirstFile, followed by FindNextFile for each fiel after the first.
Yes.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Thanks
-Raffi
Why do today what can be put of until tommorrow?
|
|
|
|
|
Any ideas how to prevent a modeless dialog from staying on top of my app?
I create a modeless dialog as a child of the app and set the extended style of the dialog to include WS_EX_APPWINDOW so that it has it's own icon on the task bar. However, if I switch focus back to the main app the dialog remains on top (though it does have an inactive title bar, etc).
I've tried handling WM_SETFOCUS, WM_KILLFOCUS, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED and WM_ACTIVATE in either the app the dialog or both, but to no avail. Any ideas?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Don't make your dialog a child of any one window.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I've tried calling Create(IDD_MY_DIALOG, NULL) , but this still gives the same result
Any more ideas (or have I gone about it the wrong way)?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
How about Create(IDD_MY_DIALOG, GetDesktopWindow()); ?
--------
A common man's understanding of science. Not a normal common man's of course. A very smart common man's. -- Nish, on Science Writing
|
|
|
|
|
Thanks very much. Problem solved
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I have the compilation-size problem when I compile some sample codes. As an example I get a 40K Exe file for “VS6\Samples\MSDN\TechArt\168” since the original available Exe file is just 7.5KB! (Aligned.exe). I have NOT changed any of the DEFAULT SETTINGS.
also I can’t build a Dll less than 24KB, Win32 App less than 20KB and so on.
I expect to get the same results as other have. I use VC6.0 Enterprise edition with ServicePack5.0, Feb2001 SDK and My OS is Win98.
So, What’s wrong?
Amir.
|
|
|
|
|
I think this CP article will answer your question: http://www.codeproject.com/system/howbig.asp
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
PinkPanter wrote:
So, What’s wrong?
A number of things could be wrong. Compare your average "Hello World" to the following piece for example (compiles to 640 bytes exe).
/*
VC6: cl c.c
*/
/*
NOTE: The "/filealign" is TOTALLY undocumented!!!
*/
#pragma optimize("gsa-y", on)
#pragma comment(lib, "kernel32")
// I split up all these linker optinons on separate
// lines for display purposes. 16 byte alignment
// might fail on Win9x.
#pragma comment(linker, "/merge:.rdata=.text")
#pragma comment(linker, "/entry:mymain")
#pragma comment(linker, "/subsystem:console")
#pragma comment(linker, "/align:16")
#pragma comment(linker, "/filealign:16")
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma data_seg(".text")
void mymain()
{
DWORD foo;
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), "Hello world!\n", 13, &foo, 0);
}
|
|
|
|
|
I'm having trouble connecting a menu item to a function in one of my classes. I can use classwizard to select the menut item's ID and have it create the ON_COMMAND message map entry and the On... function, but when I run the app, the menu item is greyed out and is not selectable. The only time I can get it hooked to a class is if I hook it up to the CMainFrame class. Any thoughts?
|
|
|
|
|
A menu item will be grayed out if the currently active view/frame does not have a handler for it. So if you have multiple view classes, better add the handler to the main frame class because when you have a view active that does not handle this menu item, the menu item will be grayed out!
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
As part of an application I want to display a map (physical map, like a map of France or a building). What I need:
- Easy update - the original is probably a papercopy.
- Normal operations like zooming, panning, color adjustments.
- "Hot regions" - clicking on a area will highlight it and provide additional data.
- Portable to WinCE/Pocket PC
The ideas I have gone through:
- Two bitmaps, one for the map and one for the regions.
- Bitmap for the map, regions stored as some kind of polygons.
- Metafiles. Don't know much about them, especially not how they are handled by WinCE GDI.
- Using the WebBrowser control: map as jpeg of gif and regions using <MAP> or ISMAP. Hard to control, I think.
- Other format for map and regions.
Any suggestions here would be greatly appreciated. At the moment I think I will go with option 2. - unless someone points out a serious flaw or suggests a better solution.
Thanks in advance
/moliate
Two o'clock and walking through familiar London - Or what was familiar London before the cursor deleted certain certainties -
I watch a suit and tie man giving suck to the Psion Organizer lodged in his breast pocket
its serial interface like a cool mouth hunting his chest for sustenance, familiar feeling, and I'm watching my breath steam in the air.
Neil Gaiman - Cold Colours
|
|
|
|
|
I'd use one full sized image that is blown up to the desired detail you need. Scale it down to the size you need retaining the detail. Then use regions to define your hotspots, so as the user clicks or hovers over these regions scale up the part of the image the region contains. Display it to the user and show the information you want.
I know with GDI+ this is a breeze to do, I use it all the time but I'm not positive of the top of my head that GDI+ is even part of the WinCE api. If not, then it should be fairly easly done without it still using the method I mentioned above which I think is the better way to do. Hopefully I 'v helped you or given you another approach that helps you or I thoroughly confused you - I havn't had my morning coffee yet and my daughter dragged to her swim competition early in the morning.
|
|
|
|
|
Yeah, that was basically my idea too (except that CE does only seem to be able to create rectangular regions). Shows that I'm on the right track..
Thanks for the reply - and good luck to your daughter!
/moliate
|
|
|
|
|
It may be a little bit of work to get a map in vector format, but unless you have a very large amount of disk space to work with I would steer away from Bitmaps.
Depending on how big the bitmap that you are using needs to be when you are zoomed in all of the way, I would look more to meta files. Meta files are vector based so it does not matter how far you zoom in, the size of the file will not increase significantly.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hello sisters and brothers.
Can anyone tell me what message to handle when the main window needs resizing/replacement? (For instance if the windows task bar is replaced/resized)
|
|
|
|
|
I am not quite sure what you mean by "needs resizing/replacement", however you may want to look at these messages and see if they do what you want:
WM_GETMINMAXINFO
WM_WINDOWPOSCHANGING
WM_WINDOWPOSCHANGED
If these do not help you please elaborate and I will try to help you.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In addition to what kilo said: WM_SIZE
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
thx for for your kind supplies, you helped me find the spot.
WM_ONSETTINGCHANGE is the message i needed
this simple code did the job:
void CMainFrame::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{
CFrameWnd::OnSettingChange(uFlags, lpszSection);
// TODO: Add your message handler code here
RECT rect;
SystemParametersInfo(SPI_GETWORKAREA,0,&rect,SPIF_SENDCHANGE);
MoveWindow(rect.left, rect.top, rect.right, rect.bottom)
}
|
|
|
|
|
If I recieve the ID of the folder with SHBrowseForFolder, use BindToObject, EnumObjects etc. and set up the
while (pFolder->Next(1, &pNewId, &pActual) != S_FALSE) loop. then how do i add the files from the folder if it's a folder in the loop? cause it's only a single-level pidl, so i can't use it in BindToObject for example. can i make a single level pidl to a fully qualified pidl? is there a way to make a fully qualified pidl if you have the single-level pidl, or if you have the complete folder path? or how do i do it`?
Thanks
|
|
|
|
|
You must have had the pidl to the folder which you bind to, so just
append the simple pidl to that pidl.
But you should be able to use BindToObject() for a subfolder with just a simple pidl.
|
|
|
|
|
How do you append two pidls?
|
|
|
|
|
A pidl is a list of SHITEMID's you have to alloc a new block that is the size of the old + the size of the new and then copy the pidls into the new ITEMIDLIST.
The memory should be allocated by the shells allocator. SHGetMalloc(),
or use CoTaskMemAlloc().
(really shouldn't, but they do the same thing currently)
An other way is passing the complete path to ParseDisplayName() of the
desktop folder, then you get the full pidl back.
But as i said i dont think you need to bother with this, the simple
pidl should be all you need.
|
|
|
|