Hi, I am using .NET 4 and I have some troubles with application settings. Using simple value types (int, string, Point, Size etc.) and their default values is OK, but when I add a reference type to...
in my VS 2010/.NET 4.0 application I am drawing a sort of focus rectangle using ControlPaint.DrawBorder with the ButtonBorderStyle.Dotted flag. However, I noticed that when only part of the...
Another update: when I try using a DIB instead of a DDB (by calling CreateDIBSection instead of CreateCompatibleBitmap), CopyImage always passes but GetLastError after it returns always 8.
I tried setting the flags to zero, with no effect. And now I'm even more confused - the program created and successfully copied 95 bitmaps. Then it created two more, the CopyImage method returned a...
I don't want to put the bitmap to a DC (to display it somewhere). I need to copy the bitmap data in the memory, so that I have two independent copies of it.
According to Microsoft KB article 193103, the answer is yes, the stored DEVMODE handle has to be updated each time you call
CPrintDialog::DoModal because it discards the handle we passed into it...
I am trying to do exactly the same thing but it doesn't work so far. MSDN says that ...the values of hDevMode and hDevNames in PRINTDLG may change when they are passed into PrintDlg. This is because...
Hi, I have a menu command to which an accelerator is hooked. Whenever the command is disabled (using the ON_UPDATE_COMMAND_UI message) and I press the accelerator key, I get a trace message saying:...
I have an ActiveX control embedded in a view. I would like to know if there is a way to get a pointer to the main application window from within the control. Of course, I could get the pointer when...
The trick is to manually provide information about the event methods. So first in the header file for the ActiveX control declare one _ATL_FUNC_INFO object for each event in the...
I have a MFC ActiveX control which displays data from a COM object (which is in a separate DLL). I want to be able to catch events fired from this object. I tried to derive the ActiveX implementation...
I have a problem getting the resolution of a printer set in the CPrintDialog. I've tried numerous mechanisms but none of them seems to work. I am able to detect the resolution only if the user...
Hi, I would like to create a screen device context with a specific resolution, say 300 dpi (I don't know if I am using the correct words, I just want the GetDeviceCaps( hDC, LOGPIXELSX ) method to...
Is it possible to get the filename of the DLL the current code is in? Of course I could hardcode it but somebody could later change the output filename from "a.dll" to "b.dll" - is it possible to...
Hey, I'm afraid you're a little off-topic. I don't want to record a macro. I have created some macros in the VBA and stored them in a module of the specific workbook. Now what I want is to call the...
Thanks for your reply. My macro is stored in a module inside the workbook (as a "sub") and it is called when:
1) the workbook is being opened
2) the custom menu item is not yet created
Got a problem... is it possible to run a macro in some workbook from another workbook (both of them are open)? I have created a custom menu item, but it applies only to the workbook by which it was...
I have created an ActiveX project and I want to insert it into a MFC application. I tried to do this using the standard Add Class -> From an ActiveX Control (I am using VS.NET). A wrapper...