Visual C++ :: Joystick Data Retrieval And UDP Socketing

Dec 24, 2014

I want a simple c++ code that, first retrieves a joystick data (say PS3) and then sends the data to an IP address for further execution. Im using Arduino board on the receiver side,and i set it up so that it receives data from a specific port. I have tried sending simple LED on/off data from puTTy and it worked perfectly but now i want to do it in C++ project because puTTy doesnt obviously allow you to capture joystick data (its only input it when you type the data to be sent by yourself). There is a solution file im trying to use but somehow after it successfully shows me that it is receiving the joystick data, it doesnt send it to the specified IP address, thus nothing happens on arduino.

[URL] ....

View 2 Replies


ADVERTISEMENT

C++ :: Control Array Value Retrieval

Aug 23, 2013

I am using MFC (and a newbie here) and I want to retrieve values of my control array.

How can I possibly do that? This is my ControlArray

Code:
m_EditArray[0]=GetDlgItem(IDC_EDIT1);
m_EditArray[1]=GetDlgItem(IDC_EDIT2);
m_EditArray[2]=GetDlgItem(IDC_EDIT3);
m_EditArray[3]=GetDlgItem(IDC_EDIT4);
m_EditArray[4]=GetDlgItem(IDC_EDIT5);
m_EditArray[5]=GetDlgItem(IDC_EDIT6);

View 2 Replies View Related

Visual C++ :: Finding Value In Data File Closest To Calculated Data?

Jan 11, 2014

I'm reading from a file the middle column of data (Volts) where my test file "AP.txt" is opened by my program. Here is a segment of the data:

time Volts dV
49552 -66.20183 -0.01556807
49553 -67.76025 -0.01556495
49554 -69.30704 -0.01533247
49555 -70.81799 -0.0148486
49556 -72.26774 -0.0141133
49557 -73.63226 -0.01315276
49558 -74.89141 -0.01201764

Since the calculation I performed gives me -71.77 Volts, I need to match this value to the time that this occurs closest to using my program, and output the time that this occurs at.

Here is my program so far:
int main()
{
std::ifstream inFile;
inFile.open("AP.txt");
ofstream results_file ("maxvaluewithinput.txt");
float TimeAtdVMax = 0;
float VoltsAtdVmax = 0;

[Code]...

If you're curious, this program isn't for homework. It's part of the independent learning on C++ I'm doing for a Master's Thesis; the program will eventually model the APD90 of a ventricular action potential.

View 10 Replies View Related

Visual C++ :: Reading In Data And Displaying Out All Data In Linked List?

Feb 6, 2014

I am wanting to be able to add as many different instances of data, while the user has not stated 'n', but then it only ever writes back to the screen the input for the last set of data. Where as I want to display back to the screen all the data that has been entered.

Code:
#include <iostream>
#include <string>
/*Function Declaration*/
void createItem();
void returnItem();
//Items structure

[code]...

View 6 Replies View Related

Visual C++ :: Draw Buffer With Raw Data?

Nov 19, 2012

Got buffer with raw data. How to display it in MFC dialog and refresh it?

View 3 Replies View Related

Visual C++ :: Program That Get Data From DAT File

Mar 5, 2014

I am currently writing a program that grabs information from a .dat file. When I go to debut I get this error.

Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
// function step 1 - declare the prototypes
void sort(int n); // catches an integer number from the call
void swap(string *p1, string *p2); //catches the location of data in ram

[Code] .....

View 5 Replies View Related

Visual C++ :: How To Draw 2D Array Of Data In MFC

Jun 3, 2013

I have a circle of data that is represented as:

vector<vector <unsigned char> >* data;

The first dimension of this vector is the angle of the data so there are 360 angles, and the second dimension is the bins of the data in which there are 512 bins per angle. Each bin has a value from 0 to 15 to determine the intensity of the bin. So basically, when this is all display, there will be a circle of data, with varying colors of intensity at each bin.

What is the best approach to doing this in MFC? How to draw this on the screen?

View 12 Replies View Related

Visual C++ :: Covert Raw Image Data Into PNG

Sep 23, 2013

I have the raw image data and now want to convert it to PNG image. How can i do that? The raw image data is stored in a unsigned char *.

I know how to convert it to Bitmap, but how to convert it to PNG.

View 2 Replies View Related

Visual C++ :: Get Data From Input Stream?

Jan 8, 2014

Code:
#include <fstream>
#include <string>
using namespace std;
ifstream inf("file name");
string line;
while (inf.good()) {
getline(inf, line);
}

instead of line by line i want the complete data from file to the string.What modification i have to do?

View 3 Replies View Related

Visual C++ :: How To Receive POST Data

Sep 24, 2014

I need to write an interface program in C++ to receive occasional data being sent to me from a different company from across the internet. The company says they will send the data using POST. They have given me a document that lists their data specific parameters and their meaning.

How do I receive this data in my C++ program?

View 14 Replies View Related

C/C++ :: How To Take Data Input From Message Box In Visual Studio

May 28, 2014

is it possible to take integer or char data type on message box to V C++?

View 2 Replies View Related

Visual C++ :: List Control Column Data

Jan 31, 2013

I am trying to populate a list control with the filename and maybe some other thing when i push the OK button....

Code:
void CThisDlg::OnOK() {
int iItem = 0, iActualItem = 0;
HANDLE hFind;
WIN32_FIND_DATA data2;
int iNum = 0;
hFind = FindFirstFile("*.*", &data2);

[Code] ....

When i push ok, no files get loaded. I also attached a image

View 13 Replies View Related

Visual C++ :: MySQL Connector Data Dump?

Jul 31, 2013

I wrote an application so I can manage the products for my e-commerce site. It uses MySQL 64 bit. Problem is some of my stores have in excess of 3 million products. The files that contain the data are all CSV. I parse the lines... format the data... write to table. On most of the stores which contain 10 - 60 thousand products it only takes max 3 min to write it all in. I have been running it on this one store for 6 hours now and it has barely made a dent. I know there are almost 3mil products in this one but it should be going much faster given what the speed was for the 60K stores. Is there a faster approach to handling a massive dump like this? I should also add that there are quite a few indexes. These indexes are there for ordering and fulltext search once the products have been activated on the site. I cannot create the table without the indexes and add them later since there is already preexisting data that is using the indexes.

View 2 Replies View Related

Visual C++ :: Use Of CListCtrl For Live Data View?

Jul 29, 2013

I'm working on an app which monitors user selected data sets from various devices, and I'd like to display the data in a CListCtrl. This would be very convenient, but I'm just a little concerned about (1) just how fast can a CListCtrl be populated, and (2) how can i reduce or eliminate screen flicker. To be specific...

1. There will likely be upwards of 100 rows of data, maybe more (probably 5 or 6 columns), and I'm going to have to refresh it all as quickly as possible, perhaps as fast as once per second. I can play games and only refresh a visible rectangle, but how responsive the control would be, having all that data deleted and refreshed continually?

2. You can see why I'd be worried about screen flicker, and I thought I'd likely have to make two identical overlapped controls so I could double buffer as I would with a graphic animation, switching the visibility of one or another control after its updated to give the appearance of sudden complete updates. BUT... I see there is an extended style you can set called "LVS_EX_DOUBLEBUFFER"

View 10 Replies View Related

Visual C++ :: Write Raw Data To USB HDD (in Specific Sector)

May 4, 2015

I can access a physical device to read a specific sector in a USB hard drive. But my question is how can I Write to a specific sector? Lets say I want to replace what is in a specific sector of a hard drive with a new data.

View 6 Replies View Related

Visual C++ :: Arrays And Enumerated Data Types?

Feb 18, 2014

I am doing a programming assignment. This program asks you to collect statistics on precipitation and temperatures from the four quarters of a year and print the calculated results. It is an exercise in using enumerated types and arrays. The measurements are entered at the end of every quarter.

Major variables (there are other variables) in the program:

Variable called: month of type Summary_Month (the enumerated type)
Arrays of integers called: low_temp, high_temp, precip
Array of doubles called: avg_temp

You will ask the user to enter the precipitation, low temperature and high temperature for each quarter. As you gather this data, you will calculate the average temperature (using avg_temp) for each quarter by averaging the low and high temperature for that quarter.

After you gather the information you will calculate and output the following:

Total Precipitation for Year, Average Quarterly Precipitation, Average Quarterly Temperature, Highest Temperature for any quarter, Lowest Temperature for any quarter.

I am not getting the right output for average precipitation and temperature and I am not sure how to determine the highest and lowest temperature.

Code:
# include <iostream>
# include <iomanip>
using namespace std;
enum Quarters { March, June, September, December};
int main() {
const int NUM_QUARTERS = 4;

[code]....

View 3 Replies View Related

Visual C++ :: Object As Data Member Having Error

Sep 20, 2012

class CPop {
CBSVector<CTour> pop;
CBSVector<double> probability;
int popsize;
double TotalFitness;
CTour Elite;
CTspGAParams GAParameters;
}

error C2059: syntax error : 'constant'
error C2238: unexpected token(s) preceding ';'

I don't know y these errors, it runs fine in simple c++ environment

View 14 Replies View Related

Visual C++ :: Creating Different Process And Share Data Between 2

Dec 8, 2014

I want to create 2 different easy processes in C++ 1st and then i wanted to share data between these 2 processes.

View 7 Replies View Related

Visual C++ :: Print Sequence Data Structure

Sep 15, 2012

Printing out a sequence data structure. I am using a PC running Windows 7 with Microsoft Visual Studio 2008. This sequence has a dynamic array which stores a value_type which can be any of the built in data types for C++. Initially the sequence is 30 slots long. When the program starts the user starts at the beginning of the sequence by choosing the "!" option from the menu. The user will then insert a number such as 11 by selecting the "I" option (upper or lower case). Then the user will go to the next position in the sequence by selecting the "+" option then insert 22, then go to the next position and insert 33.

To show that the numbers are actually in the sequence the user goes back to the beginning of the array by selecting "!" and then select "C" to display the current number of 11. Then the user goes to the next position by selecting "+" and then "C" to display 22 and so forth. At this point the member function called current() works just find , but when trying to print the contents of the entire sequence the program displays garbage. Why?

Code:
// FILE: sequence_test.cpp
// An interactive test program for the new sequence class
#include <cctype> // Provides toupper
#include <iostream> // Provides cout and cin
#include <cstdlib> // Provides EXIT_SUCCESS
#include "sequence2.h" // With value_type defined as double
using namespace std;
using namespace CISP430_A2;

[Code].....

View 2 Replies View Related

Visual C++ :: Decoding RFID Data Hexadecimal Math

Feb 2, 2015

I currently am stuck at getting the needed outcome data from my RFID card. I got it decoded but now I need to do a few more things in order to get the final card number off the back of the card.

The cryptic value was E********B**0**E** (covered to protect card)

Decrypting it turned into 0000003048D1263B

Now I have 3 more steps to take in order to get to my wanted card number.

Step 1) Mask off the lower 20-bits (which should give me 0x1263B) I am unsure of how to go about doing that using C++.

Step 2) Divide by 2 to strip off the lower parity bit (which should be 0x931d). And again, I'm unsure of how to go about doing this in C++.

Step 3) Convert hexadecimal value to decimal value (which would equal my wanted card number). This should be easily done using C++ at this point - though hard to confirm that since I am on step 1).

Code:
const char* original = "0x931d";
unsigned long n = std::strtoul(original, nullptr, 16);

All of this looks to me like RegEX does to most people - complicated and not understanding why it does what it does but gives the correct output.

View 2 Replies View Related

Visual C++ :: Unable To Append Data To CFile Using FILE

Sep 26, 2012

I'm trying to append data to a CFile using FILE* But when execute the application, it always give error saying "No such file or directory". I can actually see the file created but it just keep giving error "No such file or directory".

Is the file being lock or the file just created so it can not be find by fstream(FILE*)? or the file mode is wrong?

Below is the code:

[QUOTE]
void SaveDocument(CString strFile) {
CFile file;
if( !file.Open(strFile, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone)) {
CArchive ar(&file, CArchive::store);
// save now.
MyClass.Serialise(ar);

[Code]...

Attached is the printscreen of the FILE* pointer. the pointer is evaluated as bad pointer. Why the FILE* pointer not able point to the file being created?

View 7 Replies View Related

Visual C++ :: Data Stuck When Debugging With Serial Port

May 10, 2014

I am making a MFC application with VC++2012 with receiving data from Serial Port and the data is stored in a Listbox, then after processing (convert into numbers) and get these data to draw a sine wave on the chart. (I intend to make a virtual oscilloscope).

Everything works ok at the beginning, but after receiving about 300 items or above (in the Listbox) the value seem stucking (or lagging) and work very slowly.

I receive data by the SerialPort_DataReceived() method, and process of converting and drawing chart also in this method, I think this makes the system overload!!

View 1 Replies View Related

Visual C++ :: MFC GUI-setting COMPort And Read Hex Data From Pic (ASCII)

May 22, 2014

I want to setup my MFC-based dialogue "IDD_LOADCELL" with serial communication so that when that dialogue is pop up, the data from PIC (external device) which is in hex file format is display on the edit control box on the dialogue. The variable name of the edit control box is "m_loadP "and "m_loadT1". type of variable for both are string. I want to get the code for the COMPort setting and reading the data from pic and finally display it on the edit control box created on the dialogue.

View 11 Replies View Related

Visual C++ :: Stream Data From System Windows Controls

Dec 19, 2012

I need make a CBitmap or a streamdata from a System.Windows.Controls::Image(rendered out put)in a SDI mfc application (supporting clr). Here is my codes:

Code:
using namespace System;
using namespace System::IO;
using namespace System::Collections::Generic;
using namespace System::Windows;
using namespace System::Windows::Controls;

[Code] .....

By this codes i can read datastream from bitmapSource but in this way somthing goes wrong in most of GIF animations. After debug i found out i need 3 more things too decode a gif animation - (x,y) position and size of each frame and disposal method for each one - finally i just found a way to draw tru images on a form window by this codes:

Code:
System::Windows::Window^ mainWindow;
mainWindow = gcnew System::Windows::Window();
mainWindow->Title = "GIF Imaging Sample";
//ScrollViewer^ mySV = gcnew ScrollViewer();
array<System::Byte>^ pixels = gcnew array<System::Byte>(bitmapSource->PixelHeight * Stride);

[Code] ...

When i change

Code: bitmapSource = decoder->Frames[0];
to
Code: bitmapSource = decoder->Frames[01];

frame[1] has drawn perfectly on window(i think some how Image class takes care about - (x,y) position and size of each frame and disposal method for each one ),so im wonder if how can i make a CBitmap or a data stream from System.Windows.Controls::Image class to use in mfc app.

View 2 Replies View Related

Visual C++ :: Display Data Immediately - Dialog Domodal?

Mar 24, 2014

I haven't seen it anywhere and I've been looking. Is it possible to display data, say in a CEdit field in a dialog as soon as the dialog starts? Either before or after DoModal is fine.. These are essentially the same.

Using Visual Studio 2013 - trial version. It's nice. Coming from VC6. Many things are familiar (so far), at least in the C++ part.

View 7 Replies View Related

Visual C++ :: Analyze Bitmap - Concept For Saving Data

May 18, 2014

I would like to create program which will analyse bitmap so would need good concept to save data. I am interested about the theory and I realize that i must to think this carefully because bad concept could create insufficient memory or inefficient program. Basically I want my program work with HSV or HSL model so I would need to convert the bitmap to HSL, but I am not sure if I should convert it first and then analyse all pixels or should I start to analyse the bitmap and make the conversion to HSL during it. But my main question is what method to choose to save the data in memory.

Even that I would start with very small, it should work also with bigger image like image having 1200 or even 4200 px on height. So the program should first analyse all columns of pixels in the image so for example 1200x800 px image has 1200 columns. So I would like to know if is it possible to create such object which would have such structure like this

Obj->basicColumnData->black->columns[name]->group

and in the place of columns should be placed data for every column. I would look for groups of pixels in the column, so in the result the column x could bear e.g. 500 groups of information and every group should contain the range of pixels e.g. group 1 should contain y value from 0 to 20, group 2 should contain value from 25-27 and so on. So I would create 1200 columns bear many of groups. This would be contained in "black" or "white" member to contain the data. This is just simplified idea, but the whole object should contain next data not just basicColumnData... So there should be another members bearing information calculated from the selected data.

So my question is what kind of method of saving data use for this? Should I use heap and dynamic allocated memory or should I create custom class, which will define every member, but these members will have to be dynamic memory? With the dynamic memory is there problem that there could be not enough memory to create such big object?

View 5 Replies View Related







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