|
I was thinking a bit more about your problem and there is a possible all be it highly technical solution which is a thing called a file filter. It jogged my interest as to whether you could run a memory mapped file in a file filter so you can get all the raw file access commands and it appears you can
Memory Mapped Files in a File System Filter Driver[^]
It wouldn't be trivial but you would know exactly what and where is being written by the model program to the memory mapped file to then duplicate and send to your client.
In vino veritas
|
|
|
|
|
manoharbalu wrote: Now I need to transfer some of the data values that are changed to another application... A third application, not one of the two applications sharing the structure in memory?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hello, i've decided to code a application for our committees in our university section. The basic function of the program should be to inform students about upcoming events hosted by different student unions/committees.
Events will be stored in an SQL database. Every event will have a few datas like "Committee name" "Description of event" "Date". The idea is that the app will get all events from the database that hasn't already been. It will display these in a list inside the application. If a new event is uploaded to the SQL database the application will give away a push-notification. And user will be able to display it. I have experience in C.
My questions are
Is there good graphic libraries and is it possible to do this with ease in C++?
Is it possible to make a program like this work in Android and IOS?
Would also appreciate general tips for people that've made mobile applications
|
|
|
|
|
C++ is not very popular in standard mobile applications (and it is not recommended, see, for instance Getting Started with the NDK | Android Developers[^].
For the an Android platform, Java is the natuaral programming language (altough you migh as well use C# via Xamarin ).
|
|
|
|
|
As CPallini said C,C++ coding of Android is not for the faint hearted and I would not recommend it as things stand at current.
I can offer you a funny way into the problem for a medium level programmer which is to use the free Unity game engine. You write in C# and can run your code and debug it as a windows application on windows. Then you just select the target as android and it does all the conversion and crossing to Android for you.
There are several good sample applications right here on Code Project in the Unity section but the cross platform is this simple
Tutorial: Creating your first Unity Android App [2015 Update] « Rabidgremlin's Soapbox[^]
You have a bit of learning to do with the unity interface but there are plenty of tutorials. The SQL classes already exist as standards in Unity like they do in .NET and is rather trivial as most online games store data in/from server databases.
On the plus side all the finger swipe libraries exist already and you can develop a groovy application look on the UI using the graphics stuff
In vino veritas
modified 30-May-16 5:08am.
|
|
|
|
|
Google calendar provides most of this as standard already.
|
|
|
|
|
Yes, I agree Richard but unless someone has done some work since I last tried compiling the code samples for the API even it was not trivial. I lost hours of time playing around with it as I needed old frameworks as well as 5 or 6 newer ones. If they have not improved it I would rate it as needing expert level knowledge but you may have more recent experience.
In vino veritas
|
|
|
|
|
I did not mean the API, just Google calendar.
|
|
|
|
|
I was thinking the same thing.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I have been trying to create a puzzle that can solve itself using BFS algorithm. Currently, the search algorithm and the main but I don't know how to integrate both of them together.
my BFS:
#ifndef BFS_h
#define BFS_h
#include<iostream>
#include <list>
using namespace std;
class Graph
{
int V;
list<int> *adj;
public:
Graph(int V);
void addEdge(int v, int w);
void BFS(int s);
};
Graph::Graph(int V)
{
this->V = V;
adj = new list<int>[V];
}
void Graph::addEdge(int v, int w)
{
adj[v].push_back(w);
}
void Graph::BFS(int s)
{
bool *visited = new bool[V];
for(int i = 0; i < V; i++)
visited[i] = false;
list<int> queue;
visited[s] = true;
queue.push_back(s);
list<int>::iterator i;
while(!queue.empty())
{
s = queue.front();
cout << s << " ";
queue.pop_front();
for(i = adj[s].begin(); i != adj[s].end(); ++i)
{
if(!visited[*i])
{
visited[*i] = true;
queue.push_back(*i);
}
}
}
}
and my main:
#include "queue"
#include <iostream>
#include <iomanip>
#include "BFS.h"
#include "A*search.h"
using namespace std;
int main()
{
int s;
int box1=3,box2=6,box3=9,box4=1,box5=s,box6=7,box7=5,box8=8,box9=2;
cout << " -----------" << endl;
cout << " | " << box1 << " | " << box2 << " | " << box3 << " | " << endl;
cout << " -----------" << endl;
cout << " | " << box4 << " | " << box5 << " | " << box6 << " | " << endl;
cout << " -----------" << endl;
cout << " | " << box7 << " | " << box8 << " | " << box9 << " | " << endl;
cout << " -----------" << endl;
void BFS(int s);
return 0;
|
|
|
|
|
You need to create a Graph object, with one of its constructors, and then call the various methods to construct and solve the puzzle:
int main()
{
int s;
int box1=3,box2=6,box3=9,box4=1,box5=s,box6=7,box7=5,box8=8,box9=2;
cout << " -----------" << endl;
cout << " | " << box1 << " | " << box2 << " | " << box3 << " | " << endl;
cout << " -----------" << endl;
cout << " | " << box4 << " | " << box5 << " | " << box6 << " | " << endl;
cout << " -----------" << endl;
cout << " | " << box7 << " | " << box8 << " | " << box9 << " | " << endl;
cout << " -----------" << endl;
Graph graph = new Graph(V); graph.addEdge(v, w); graph.BFS(int s);
return 0;
}
|
|
|
|
|
So did someone give you these two pieces of code?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I cant use SetItemText() for an owner drawn list control. I try
using
HWND hWnd1 = ::GetDlgItem (m_hWnd,IDC_LIST_1095C);
LVITEM lvi;
lvi.iSubItem = 3;
lvi.pszText = (LPTSTR) "123";
::SendMessage(hWnd1, LVM_SETITEMTEXT, 0, (LPARAM)&lvi);
But it doesnt update the text in the list. Im missing something and I cant
figure out what Im missing.
Please any response any one can give me will be greatly appreciated.
|
|
|
|
|
Are you capturing all messags related to the update?
|
|
|
|
|
I dont know what that means.
|
|
|
|
|
It's owner draw ... have you hooked the draw messages you are supposed to.
We can't see what you are doing or not doing in the draw parts which are your responsibility.
In vino veritas
|
|
|
|
|
Seriously? You have created an owner drawn control and you don't check all the messages that the control receives?
|
|
|
|
|
Have you checked the handle hWnd1 in the debugger since you have done zero error checking before you dispatch the message to it?
Next you haven't zero lvi half it's fields will have rubbish in them, well at least in release mode.
Is the subitem index right, don't forget it is a one-based index ?
Finally try calling an update after the message to force a redraw, I can't tell if it's needed or not because this is owner draw and depends what you have done.
In vino veritas
|
|
|
|
|
You must be desperate, seeing that you reverted to the SDK! Been there too, more than once!
Did you set the item(s) specifically as 'Owner Draw' in the Resource Editor!
If you did not, all the above quoted messages will end up in the 'Bit and Byte Bin', in the nearest toilet!
Hope this is helpful,
Bram van Kampen
|
|
|
|
|
Please refer my posting dated 29-Apr-16 3:52. I am still finding problem with that. Even If I try to send the data as small chunks as per the suggestions here, it gets struck or hanged.
Sever Side Code for Sending data:
void CMainFrame::OnSendactiveInsdata()
{
// TODO: Add your command handler code here
if(!InstClosedFlag)
{
TransData.Init();
long nSize = sizeof(struct TagModalDB);
memset(EsimData, 0, nSize);
memcpy(EsimData, Esim, nSize);
long nApproxSize = 900000;
int nEnd = 0;
long j = 0;
int nOffset = nApproxSize/100;
for (int i=0; i<100; i++)
{
TransData.Init();
memset(TestData, 0, 9000);
memcpy(TestData, EsimData + nEnd, nOffset);
for(j = 0; j < nOffset; j++)
{
TransData.m_sData.Insert(j, TestData[j]);
}
SendData(m_pInsSocket, &TransData);
nEnd += nOffset;
if ((nEnd + nOffset) > nSize) nOffset = nSize - nEnd;
}
Sleep(500);
}
}
Client Side Code for Receiving data:
void CMainFrame::ProcessPendingReadIns(void)
{
long nApproxSize = 900000;
int nEnd = 0;
long j = 0;
int nOffset = nApproxSize/100;
long nSize = sizeof(struct TagModalDB);
memset(EsimData, 0, nApproxSize);
for (int i=0; i<100; i++)
{
TransData.Init();
ReceiveData(&TransData);
memcpy(EsimData + nEnd, (const char*)TransData.m_sData, nOffset);
nEnd += nOffset;
if ((nEnd + nOffset) > nSize) nOffset = nSize - nEnd;
}
memcpy(Esim, EsimData, nSize);
Sleep(500);
}
Please provide me suggestions and step by step approach to send/receive huge data continously in cycles.
Previous Posting:
How to send huge data via sockets in continuous intervals
Our MFC Server application send huge real time data of size 900000bytes using CSocket (TCP/IP Sockets) via serialization continuously every 2 second to the MFC Client.
But After a few minutes, the application gets slowed down.
Is there any specific ways or methods of send/receive huge data continuosly via Csocket.
How to send the big data every interval in a better way.
|
|
|
|
|
Your code could be made more efficient just by a bit of tidying up. The following two lines will add considerably to processing time:
memset(EsimData, 0, nSize);
memcpy(EsimData, Esim, nSize);
Why clear the buffer to zeroes and then immediately overwrite it with data? The memset serves no purpose. Later you copy partial buffers into your large buffer a block at a time, again using memset for no good reason. Why not just receive the data direct into the large buffer?
|
|
|
|
|
I removed the memset statement. Server is Ok now. But the client is still hanging
|
|
|
|
|
manoharbalu wrote: But the client is still hanging Then you need to do some debugging. There is no way anyone here can guess why.
|
|
|
|
|
Of coarse it slows down you send the client and server to sleep for 1/2 a second everytime it sends or recieves. You do get that sleeps the entire MFC framework don't you?
It appears to be a some sort of half arsed timing mechanism that will inevitably fail ... there are things called TIMERS for timing functions, use them.
If you want it blunt get rid of these and things will work a whole lot quicker =====> Sleep(500);
If you want me to be super blunt there is no good reason to sleep an MFC or any Win32 program ever, forget that call and never use it in proper code it's a hack we sometimes use when trying to proto stuff. There are a multitude of proper ways to load balance and wait for things in nice Windows proper ways.
In vino veritas
modified 23-May-16 4:28am.
|
|
|
|
|
I removed the Sleep, but still the client is hanging.
|
|
|
|