Visual C++ :: Floating CDialogbar On Multiple Screen Environment
Jul 11, 2014
I have an problem with a CDialogbar if my app runs on a system with two screens (side by side). I can not resize it while the CDialogbar is in floating state on the second screen.
I figured out that the problem is the mfc-function CDockContext::Stretch().
It limits the CDialogbar to the primary screen (using ::GetDesktopWindow() to verify the position).
What can I do?
View 2 Replies
ADVERTISEMENT
Jul 28, 2013
I am writing a pure C based win32 applications. I have drawn line. Now i want to translate that line, move the line whereved user wants to move on screen. Then again I drawn another line, I am drawing multiple lines.
I have created rectangle region for each line and trying to move the line.
When I move the 2nd line over the 1st line on screen the 1st line is getting wiped out. Because I am InvalidateRect() of the rect for the line being moved, so when that rectangle is crossing the other line then the other line is getting removed from the screen.
How can I rectify it. How can I have all the lined being on the screen and moved according to the user's wish. The code should be pure C and win32 no MFC.
View 4 Replies
View Related
Feb 17, 2014
Special behaviour of a CEdit-control in a CDialogBar:
My CDialogBar is a member of my MDI-mainframe-class. The menu of the mainframe have an item with an accelerator "r".
Now, if I want to type the letter "r" in my CEdit-control, the menu-item (with the accelerator "r") will be called.
How can I type "r" into the CEdit-control? How can I handle it?
View 2 Replies
View Related
Feb 11, 2014
I have the following problem:
My mainframe-window in a MDI-app has a CDialogbar.
Every time the mouse moves over a control in this dialogbar the status bar is updated by a text.
The app craps the text from the resource strings that has the same ID than the dialogbar-control, randomly.
I do not want this. How can I avoid this?
View 14 Replies
View Related
Nov 22, 2013
My program (Test) is a basic MFC AppWizard (exe) created project. I have followed the steps in the link below to create a docked dialog box (myDialog) using VC++. [URL]...
The dialog box works, however, I have 2 issues that I am trying to resolve.
1) I have added a button to the Dialog box, however, when I run the application they start as disabled (note: the Disabled option on the Button Properties is unchecked). If I add function myDialog::OnButton to the myDialog class, the button remains disabled, however, if I add the function CTestView::OnButton to the View class, the button becomes active and works. How can I make the button work from the myDialog class?
2) I would like to be able to change an Edit box in the same dialog box when I click the button. How can I access the pointer to the myDialog from the View class?
View 2 Replies
View Related
Feb 19, 2013
I have a question concerning the CDialogBar (:CControlBar).
I have a MDI application with a dockable toolbox (CDialogBar).
The user is able/allowed to move the DialogBar and to dock it at the right or left side When I dock at the left side, the content of my mdi-application (so all other open windows) are moved right (so the dockable bar moves the windows).
If i dock at the right side, nothing changes.
How can I change the behaviour of the bar, that the windows inside the application keep the same position when I dock left ?
(Problem is, that my windows are aligned on the right side of the application). When I dock the bar on the left, the windows are getting moved in the not visible area.)
View 2 Replies
View Related
Feb 23, 2014
I can't seem to make this printf line work
printf("THE NUMBER PI
To six decimal places, pi is equal to \%f" ,3.141593 " which is roughly \%i", 3 "
");
I'm not sure what the correct syntax is to start and end a new write.
View 3 Replies
View Related
Jul 14, 2014
i have developed an application in which i have icons in left side pane of application which can be dragged and dropped in client screen. Application is working fine with all the resolution except 1920x1080.
when setting the resolution to 1920x1080 while dragging icons to client area, icon is not attach to mouse pointer. instead there is a gap between the mouse pointer and the icon. i wrote code to identify the screen resolution but it does not seem to recognize 1920x1080 resolution. below code is giving incorrect resolution for 1920x1080 setting.
RECT actualDesktop;
GetClientRect(GetDesktopWindow(),&actualDesktop);
value of 'actualDesktop' variable is {top=0 bottom=783 left=0 right=1536} which is incorrect. according to current resolution size value should be {top=0 bottom=1080 left=0 right=1920}. Due to this, all the icons while dragging are adjusting according to incorrect resolution setting.
how to identify the issue and if there is any limitation with respect to screen resolution in VC++ 6.0 with windows 8 environment.
I am getting same issue when compiling in VS2012 in windows 8. Code does not seem to recognize 1920x1080 resolution setting and downgrading my application look and feel by setting it to lower resolution.
View 1 Replies
View Related
Nov 21, 2014
I have a class having static member.I have get and set methods which will Get and Set Values to this variable. In a multithreaded application does it have any thread safety issues.
Class a {
static int b;
void Set (int c);
int Get();
};
View 10 Replies
View Related
Feb 19, 2013
In short I'm converting a floating point bilinear image resampling routine into one that only uses fixed point arithmetic. I've gotten rid of nearly all the floats now, in fact all but one and the results at the moment are in distinguishable from the floating point version. It's a maths issue really. Some pseudocode goes like this.
Code:
for( int xx=0; xx<ow; xx++ ) {
int_center = (ccx >> 16);
int temp = xx * 2;
for (j = int_center; j <= int_center + 1; j++)
[Code] ....
Where ccx is and integer error accumulator that gives me a scaled integer. Shifting down buy 16 gives me the relative pixel I need to be working on. The line just after where the inner loop begins is where I have the last remaining float. FILTER_FACTOR is essentially a percentage by which I scale the error accumulator to the correct amount.
For example.
ccx = 98303. Which is a value of 1.5 when shited down by 16 bits. Obviously I can shift it because it will round and I lose the precision. Lets say FILTER_FACTOR is 39321. Which is 60% of 1 (65535) So what I'd like to know is, is it possible to use the FILTER_FACTOR as an integer and do some fancy integer math to scale the result from (ccx - (j<<16)) by the representative amount that is FILTER_FACTOR. In this example 60%. Effectively getting 40% of (ccx - (j<<16)) At the moment FILTER_FACTOR is still a float and therefore 0.6, which of course works just fine.
View 4 Replies
View Related
Nov 28, 2013
I am working on a solution for the above problem. Without success by now. To draw it within OnMouseMove with XOR-operation in not a good solution.
One problem: OnMouseMove is not called if the mouse moves to outside the CView-window.
But in this case the crosshairs should be deleted.
Second: working with XOR will not be good because we need a defined state (visible/not visible).
View 11 Replies
View Related
Jan 11, 2013
I checked through the net and most of the solution like clrcr(); is not working for microsoft visual 2010. SO i was wondering for those who was using the same ver of c++ as me how do you clear the screen?
View 5 Replies
View Related
Nov 24, 2013
How do I print a mathematical series such as
1 + 2/2! - 3/3! + ...... n/n! //n is read from user
Not only we need to print the series on the screen but at the same time find the sum using simple loops.
View 1 Replies
View Related
Apr 22, 2014
I'm trying to determine (from my Win32 process) if a Metro (or a Modern UI) app is currently displayed on the screen. I found the IAppVisibility::GetAppVisibilityOnMonitor method that can do just that, and I even found a C++ sample, but my issue is that I'm compiling it with the Visual Studio 2008 that does not have the definitions for the IAppVisibility interface, so the following:
Code:
#include <Shobjidl.h> //Earlier version
IAppVisibility* pAppVis = NULL;
HRESULT hr = CoCreateInstance(CLSID_AppVisibility, NULL, CLSCTX_INPROC_SERVER,
IID_IAppVisibility, (void**) &pAppVis);
Results in a set of errors:
Code:
error C2065: 'IAppVisibility' : undeclared identifier
error C2065: 'IID_IAppVisibility' : undeclared identifier
how to define them?
View 4 Replies
View Related
Jan 15, 2014
I have a visual impairment that makes it very hard for me to use the standard dark text on white background themes. I use High Contrast but many apps don't query the system for colors (I.E. aren't theme-aware) and consequently display pale or dark text on a white background regarding of the theme selected.
There is a product called ZoomText that allows for inverting the brightness of everything being displayed. I just use a normal theme, let all apps display naturally, and then invert the entire screens brightness.
But ZoomText doesn't support multiple monitors. And it does a lot more than I need. And it hogs the CPU. And it costs a lot.
Looking for some of the APIs that I need to capture the bitmaps for all monitors, invert the brightness of all pixels, and refresh the display contexts. And make that happen so smoothly that it appears like there is nothing going on behind the scenes. (DirectX, OpenGL, ???)
View 4 Replies
View Related
Dec 6, 2013
By using visual studio 2010, I have problem calling up on screen keyboard using line below for Windows 7 64 bit.
WinExec("OSK.EXE", SW_SHOW);
However, it is working fine on windows XP 32 bit. How to call up on screen keyboard for 64 bit windows?
Code:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) {
int nRetCode = 0;
HMODULE hModule = ::GetModuleHandle(NULL);
if (hModule != NULL) {
// initialize MFC and print and error on failure
[Code] ...
View 2 Replies
View Related
Mar 3, 2013
How can we debug the multithreaded application in unix environment?
View 1 Replies
View Related
Oct 24, 2014
Here is the code,
Code:
void foo() {
Acquiring lock
do something...
Func();
Releasing Lock
}
If the function Func throws an exception, there is potential deadlock issue. Then I handle exception like this,
Code:
void foo() {
Acquiring lock
do something...
try{
Func();
[Code] ....
Is this a good practice? I wonder how I can apply RAII in handling exception here.
View 2 Replies
View Related
Feb 26, 2014
I need to edit ,update and display a group of 40 parameters on screen. (10 parameters per page and use of Arrow Key pad or touch screen clicks to modify value)....
For that I will need .. Parameter No . , String Name , Point Screen Cord , double value , next element no. etc I have my old code with structure and array of structure written in C. I have translated it on C++/MFC .
How can I implement Class property of c++ ?
View 8 Replies
View Related
Mar 6, 2015
I need to write a c program that can receive signals and recognize a certain pattern (SIGUSR1, SIGUSR2, SIGUSR1, SIGUSR2). once the pattern is caught the program terminates itself.
I am able to send the signals to the program from a different process, but I am unsure on how to get the signal handler to recognize the pattern. here is what i have so far:
Code:
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
sig_atomic_t sigusr1_count = 0;
sig_atomic_t sigusr2_count = 0;
[Code] .....
I just need getting the program to be able to catch that specific pattern.
View 4 Replies
View Related
Sep 25, 2013
TheC language program environment does nothing to prevent buffer overflows ..... is there any pros to the obvious cons of this?
View 3 Replies
View Related
Jan 21, 2013
How can I check if window media player is running in full screen mode & topmost in c++ MFC?
What I used is this logic:
I compared media player full screen coordinates to that of monitor coordinates.If they are same implies media player is in fullscreen.But it has one flaw.Whenever there are control(for play,pause) displayed in full screen in media player, coordinates are not coming same as that of monitor.
View 10 Replies
View Related
Apr 28, 2015
I'm making a small MFC module that should generate a report (formatted using HTML) and then display it for a user on schedule at 8:30 AM every day. Pretty straightforward stuff.
I compose my report and then save it as a local HTML file in the CSIDL_APPDATA folder. I then use the following calls to display it using the default web browser (Internet Explorer in this case):
Code:
//Error checks are omitted for brevity
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
ShellExecute(NULL, NULL, strSaveFileTo, NULL, NULL, SW_SHOWNORMAL);
This module is run on schedule from the Task Scheduler. (The task is set up to run when a user is logged on, which is all the time for that PC. It is never turned off, put to sleep, etc. That computer has only one user that is never logged off either.)
This works perfectly fine when I test it by setting the task a minute or so in the future. But when the actual task is supposed to run at 8:30 AM, when the user wakes the screen all they see is a blank Internet Explorer page. (Note that if someone refreshes that page by hitting F5, only then my report is shown on the screen.)
So I started looking into it:
1) I checked that the file is properly saved (before calling ShellExecute) by reading it back and by comparing it with the original HTML markup that I saved earlier. It's all correct there.
2) I then checked the power saving options. That computer is set up to show screensaver after 5 minutes and to turn off screen after 25 minutes.
3) The web browser that causes this issue is IE version 11, with the latest updates installed. The operating system is Windows 7 Professional.
And why is IE showing a blank page only when computer is running unattended?
View 14 Replies
View Related
Feb 1, 2013
I must take an old MFC project in VC++ 6.0 and make changes.
The problem is text size in screen is different from size in print preview.
for example with this font
Code:
CFont f50;
f50.CreateFont(100,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE,"Frutiger LT Std 45 Light");
And this text
Code:
s=_T("Let's try to calculate the size of this text");
and with MM_LOMETRIC map mode
GetTextExtent() returns me:
On screen: (1595,99)
Ink printer + print preview: (1589,100)
PDFCreator + print preview: (1580,100)
comparing with screen size the height is bigger but lenght is smaller. I don't understand.
I can understand that different printers process the fonts in different way and then to have different lenghts. That's not the problem. The problem is I need to simulate in screen the same behaviour i will have on printer because these texts are being aligned in the document, and I don't want to see that the text si aligned different in text than in paper.
What can I do to render the text on screen with the same size I will have on the printer? Print preview is doing it. Should I change the font parameters? is something related with pixels per inch?
View 4 Replies
View Related
Jul 13, 2013
How do you select multiple folders and upload them. Search recursively? I cant find any code or examples.
View 2 Replies
View Related
Jul 23, 2013
How would I be able to round a number in multiples of another...
Let's say width is 150
And multiple to be 64...
I want 150 to become 128...
if it was 160 to become 192...
The width number will change and I want to covert it in multiples of the other number example 64... The minimum value will always be the multiple number used...
View 7 Replies
View Related