|
Maybe I'm coming down a bit hard here, but this is my opinion.
Some think there are legitimate resons to disable ALT-TAB, I'm not one of them.
Perhaps the first priority would be to handle the DX "surface lost" stuff. There's not much that is more annoying than a game that crashes because I had to ALT-TAB out of it (to do something else), and then when trying to get back it crashes. If it was, it would be the neverending story of kernel-memory we can do nothing about, forcing reboots every now and then...
I am the one owning my machine, and as such I should be the one making decisions of when and how I'm allowed to do what with my machine.
|
|
|
|
|
That is where you are wrong, there are reasons to disable the computers ALT-TAB and other keys, the application that I am developing at the moment is for a network cafe. He doesn't want the people to be able to use the computer until he enables it. Being able to ALT-TAB out of the dialog makes that a pretty pointless exercise doesn't it.
|
|
|
|
|
Prompt as in the program to learn(find out) how many pages it is transmitted on the printer from other program
|
|
|
|
|
Hi, I´ve made a meteo program that draws 4 graphs, I´ve included a function detecting screen resolution, and it changes lines coordinates to fit them into the window, but when you change Windows screen configuration to 'big fonts' the draw exceed the window. Any solution to this problem? or, Is there any MFC function detecting if Windows has big or small fonts selected?
Thank you.
|
|
|
|
|
there is reg-key changing with font size change but it is not directly font size
see http://www.codeproject.com/dialog/cresizeablefiledialog.asp bottom
t!
|
|
|
|
|
You can use CDC::GetDeviceCaps(LOGPIXELSX). If it returns 96, system is using normal, 'small' fonts. Note that there are not only 'large' and 'small' settings - users can select any scaling. Your drawing routines should use GetDeviceCaps(LOGPIXELSX) and GetDeviceCaps(LOGPIXELSY) to scale the output.
KB article Q177795 has other related info.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi guyes,
Small problem of heap corruption (What can i do ?). Am getting this friendly error when i run through the debugger (VC++ 6.
0) in my program:
HEAP[Seq.exe]: Heap block at 13d290 modified at 13d29c past requested size of 4
With a dialog window that says "User breakpoint called from code at 0x..."
This occurs when i go through a new .. but at different places every time i debug. I mean it could happened one time with the new of the line 10 and with another session with the new at line 15.
Any suggestion to find out this error.
Thanks.
Dirar
|
|
|
|
|
The easiest way to solve the problem would be using diagnostic tool, like BoundsChecker or Purify. There should be an eval versions at www.numega.com or www.rational.com.
The message you're getting from heap manager is pretty self-explaining. You're allocating block for n objects, and writing more than n.
void foo(int n)
{
int *x = new int[n];
for (int i = 0; i <= n; i ++) x[i] = i;
delete []x;
}
Note that this can happen even if you're using std::vector from STL that ships with VC++ - there's no index checking (except from vector::at), even in Debug build.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi.
How can I Extract .EXE(or DLL) file's Icons & other Resources.in Runtime and without other applications
Iman Ghasr-e-fakhri
|
|
|
|
|
With the samples that come with VC6.0 there is a sample application called IconPro which shows how to extract icons from exe and dll files. To use this to get other resources requires searching for example RT_BITMAP (for bitmaps) instead of RT_ICON.
The main functions to extract the resources are
FindResource
LoadResource
LockResource
FreeResource
Hope this helps
|
|
|
|
|
Hi.
How can I Find System's Drives And Drives Type with Windows API(s)
Iman Ghasr-e-fakhri
|
|
|
|
|
Hi,
Use GetDriveType(). Don't know how to enumerate, though.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
To find system's drives try GetLogicalDrives, it returns a bitmask with all the drives available.
Use GetDriveType or GetVolumeInformation for extended information about the selected drive
Hope it helps!
ORi
|
|
|
|
|
> To find system's drives try GetLogicalDrives,
> it returns a bitmask with all the drives available.
For Windows < NT5 (aka W2k) it was true. Not so anymore I'm afraid.
For >= W2k you'll have to iterate volumes by using FindFirstVolume/FindNextVolume.
If you however are only interested in the drive-letter assigned volumes, this solution works.
|
|
|
|
|
Can anyone help me in my school project?I'm a beginner at microsoft visual c++ any need help in doing a program.I would appreciate it if anyone is willing to help me doing it.Thanks alot!
|
|
|
|
|
Oh, a homework assignment!
You should know we don't answer questions like this one usually.
But you can post some piece of code where you get stuck, then we can help you
regards
|
|
|
|
|
1. open dll proj with classWizardMFC(dll) - type MFCExtension DLL.
2. add to resources Dialog
3. add new class for this dialog
4. write function with DoModal for the dialog , so:
--------------------------------------------------
extern "C" __declspec(dllexport) long CallDlg()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CDlg1 dlg;
dlg.DoModal();
return 0;
}
-------------------------------------------------
5. It is not works ! Why ??????
below is the errors that I gets:
--------------------Configuration: dll1 - Win32 Debug--------------------
Compiling...
dll1.cpp
Linking...
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in dll1.obj
mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in dll1.obj
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in dll1.obj; second definition ignored
mfcs42d.lib(dllmodul.obj) : warning LNK4006: __pRawDllMain already defined in dll1.obj; second definition ignored
Creating library Debug/dll1.lib and object Debug/dll1.exp
Debug/dll1.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
dll1.dll - 3 error(s), 2 warning(s)
|
|
|
|
|
remove the AFX_MANAGE_STATE(AfxGetStaticModuleState()); line, you don't need it in an extension dll. It's only needed in regular mfc dlls
|
|
|
|
|
hi
i have class derived from CHeaderCtrl with own virtual DrawItem but it is never called
it is another class member and is created by .Create() call
(no problem with WM_ handlers)
what can be wrong?
t!
|
|
|
|
|
Are you sure you're using HDF_OWNERDRAW flag in HDITEM passed to CHeaderCtrl::InsertItem?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
i afraid i'm using
HDITEM hdi;
hdi.mask = HDI_TEXT | HDI_WIDTH | HDI_FORMAT;
hdi.fmt = HDF_STRING | HDF_LEFT | HDF_OWNERDRAW;
t!
|
|
|
|
|
You've mentioned in the first post that there's 'no problem with WM_ handlers'.
Does this mean that parent window gets WM_DRAWITEM as expected and the only problem is with forwarding to virtual DrawItem method in header?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
parent has to deal something with?
i thought it goes to myhdrctrl::onpaint or onsize and similars
t!
|
|
|
|
|
parent has to deal something with?
Yes, but MFC does this for you automatically. Can you use Spy++ and check if parent gets WM_DRAWITEM?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
yes parent gets wm_drawitem with header ctrl id (fprocessed: false)
t!
|
|
|
|