Visual C++ :: How To Fit MDI Application On Smaller Laptop

Mar 23, 2013

We have developed MDI application on 17 inch monitor in VC++ 2010 MFC. But now management wants application to run on 10 inch laptop.

Application does not fit,it goes out of screen. How to fit application on smaller screen

View 1 Replies


ADVERTISEMENT

Visual C++ :: Find Largest Value Smaller Than Key

Apr 19, 2013

I have a std::map<int, foo>

what's the ideal way to get an iterator to the item that has the largest key (int) smaller than a given value.

basically, the item before upper_bound(). I can use upper_bound() and then decrement, but it needs special cases for both end() and begin(), and in the case of end() I'm not sure how I get it to the last item in the map, afaik, we're not allowed to decrement end().

Code:
auto it = mymap.upper_bound(x);
if (it==mymap.begin()) // first item in the map is already too large. reject
NotFound();
else if (it==mymap.end())

[Code] .....

// here it points to largest item smaller than x.

I can iterate over the entire map and do a compare, but then I pretty much loose the benefit of the binary search.

View 2 Replies View Related

C++ :: Write A Program That Will Connect Laptop To Desktop?

Jul 5, 2013

write a program that will connect my laptop to my desktop unlike gotomypc.com. I want to have my desktop hooked up to a router and sends video and audio info to my laptop. At the same time my laptop will be sending it's keyboard and mouse. If there is an audio input from a microphone it will send that to the desktop. If the webcam needs to be used for something like Skype, it will send that to the desktop too. I think it would be faster for the laptop to process any flash drives, but it should be able to send that to the desktop too. Has a program like this already been created? Is C++ an optimal language to write the program in?

View 5 Replies View Related

C++ :: Does Realloc To Smaller Memory Result In Same Pointer

Aug 10, 2014

If I do this:
void* testPtr = malloc ( 1000 )

And then this:
testPtr = realloc ( testPtr, 500 )

Will the realloc just reduce the allocated size and keep the same pointer, or can there be a chance of it finding another place for that allocation ( Meaning that it will expensively move the memory to another location )?

I am trying to create efficient programs by making my dynamic allocations the least resource hungry as possible during runtime.

View 2 Replies View Related

C++ :: Parsing A Large File Into Smaller Units

Dec 16, 2013

I have a large binary file (84GB) that needs to be broken down into smaller file sizes (~1GB to 8GB) for analysis. The binary file is on a 32-bit machine and cannot be copied to another machine for analysis. The PC has Visual Studio 6.0 and is not upgradable. My issue is I'm using the following generic code to create the smaller files.

fseek(file, start, SEEK_SET);
end = start + (variable based on file size);
fseek(file, end, SEEK_SET);
for (i=start; i<end; i++) {
if(!feof(f)) {
byte = fgetc(f);
fputc(byte,new_file);
}
}

However, on a 32-bit machine, the iterator can only count up to ~2billion. Which means that I'm unable to copy anything past ~2GB. My original idea was to delete from the large binary file as I read from it so that I can reset the iterator on every read. However, I haven't come across a way to delete binary file entries.

Is there any other way that to break down a large binary file into smaller units? Or is there a way to delete binary file entries in sections or per entry?

On a 64-bit machine I could use _fseeki64. I've been reading that some versions of Visual 6.0 are capable of supporting 64-bit numbers but when using _fseeki64 or _lseeki64 on this machine its an "undeclared identifier"

View 7 Replies View Related

Visual C++ :: Run MFC Application From Console?

Feb 7, 2013

I have a question about to run an MFC dialog based C++ application from console: if I run my application from console, I see the application start and the console immediately back to prompt. I need that console wait the application exit before show me the prompt again. I tried on Visual Studio 6, 2005 and 2010 but the behavior is the same.

View 3 Replies View Related

Visual C++ :: Two ChlidFrames In One MDI Application?

Jun 23, 2014

I want to achieve such an efect like - one view which takes all MDI area and some views which arelike non modal dialogs

Two Child frames will be correct? one for "big" view which will be always visible and second for a "smal" views

View 2 Replies View Related

Visual C++ :: How To Pass CStringArray From Application To DLL

Feb 11, 2013

I passed the CStringArray to dll & wrote the String in a file.

The error File: array_s.cpp, Line No: 420 was occured when i close the .exe file.

For your reference:

Code:
Function Declaration in DLL :
DECLDIR void SetParName(CStringArray& ParName);
Function Definition in DLL :
DECLDIR void SetParName(CStringArray& ParName){

ParName.Add("X1");
ParName.Add("X2");

[Vode] .....

My doubt is, CStringArray items are allocated in the DLL. So, when i release the CStringArray object in the application. Is it can release memory that are allocated in the DLL ?

View 1 Replies View Related

Visual C++ :: Developing A Form Application?

Jan 15, 2014

I have a HTML code and i need to developing a form application.

issue: i have a html code and a database table , how to put this together with code and link them and peu them on server ...

View 3 Replies View Related

Visual C++ :: Exit Application Using Thread In MFC SDI

Feb 4, 2014

I have a SDI application. I created a method OnClose to handle ON_WM_CLOSE of CMainFrm. This onclose() function calls a method in cmyview.cpp. Here, I created a thread that calls global function and from this function it calls another function in cmyview.cpp. At certain condition my application should close at here, I used postmessgae(WM_CLOSE (or) WM_DESTROY). I am having an error as object reference not set on postmessage(WM_CLOSE) it is going to afxwin2.inl page where exception occurs.

Below is code snippetHere, either j or k will only be true depneds on user input)

MainFrm.cpp:
void CMainFrame::OnClose()
{
CMyView* pview = (CMyView*)((CFrameWnd*)AfxGetMainWnd())->GetActiveView();
pview->method1();
}

[Code]...

View 3 Replies View Related

Visual C++ :: Replacing GUI In Win32 Application?

May 15, 2014

I have a Win32 C++ application which works pretty well, but I don't like the GUI and I want to replace it with one designed graphically, a la Windows Forms. What is the best strategy to port my code? I tried creating a new Windows Forms C++ application and got pretty far with it, but was stymied when trying to call my unmanaged functions on a button press. If I can't use Forms to add a GUI without completely rewriting the program, what's my best bet?

View 14 Replies View Related

Visual C++ :: How To Remove Application Name From Registry

Jan 16, 2013

In a typical MFC application I use SetRegistryKey(_T("My_Company")); to set the root registry entry for my application. The MFC application however creates an entry by the name of executable where it stores all the settings of that application. I don't want that because we often change the name of executable and I want it read registry from the same set location. As example if my application name is Calculator.exe and Calculator_debug.exe it creates two different registry settings.

My_CompanyCalculatorsettings
My_CompanyCalculator_debugsettings.

How can I stop that?

View 1 Replies View Related

Visual C++ :: MDI Application Client Window

Apr 17, 2015

I am developing a MDI application that will contain a RibbonBar and a Properties Pane window. The MDI documents are not tabbed. I am finding that when I try to move the client window around, it gets clipped by the RibbonBar and the Properties Pane window (shown in image). I know the client window cannot go outside the client area, but can the client window be on top of the ribbon bar and the properties pane window?

I am using VStudio 2008.

View 7 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++ :: Pan Gesture In Desktop Application

Nov 11, 2014

I'm struggling with the pan gesture in a desktop application for my Surface Pro 2.

I simply want to pan (or "swipe" if you prefer) with two fingers, but it doesn't behave like I want it to. If I put two fingers on the screen and move them straight diagonally, I receive a series of client coordinates that are aligned in a vertical or horizontal direction. Only if I perform some circular motion, then it's suddenly possible to move diagonally and receive coordinates accordingly.

I've tried with MFC, by overriding CView::OnGesturePan. I've also tried with a sample project provided by Intel, that handles the GID_PAN message in WndProc to move a rectangle around, but with the very same result. The project can be downloaded from [URL] ... fordesktop.zip, so you can quickly reproduce the behaviour if you have a touch screen.

Code:
void GestureHandler::handlePan(HWND hWnd, GESTUREINFO gi) {
if (gi.dwFlags & GF_BEGIN) {
m_first.x = gi.ptsLocation.x;
m_first.y = gi.ptsLocation.y;

[Code] .....

I first thought it had to do with the points being too close to each other. I mean, if two points lies only one pixel apart, it can only result in eight different directions. But if I modify the code to only update "m_first" when the distance between the points are greater than some minimum distance, the points still keep being projected to a horizontal or vertical line relative to the first starting point.

View 1 Replies View Related

Visual C++ :: Closing MFC Application From Command Prompt

Jul 31, 2013

I have created a MFC dialog based application. Now I want to implement such a functionailty that I will be closing my application through command prompt. And while closing of my application the ExitInstance() method of my application should get called. What is the command which I should put in the command prompt to close my application in such a way.

View 8 Replies View Related

Visual C++ :: Wininet Application Does Not Send To PHP File

Jan 23, 2015

This code doesn't send parameters to mysql database vis WININET post, i see it send empty fields, what exactly could be the problem:

Code:
#include <stdio.h>
#include <windows.h>
#include <string.h>
#include <Wininet.h>
#define PAGE_NAME "gate.php"

[Code] ....

View 13 Replies View Related

Visual C++ :: Check Whether Application Instance Is Running Or Not

Jan 20, 2014

For my project I need to check whether my application instance is already running or not. I got the following code from Net ..

Code :

HANDLE mutex;
mutex = CreateMutex( NULL, TRUE, _T("MYAPPNAME"));
if ( GetLastError() == ERROR_ALREADY_EXISTS ) {
// There's another instance running. What do you do?
AfxMessageBox(_T("Application Already Exists"));
PostQuitMessage(0);
ExitThread(0);
return;
}

The code works fine .. but the code even works fine , even if I pass any string as a parameter to CreateMutex. E.g.

mutex = CreateMutex( NULL, TRUE, _T("QQQQ"));

How it is working fine ?

View 5 Replies View Related

Visual C++ :: String Passing Between Functions In SDI Application?

Apr 8, 2013

I am doing an project in SDI. I have two functions name sendtext(CString str) and displaytext(CString inr) both in different class. I have a pointer name pView to send the string str to function "displaytext". The problem is after some operations i get a text in str and i send that text to display text in the output screen i get the text and wen the second text comes to "displaytext" the former text disappears and the latest string only present. How can i display both the text in the output window on ClistCtrl class.

Code:
Void sendtext(CString str)
{
// do some operations
................
pView->displaytext(str);
}
void displaytext(CString inr) {
CListCtrl &ctlsde = this->GetListCtrl();
ctlsde.InsertColumn(1, _T("First "), LVCFMT_LEFT, 80);
int nItem;
nItem = ctlsde.InsertItem(0, inr);
}

View 14 Replies View Related

Visual C++ :: Play Youtube Videos In Application?

Mar 26, 2014

I am just at the starting point of this subject. How do i add a video player to my windows form application in vc++?

Can I link youtube videos to that player to be played?

View 2 Replies View Related

Visual C++ :: Exiting Application During While Loop Operation

Jun 16, 2013

I have a VC++ 6 dialog-based application. This application is intended for reading data from a USB device (this is a FTDI FT245R chip). I have a start button on the dialog. On clicking it, unsigned char data retrieved from the USB device is displayed on the dialog. The start button invokes a function which includes a while (1) loop inside which the USB device is read and the values displayed.

There are no break or continue statements inside the always operating while (1) loop. All this works fine. My problem is how do I exit the application as normally it would just run forever? I have put an exit button on the dialog with code added to call OnOK(). Normally this would nicely close the application but as I have an endless while loop in my application so this button doesn't seem to work. Nothing happens on clicking it and clicking it repeatedly just hangs the program.

View 8 Replies View Related

Visual C++ :: Application Won't Start Once Installed On Other Computers

Sep 13, 2012

I use standard libraries and INNO Setup, wich is a free setup file creator.

I succeeded in adding NetFrameWork 4.5 installer into the setup (it runs it after installation, and before running my software (named GOFINDER).

Now, i remember that this happened to me, but after three months of programming, mine used to start and still does. But I know it sometimes doesn't start, and I don't know why exactly.

I checked to make sure that I needed only FrameWork 4.5.

But maybe it is because of Visual C++ Runtime wich is not added upon setup.

I will try to check this after posting cause this has just popped up in my mind.

I'm asking you how can I Make sure, that distributing my software won't do that anymore.

Is it because my application file is not set on Run as Administrator?

Cause normally, it opens without this necesity, except as a Shell (well I have to check back but I think it does if I check on the run as administrator checkbox.

The problem is not really with InnoSetup, but I also would like to know how I can check that box automatically upon setup.

they say they have a documentation but I don't find it on my computer.

And... why would it start on my computer, and not on my beta-testers's one?

View 3 Replies View Related

Visual C++ :: Converting Code To CLI Form Application?

Jun 10, 2013

As a starter project I want convert a Neural net app from "AI Techniques for Game Programming (2002 Buckland)" to a Visual C++ CLI Forms application. I have created the interface and now I have to rewrite the in/output routines, amongst other things.

First question I have has to do with variable initialization used by Buckland. Code looks like this:

Excerpt from header file (CNeuralNet.h):

//-------------------------------------------------------------------
//define neuron struct
//-------------------------------------------------------------------
struct SNeuron
{
//the number of inputs into the neuron
int m_NumInputs;
//the weights for each input
vector<double>m_vecWeight;

[code]....

Question I have: what is the the function of ": m_NumInputs(NumInputs+1)" after the method declaration? Buckland does this in many places in his code. In this case it's a struct, but he does it with classes too.

View 3 Replies View Related

Visual C++ :: MFC Dialog Based Application Connect With MYSQL

May 20, 2014

I'm using VS 2012. Installed MYSQL 5.6, C++ Connector 1.1.3. Created a sample table using mysql. Now i like to create a connect between mysql and MFC dialog. Using this, i was try to connect.

Server Explorer -> Data Connection -> Add Connections ->MYSQL Database -> Addconnection

To get the connection, i want to enter the connection settings like:

server host name = localhost, user name =root, password=

If I pressed any letter in the keyboard means add connection dialog was closed automatically.

How to connect mysql(localhost) with MFC Dialog?

View 14 Replies View Related

Visual C++ :: Making A Little Quiz Application In Studio 2008?

Jun 10, 2013

I've been trying to make a little quiz application that takes questions from a file and them presents question by question on a static pannel, a few buttons that have the possible answers on them written as the questions go, and on the bottom a little place where we can see whats our score.when we finish the quiz, the score gets writen in a data.dat file and thats that.

View 14 Replies View Related

Visual C++ :: Receiving Windows Message In Console Application?

Oct 11, 2013

I'm trying to write a program that passes Windows messages back and forth from another program that controls a laboratory instrument. I was able to write a program that successfully passes instructions, as evidenced by the instrument doing what I tell it. However, I am having trouble getting a return status from the instrument. The manual instructs the following:

// demo code, etc.
// send message to the instrument operating software here...
SendMessage(hwnd, WM_COPYDATA, tag, (LPARAM) &cd)

Either a completion message or return data is returned. Remote commands ReturnStatus, ReturnTiming, and ReturnData return data. In either case, data is received through an asynchronous windows message inside Win32 COPYDATASTRUCT type data packet.For example, a typical OnCopyData window callback is shown below, where the string data retrieved is finally stored into a Microsoft CString object. Note the use of variable replyTag, discussed above, which is used to isolate the correct windows message returned.

BOOL CUserDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* cd) {
….
if (cd->dwData == replyTag) {
/* String pointing to status */
CString retStatus = (char*) cd->lpData;
}
….
}

I can't tell if my problem is in generating the replyTag, getting the HWND to my own console window, or the actual receiving part of the code.

When setting the replyTag, the manual instructs: UINT replyTag = RegisterWindowMessage(“SOFTMaxProReplyMsg”);. However, I have to put an "L" in front of the string or I get a data type error (can't convert const char* to LPCWSTR).

When setting a HWND for myself, the manual instructs: HWND MyWnd = GetSafeHwnd().

That produces an error because GetSafeHwnd is a function of the Cwnd class, and I don't have a Cwnd. I have replaced it with HWND MyWnd = GetConsoleWindow();

When listening for the reply message, the manual instructs what I quoted above. However, I again don't have a Cwnd. I therefore simply used

if (cd.dwData == replyTag) {
CString retStatus = (char*) cd.lpData;
}

The above if statement always evaluates false, and the cd.lpdata contains the message that I had sent out instead of a reply message. How to get a reply using my console application. Here is the full code of my function:

Code:
#include "stdafx.h"
#include<iostream>
#include<vector>
#include<string>
#include<afxwin.h>
using namespace std;
void SendCommand(string command) {
// Get tags to identify the receiving and sending messages

[code]....

View 3 Replies View Related







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