Visual C++ :: Dragging And Dropping Functionality In Windows 8 Environment

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


ADVERTISEMENT

C# :: Graphic User Interface - Dragging And Dropping Controls In Form

Mar 5, 2014

is there a difference when creating a graphic user interface dragging and dropping controls in the form and coding on source code, difference in a sense that the code will appear differently if the control is dragged then the code appears automatically on the source code as compared to typing it on source code?

View 2 Replies View Related

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 View Related

Visual C++ :: Static Class Member In Multithreaded Environment

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

C :: Calculator Using Mouse With A Bug While Dragging

Mar 6, 2015

I have an assignment to do a calculator in C, wich will work by clicking the numbers with the mouse, however i have a bug that when i hold the mouse and dragg it, it assumes that I'm clicking multiple times, also, when I click in an empty space the program creates a blank space on the calculator screen.

Code:

#include <stdio.h>
#include <conio.h>
#include <math.h>
#include "..MouseHandler.h" // ajustar o caminho ao seu projecto
#include "..calcSkinLib.h" // ajustar o caminho ao seu projecto
#define PI = 3.1415;

[code]....

View 2 Replies View Related

C++ :: Shared Pointer Dropping?

Sep 19, 2014

Is their a way to completely drop a shared_ptr. Then it will delete the memory and NULL all pointers linking to it?

View 4 Replies View Related

C++ :: Functionality Of A Function?

Mar 7, 2015

I have been working with this code sometime, and i have somewhat lost the 'focus'. The problem is, i really can't seem to figure out what the function InsertAsFirstElement does, because there is no point in the code, something will be input "as first element"?

Code:
#include <iostream>
#include <cmath>
using namespace std;
struct node {
string nameOfFood;
int eatCalories;

[code]....

View 14 Replies View Related

C++ :: Optimizing Timing Functionality?

Jan 18, 2013

I've written a timer function in c/c++, but it still has performance problems. how to optimize this further (atm works with delay to perform timing):

#include "headers/types.h" //Basic types!
#include "headers/timers.h" //Timer support function data!
#include "headers/emu/threads.h" //Thread for timer item!
//Timer step in ms! Originally 100ms
#define TIMER_STEP 10000

[code]....

View 3 Replies View Related

C++ :: Derive A Class From Xml Node To Add More Functionality

Dec 10, 2012

I would like to derive a class from pugi::xml_node to add more functionality to the class. I get stuck when I try to append a child because pug::xml_node append_child return pugi::xml_node (not a pointer).

This is what I've tried, but it fails to compile.

Code:
PugiXmlNode PugiXmlNode::appendChild(std::string name)
{
return (PugiXmlNode) (append_child(name.c_str()));
}

Is there any way to do this?

View 2 Replies View Related

C++ :: Imebra Functionality QT Project Gives Malloc - Error For Object

Nov 2, 2012

I'm trying to convert dicom .dcm file to .jpeg using Imebra in C++ app using QT Creator as dev environment.

I've downloaded Imebra and was able to run QT project example for Dicom2Jpeg conversion successfully. But when I tried to copy same code to my C++ app it failed to run with following error msg:

malloc: * error for object xxxxxx: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug

I have followed steps on adding Imebra files to my project as it was shown on Imebra site. Also used their qt project as example. My main.cpp open dicom file, then loads it to dataset, then calls my dialog window. It crashes on loading dataset.

#include "QApplication.h"
#include "QHBoxLayout.h"
#include "mydialog.h"
#include "iostream.h"
include "library/imebra/include/imebra.h"
int main( int argc, char ** argv ){

[Code] ....

Deeper debugging showed that source of error is in JpegCodec.cpp file readStream() function when checking JpegSignature to see if it's in wrong format with resulting internal PUNTOEXE error "detected a wrong format".

Interesting thing is that while running same test dcm file using given dicom2jpeg example (which has exact same code of opening file and loading it) gives no errors and converts to jpeg successfully. So I know it's not the file issue, but the way imebra code is integrated into my C++ app.

My dev environment: macbook pro with Lion OS, QT Creator, QT project, C++ code, ITK library added, Imebra files are completely integrated as part of the Qt project.

So, my question is how do I work/link/reference/call Imebra functionality in QT project? Am I forgetting to link something, or some object is not instantiated/deleted on time?

View 2 Replies View Related

C++ :: Debug Multithreaded Application In Unix Environment?

Mar 3, 2013

How can we debug the multithreaded application in unix environment?

View 1 Replies View Related

C++ :: Handle Exception In Multi-threaded Environment

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

C# :: Abstract Class Provide Functionality Without Affecting Child Classes?

Mar 6, 2014

The abstract class can provide more functionality without affecting child classes.If we add any method to the interface ,then will it affect all the child classes ?

View 2 Replies View Related

C :: Program To Recognize Pattern Of Signals (linux Environment)

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

C :: Language Program Environment Does Nothing To Prevent Buffer Overflows

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

C++ :: Integration With Word - Highlight Text And Offer Find / Replace Functionality

Sep 10, 2013

I'm undertaking a project at the moment which requires me to hook into a custom c++ application from a Java applet via JNI. The c++ application needs to communicate with MS Word and potentially other office programmes in order to highlight text and offer find/replace functionality programatically. The idea is that when the applet is launched, it will communicate with the C++ methods to hook into an open MS Word document and highlight all words that start with the letter 't' for example.

I'm concentrating on the C++ side of things first . Even some basic access to an open word document would give me a great start!

View 3 Replies View Related

Visual C++ :: Updating To New Windows SDK?

Apr 27, 2013

I've just integrated the Windows SDK V7.0A into my VS2005 application, and I'm getting the dreaded "Application configuration error" when I try to run it on an XP machine.

It runs fine on the development machine, and some customer machines (Win7 and Win8), but will not run on XP due to missing/incorrect version dlls.

I've rebuilt all my libraries, but still no joy.

So, my first question is - If I upgrade the Windows SDK to V7.0A, do I also need to use MFC 10 and msvcrt10, or can I stick with MFC 8?

The next question is, how do I find out which dlls are missing, and which libraries or other dlls are requesting the missing versions?

View 11 Replies View Related

Visual C++ :: Deactivated All Windows Unless ONE

Apr 17, 2013

In my application I have some type of windows showed in an instance of time, and an action shows a new one that i want have the focus all the time , in the way that i can't works with no one of the others. They all are windows, child windows an modeless dialogs, but i don't know how to do. I try use EnableWindow(FALSE) that all the others windows and dialogs, but not works.

View 2 Replies View Related

Visual C++ :: Retrieve IP Information On Any Windows

Sep 23, 2012

I used to retrieve IP and NIC information by querying windows registry. Now I'm trying to use GetAdapterAddresses() API. Using GetAdapterAddresses() to get IP is not that easy, I need to dig a long deep as I check some examples so far, anyways my question is: Calling this API will return success on all versions of Windows ie: 32bits & 64bits ?

Though Microsoft has not opened any source, where this API is actually retrieving Windows IP information.?. Is it reading Registry or some windows file.

View 6 Replies View Related

Visual C++ :: Windows 64 Bit Or 32 Bit Preprocessor Directives?

Jul 1, 2013

I want to connect to an SQL Server database using ADO with VC++.

In order to do that you need to import an external dll, like so:

#import "C:Program Files (x86)Common FilesSystemadomsado15.dll"

What if the OS is not 64 bit? That would mean the (x86)-suffix would be incorrect.

how to work around this using certain preprocessor directives?

Something like this, maybe?:

#if 64bit
#import "C:Program Files (x86)Common FilesSystemadomsado15.dll"
#else
#import "C:Program FilesCommon FilesSystemadomsado15.dll"
#endif

View 9 Replies View Related

Visual C++ :: How To Tell If Windows Partition Is Active

Nov 24, 2014

My goal is to know if Windows is installed on an active disk partition.

View 8 Replies View Related

Visual C++ :: Windows Slideshow Screensaver

Apr 21, 2013

I am looking windows slideshow screen saver source code.

View 5 Replies View Related

Visual C++ :: MFC Child Windows Application

Nov 9, 2013

I am new in Visual C++ and I have to make an MFC application with "child" windows. Here is what i need to achieve - [URL] ..... As you can observe when you click on the cross of popup window or child window 2 both are closing.

View 2 Replies View Related

Visual C++ :: Rapidly Pasting From Clipboard Under Windows 7

Feb 3, 2013

I designed an app for work that lets you enter data in a much more efficient way, then it needs to paste this data into the very curmudgeonly interface we use for work. I designed this app a long time ago while at a different company, and I used VC++ 6. I'm still using VC++ 6, but in a vbox with windows XP.

The code is being called as part of a bigger function that determines what exactly needs to be pasted into the work app spreadsheet. I have to call each item separately because the work app does not take copied tabs the way Excel would or whatever, it just ignores them. And it also pops up boxes and such that need to be handled in other ways.

The result works just fine under Windows XP, but when I do it under my regular Win7 box or on the Win7 boxes at work, it does not work properly.

This sets the data up, Text being the data to be pasted:

Code:
while (1) {
if (OpenClipboard() == FALSE) {
::Sleep(1);
continue;
}
HGLOBAL clipbuffer;
char * buffer;
EmptyClipboard();

[Code] ....

No infinite loops yet, again was just testing if it was OpenClipboard failing because it was being called again too quickly or something (and it did happen occasionally).

Then testing that the clipboard data is correct (this is always true), and pasting with keybd_event. SendInput is not available with VC++ 6.

Code:
HGLOBAL hglb;
LPTSTR lptstr;
LPTSTR buf = Text.GetBuffer(0);
while (OpenClipboard() == FALSE)
::Sleep(1);

[Code] .....

If the ::Sleeps are commented out, it will paste the wrong data almost every time under win7. It seems like it pretty much uses the last thing to be copied in the function and pastes it over and over (but not *always*). If I uncomment them, it will work as expected, but it obviously takes longer. With ::Sleep(50), it works about 80-90% of the time. Obviously I can't have the wrong data being pasted, and I'd prefer not to have to wait like this--and perhaps on a slower system or a system that is doing other things it may take longer and paste the wrong thing. It works fine on XP even without the sleeps.

Did keybd_event become a separate thread or something? Am I doing something wrong with the buffers? (I've tried using CSharedFile too with GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT settings, exact same thing.) Why does it work fine under XP but not under 7?

View 10 Replies View Related

Visual C++ :: Error In Registering Windows Class

Jan 28, 2013

The following code it taken from msdn library but it is failing to compile.

the following code has a header where all the variables used here are stored in header App.h.

The following lines are giving trouble:

Code:
DialogBox(pApp->getInstance(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, pApp->About);
error: 'App::About': function call missing argument list; use '&App::About' to create a pointer to member

Code:
wcex.lpfnWndProc= &App::WndProc;
error: '=' : cannot convert from 'LRESULT (__stdcall App::* )(HWND,UINT,WPARAM,LPARAM)' to 'WNDPROC'

There is no context in which this conversion is possible

Here is the complete code:

#include "stdafx.h"
#include "App.h"
App::App(void) {
}
App::~App(void) {

[Code] .....

View 4 Replies View Related

Visual C++ :: Showing Console Windows In Win32 DLL?

Oct 31, 2014

Is it possible to show a console window in a Win32 DLL?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved