I think you have already worked out the problem it is going to take you a lot of power to work out what has changed in the mapped file.
The best approach but the hardest would be to intercept the Writefile calls from the Model application since you don't have the code. The process is called IAT patching and you hook the model application write calls and simply send the data for each write call to your client before letting it drop thru to write to the mapfile as normal. There are a couple of IAT patching articles right here on Code Project. It obviously has the massive advantage that effectively it slows the model program down if your update dispatch is slowed and there is no searching to be done you are transmitting the changes as they are made. The downside is this is not something a novice can code it requires a level of experience.
The second alternative is to make an application that simply cycles around comparing the mapfile comparing the mapfile to a local copy of the last scan thru the file and transmitting changes as it encounters them. So you have a local copy of the mapfile as you last visited this position as you then find a change you hold the position in the file and then keep reading while you have differences. All you do then is send a simple structure File position, size of change, change data to the client. Then you continue back to looking for a changes. All the client does is grab a packet, move to the position given and copies the changed data. So the client copy just changes slowly to mirror the server mapfile at whatever rate the packets can be sent. This is how remote terminal services work sending your screen to another user.
The downside of the second alternative is you will often get your fields having part of current data and part old data. For you that is not to bad because you know the structure layout so you can probably carry field flags to indicate if they are currently half changed because you in the process of writing them.
Anyhow whichever technique you use this will not be a trivial task
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
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.
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
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.
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.
// Program to print BFS traversal from a given source vertex. BFS(int s)// traverses vertices reachable from s.
// This class represents a directed graph using adjacency list representationclass Graph
int V; // No. of vertices
list<int> *adj; // Pointer to an array containing adjacency listspublic:
Graph(int V); // Constructorvoid addEdge(int v, int w); // function to add an edge to graphvoid BFS(int s); // prints BFS traversal from a given source s
this->V = V;
adj = new list<int>[V];
void Graph::addEdge(int v, int w)
adj[v].push_back(w); // Add w to v’s list.
void Graph::BFS(int s)
// Mark all the vertices as not visitedbool *visited = newbool[V];
for(int i = 0; i < V; i++)
visited[i] = false;
// Create a queue for BFS
// Mark the current node as visited and enqueue it
visited[s] = true;
// 'i' will be used to get all adjacent vertices of a vertex
// Dequeue a vertex from queue and print it
s = queue.front();
cout << s << " ";
// Get all adjacent vertices of the dequeued vertex s// If a adjacent has not been visited, then mark it visited// and enqueue itfor(i = adj[s].begin(); i != adj[s].end(); ++i)
visited[*i] = true;
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,
Client Side Code for Receiving data:
long nApproxSize = 900000;
int nEnd = 0;
long j = 0;
int nOffset = nApproxSize/100;
long nSize = sizeof(struct TagModalDB);
memset(EsimData, 0, nApproxSize);
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?
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.
Last Visit: 31-Dec-99 19:00 Last Update: 28-Feb-21 0:48