|
Oh, I must have overread it, thanks for the info. Maybe I should redesign my code
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Ok... so HOW then do I create and call a dialog/window in a dll as soon as possible...?
Actually, what I want is a splash screen that kicks in when somebody calls LoadLibrary(mydll).
/Tommy
|
|
|
|
|
Inside PROCESS_ATTACH, is this a bad thing to do you mean:
----
hSplash = CreateWindow(
"BUTTON",
"Tommy testing Splash Screen...",
WS_POPUP | BS_FLAT,
(sx-W)/2, (sy-H)/2,
W, H,
NULL,
NULL,
hdll,
NULL);
ShowWindow(hSplash, SW_SHOW);
UpdateWindow( hSplash);
}
// ... processing ...
if ( hSplash)
DestroyWindow( hSplash);
----
|
|
|
|
|
I have not yet resolved my problem ... can anyone help me ?
read this
read this topic
|
|
|
|
|
from :|http://www.codeproject.com/listctrl/changerowheight.asp
Problem:
I don't receive a WM_SETFONT or WM_MEASUREITEM message.
(Damian Williams, 1999-10-18)
Solution:
Modify the style of the list control to "owner draw fixed" (LVS_OWNERDRAWFIXED).
Overload CListCtrlEx::DrawItem().
A WM_MEASUREITEM message will be sent to a parent window of list control.
(Chung Hyun, Lee, 2000-05-25)
Solution 2:
Class Wizard does not show you the =WM_MEASUREITEM reflected message. If you use Class Wizard to get WM_MEASUREITEMS, it can only be handled by a class other than the list view control, i.e. a parent window. This is not satisfactory. To get a reflected message you must add the following in the message map in your .CPP file:
ON_WM_MEASUREITEM_REFLECT()
|
|
|
|
|
Hi,
I need a help once again. What are the proper Window API to check how much of memory space you have allocated and how much virtual memory space you have left ?
|
|
|
|
|
Try
VOID GlobalMemoryStatus(
LPMEMORYSTATUS lpBuffer
);
hth
-ar
|
|
|
|
|
Thanks, does this check for Virtual Memory used by per apps? Or as a system?
|
|
|
|
|
Take a look at GetProcessWorkingSetSize () and see if that's what you need. There's a whole slough of memory management functions in the API, just check out the documentation in MSDN!
-ar
|
|
|
|
|
Hello all,
First post here. I have been reading the site for about one and a half months, great place to be, thanks to all.
Here is my deal: I am programming an MFC App to demo what my company can do. We design avionics software for aircraft simulators, so I am pretty familiar with GDI+ (that is mainly what we use for a couple of reasons, instead of DirectX or OpenGL. You'd be surprised how many real instruments on real planes run on GDI or GDI+).
My idea for the demo is a dialogue that starts off black, our name fades in, then the user is taken to a menu page, where he will have three or four options to click on to see different avionics working. Except I don't want the Windows look at all. The click areas, for example, I want to be designed with GDI+, so that they don't look like buttons, but like the real avionics screens.
Then once he chooses an option by clicking it, the entire dialogue window will become that avionics screen, and it will run through a short loop, basically using my already existing GDI+ code for that instrument, and just using timers to change the variables every 10 ms or so to change things smoothly, like the airspeed bar increasing, the horizon tilting, etc.
I would also like the user to be able to quit the application whenever. I have the intro running right now, being drawn on the OnPaint, but I have to wait for it to finish drawing before I can quit the app.
I am willing to post the fundamental structure (can't post our proprietary code for the instruments, of course) here after this is done to serve as another example of how not to stick to Windows-looking apps.
Any help with any area would be appreciated. Thanks in advance.
Best Regards
Fabio Miguez
|
|
|
|
|
Well, I'm not sure how advanced your demo app is but here's a good way to start. You need to create WM_POPUP window, and so I believe in MFC you have to override the Create() function and specify the flag in the .style property of the CREATESTRUCT variable. This will get rid of the "Windows Look". Then you can draw your own window frame with GDI+ and define its behaviour. Also, you could use MFC buttons and just override the WM_DRAWITEM message (I think, its the Owner drawn stuff anyway) after flagging the button as owner draw in the resource editor. You can assign it as a new class in the wizard that derives of CButton so you can use your customised draw routines for the button. Can't really help you any further til I know I'm on the right lines or not.
Hope this helps,
Alan.
P.S. Why do aircraft instruments use GDI/GDI+ and not DirectX or OpenGL, surely it can't be a reliability issue? Or is it just cos render speed doesn't have to be optimised? I always thought they'd use a monster API to do it, especially since they use CATIA to design the aircraft.
|
|
|
|
|
Hey Alan,
Thanks for the response. You are on the right track. When checking my code, I do not have a Create() function. By pressing Ctrl+W I can check in the MFC Wizard that I can add that function to the code, but I am not sure what to do with it.
I had thought about the owner drawn for the buttons, although I have not experimented with it. But as far as I understand, by doing that, I will be able to assign a region for the button, and later assign a function to that hit, all I have to do is make sure I draw my button exactly where that area is defined, right?
I am not sure why GDI/GDI+ is used. But that is a generalization. Some avionics use OpenGL, and some use proprietary APIs, since they are not even running Windows. But I believe the advantage of GDI/GDI+ is the ready-to-use drawing functions. And the refresh rate on some avionics, like moving maps, is very small, like 1 frame per second. As I understand, DirectX does not come ready with drawing functions, but I could be wrong.
Thank you for the help so far. Let me try and play with owner drawn buttons to see what happens.
Best Regards
Fabio Miguez
|
|
|
|
|
There is a bug in Visual Studio 2003 which prevents you adding ATL OLEDB consumers to MFC projects. This previously worked in Visual Studio 2002.
The work around is to fool the ATL wizard into thinking it's not an MFC project
Change your CWinApp inherited class as follows
#ifdef _FAKED
class CG1App : public CObject
#else
class CG1App : public CWinApp
#endif
The wizard now works and the project compiles correctly.
NB. you will still need to add the required header
atldbcli.h
|
|
|
|
|
Hi
does ne1 know how to convert a CString to an int
eg CString = "5";
thanks
si
|
|
|
|
|
|
hi..
you can do it,like this;
CSting str;
str="5132";
int i=atoi(str); Good Work...
|
|
|
|
|
|
i created a treelist of items but wish to display the names of the items selected (on single click) in another list box one by one. How to create such a function?
|
|
|
|
|
Please map the TVN_SELCHANGED function then Get the Current selected item by calling the
HTREEITEM hTreeItem ;
CString StrSelectedText ;
hTreeItem = TreeCtrl.GetCurrentSelectedItem ();
StrSelectedText = TreeCtrl.GetItemText(hTreeItem);
Now Set this text in the Edit Ctrl by calling the
Edt_Ctrl.SetWindowText();
Please set the appropriate parameter.
Thanx
TAKE CARE
|
|
|
|
|
I am wondering if i add a button in an SDI, then can i create another view window when button is pressed?
|
|
|
|
|
I need to launch another console program in my application. But I don't want that the console programs shows the console window.
Any way?
Thanks
|
|
|
|
|
Have you looked at CreateProcess() ?
|
|
|
|
|
You can use ShellExecute or ShellExecuteEx and set the nShowCmd parameter to SW_HIDE or look at the CreateProcess function.
Lan
|
|
|
|
|
Check out the STARTUPINFO structure that is passed to CreateProcess(). The STARTF_USESHOWWINDOW bit in the dwFlags element may do the trick.
Brad
|
|
|
|