|
You have been here long enough that you should know to ask your questions exactly ONCE.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I will delete the other one
|
|
|
|
|
Since you are using blocking sockets (and not async sockets) you have to find out the size of the response and read exactly that many bytes from the socket. If its chunked encoding then you have to read till the end.
Blocking mode sockets with raw api calls work like this: When you send() data the send() function returns only if an error occurs or the whole buffer you provided could be written out the send buffer of the socket. recv() works a little bit different, it returns immediately even if only a single byte of data is available in the receive buffer of the socket and you can't assume that a consequent recv() call would block if your buffer wasn't filled up completely during the previous call. This behaviour of recv() can be changed to wait for a whole buffer by specifying the MSG_WAITALL flag on windows but that is not recommended and that flag isn't supported everwhere.
|
|
|
|
|
oh... let me try the async (non blocking)...
Besides, yes as you have suggested it is that i have to read untill the end chunk by chunk...
I will try both. Thank you for the reply.
http://vikku.info/ Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
|
Hi,
can anyone please tell me how to select the multiple items in
the tree control using Non MFC code
i searched on google i got the following but it is used with MFC
i want it in Win32, if anyone have idea about this please reply
http://www.codeguru.com/cpp/controls/treeview/misc-advanced/article.php/c629/A-multiselect-tree-control-class.htm
thanks
|
|
|
|
|
According to the documentation[^] mult-select is not supported. You would probably need to use subclassing[^] to achieve this.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
but i am using win32,
how to do this?
is do u have an idea.
|
|
|
|
|
Ram Shelke wrote: do u have an idea. Yes, and I gave it to you in my previous answer. You need to subclass the control and add your own code to make multi-select work.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
As Richard has pointed out, there is no support for multi selection for a tree control, so it is something that has to be added on your own. However from his link to the documentation, there is another link to an article that suggest with Windows Vista and onward, there is support for multi selection on a tree control. Check out this link and see if it helps you to get started. Windows Vista Control Enhancements[^]
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Interesting that the article was written in 2007, and yet the link I found claims to be current as of 2012.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
That documentation was rated down and that might be part of the reason. Though there is no mention if the Vista control enhancements ever made it back into the main stream, like Win 7 or 8.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Hi
I have tried to use a method from long ago:
http://beta.codeproject.com/Articles/358/Avoiding-Multiple-Instances-of-an-Application
BOOL CMyApp::InitApplication()
{
// there can be only one instance of this application, that is per windows user logon session!...?
if(::CreateMutex(NULL,FALSE,_T("{9C114FA0-0D7A-4e3f-8195-BE59EFC3EA42}"))==NULL)
return FALSE;
if(::GetLastError()==ERROR_ALREADY_EXISTS || ::GetLastError()==ERROR_ACCESS_DENIED)
return FALSE;
return CWinApp::InitApplication();
}
Simultaneous users can still create an instance each. Why is that? Do anyone have an (easy) solution?
Using Windows XP SP3 with VC 6.0.
Thanks!...?
|
|
|
|
|
With Windows 2000 and later, you should prefix the name with 'Global\' to create it in the global name space:
::CreateMutex(NULL,FALSE,_T("Global\\{9C114FA0-0D7A-4e3f-8195-BE59EFC3EA42}")
Then the call will also fail for other users.
|
|
|
|
|
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
|
|
|
|