|
You need an additional part which will solve it. Your application should check if other instances if it are running (by checking all running processes) and if so, terminate itself. You can set up rules as of who should quit and who should continue (for example, if an outdated version is running and another newer version starts, then the older version should quit, like in my article about auto update Target Eye Revealed part 1 - Target Eye's Unique AutoUpdate Mechanism[^]).
|
|
|
|
|
Hi all,
is there a way, in C++, to correctly recognize a table in a pdf file and extract its data laid out in rows and columns?
I think a possible solution could be extract tables from pdf to excel (using one of the tools available) and then reading data from excel files.
But is this the proper way ? Are there any other solutions ? Is there a library (free or commercial) that can help me ?
Thanks in advance for your help
Luigi
|
|
|
|
|
As a matter of fact there is no PDF way to determine a table in a pdf. because there is no table type object in PDF file. But with clever programming you can determine if there is any table. but yet that wont be simple task and might not be correct all the time.
I wish I could believe there is an after life.
|
|
|
|
|
I am trying do a coding in c++ and My problem goes something like this. I have a variable of 5 arrays a[5] for storing the 5nodes of a network. The network is randomly formed by the random number generator. I have the time of travel for each paths of the network. All the nodes may not be connected to eachother. The network and the time of travel of each path is as per the user has assigned. Now I have to check the elements of each array and assign the penalty as per the conditions. My main task is to find a network path traveling each node of the network only once such that the node visited is not repeated. Its similar to TSP but the difference is that in TSP has the condition that it is possible to travel from each node to every other node. But for my case the network is pre defined and nodes are not connected to every other nodes in the network.
a) Like if the network stored is 2-2-3-4-5 then I find that a[1]=a[2] so I will have to assign the penalty (type 1 )as the network has a path 2-2 which is not possible as the starting and end of the path is same. At the same time for rest of the paths from node 2 to 3, node 3 to 4, node 4 to 5 I will have to calculate the sum of total time of travel when I finally reach the node 5.
b) Also there is another penalty condition if the path is not a possible path in the network given by user then I will have to assign penaly( type 2) for such kind of condition like if 1-2-4-3-5 is a network to be checked. Here I am supposing that all the paths are possible but the path 4-3 doesn’t exist in the real network provided by the user, So for such cases I will have to calculate the sum of the time of travel for the paths which are possible and also assign the penalty (type 2)
c) There is also a condition that I need the end point of the network as node 5.So in the network generated randomly if the end node is not the node 5 then I will have to assign the penalty (type 3) and at the same time calculated the sum of the rest possible paths. For example the node 3-5-2-1-4 here the end node is 4 so I will have to assign the penalty(type 4)
d) Since I am not allowed to visit the same node twice I will have to assign the (penalty type 4) if the network has repeatition of nodes like if the network is 2-4-3-1-4. Here the node 4 is occurring twice so I will have to assign the penalty(type 4) and also calculate the sum of the time of travel of the other paths.
Considering all the above penalty conditions I will have to check the network s. I am really not being able to use any logic on how do I start. Need some hint on how do I do it.
modified 15-Sep-12 12:53pm.
|
|
|
|
|
This question may get a better response if posted in the Algorithms Forum[^], as it is not really specific to C/C++.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
I need to create an array using a int variable who cant be a numeric const, because it represent a variable length of something.
So i need to use the code:
const int iLength = iVariable;
int x[iLength];
this code doesn´t work because the c++ allows me just:
(suppouse length 10)
#define 10
or
int x[10];
I do not to use resize array because would be slower
someone can help me ?
Thanks for your attention
|
|
|
|
|
A C array has always fixed length so its length must be a compile time constant. If you want a dynamic array then use stl, more specifically std::vector to do the job. Thats a resizable array. std::vector documentation here
|
|
|
|
|
int* px = new int[iVariable];
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi All,
I have a an image handle provided to me by a device in form of
Handle hDib;
It is not
HDC hDC;
I want to convert this hDIB to Char* array for further use in my application.
Please let me know if any of you know about a good c++ library for this.
Thanks in advance.
|
|
|
|
|
Could GetDIBits[^] function help you?
Veni, vidi, vici.
|
|
|
|
|
Dear
As I mentioned in my question that it is not HDC rather it is
HANDLE hDib;
The function you mentioned need HDC as a parameter
which i donot have
|
|
|
|
|
What kind of device are you dealing with?
Veni, vidi, vici.
|
|
|
|
|
|
How can a digital camera provide a HANDLE to a DIB?
Veni, vidi, vici.
|
|
|
|
|
It is a method provided in its SDK which I'm using
It also saves it on the disk but I want to convert it into Char* array and later to jbyteArray.
Well the question is Is it possible to convert this Handle (which is obviously a pointer to that specific DIB) to char* array
modified 14-Sep-12 9:31am.
|
|
|
|
|
if that handle is really a pointer to a DIB, then it's a pointer to an BITMAPINFOHEADER, with the pixel bytes immediately following.
|
|
|
|
|
It's most unlikely that you would want to convert it to a char* array. If it is really a pointer to some form of bitmap then there should be a function that will return the actual bitmap structure or byte array for you, but without knowing anything about the SDK you are using it's impossible to know what.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thank you all for your response i have been able to create a
HBITMAP from my DIB
HANDLE DIB by using info header and filling it using GDI . I also have been able to save it to my disk and to draw it on screen by using
StretchDIBits method of the same library.Conversion of DIB to char* was not a good option.Now i want to know that is there any other good API or C++ library which can be used to draw DIB directly on
tagRect in an MFC application.
|
|
|
|
|
StretchDIBits() already performs that function; what do you mean by tagRect ?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
It is a structure which draws a rectangle in windows applications.
The problem with that method is that when i minimize my application and again restore it. The image disappears. I have also used the function
FillRect() but the problem still persists.
Kindly help me in this regard
|
|
|
|
|
AhmdAxf wrote: when i minimize my application and again restore it. The image disappears. So, you are probably doing something wrong, quite possibly drawing in the wrong place. You must put all your drawing code inside the function that handles the WM_PAINT message.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Actually it is not a MFC application which does have a method which contains WM_PAINT message.
Rather it is a java applet and I'm drawing through AWT native Interface.
|
|
|
|
|
So why was this posted in the C/C++/MFC forum and titled "Conversion of image Handle hDib to Char* array in C++"?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
There is no separate forum for c++ or AWT native interface or JNI. So I have to post it here
|
|
|
|
|
Please Let me know if there is any useful forum for this particular technology
|
|
|
|