|
You could use a debugger like Windbg to connect to the process.
Windbg has a command ~ which lists the status of all threads in the process.
|
|
|
|
|
Thanks for the reply.
I have WinDbg but I don't really understand how to use it to debug hangs. If I kill the process with Windows Task Manager I dont get a minidump yet I dont seem to be able to see any hangs if I run the app from within WinDbg (I created a test app which deliberately locks up)
Any hints and tips
Tony
|
|
|
|
|
You don't have to kill the process.
Select File -> Attach to process from the menu and attach to the already running/hung process.
|
|
|
|
|
I'm not that experienced with WinSock2 so forgive me for my bad ERROR_HANDLING.
Currently I have this line of code, breaking my application!
BytesReceived = recv(IPv4, Data, sizeof(Data), 0);
Yet I believe the worst case scenario the receive buffer would be empty and BytesReceived will be -1.
Unless their is a bigger picture missing, could you give me a heads up!
I'm currently using the HTTP protocol with blocking sockets! If you think it's a bad design strategy, please inform me!
1) send HTTP request
2) receive HTTP response
3) buffer[512] bytes, so HTTP response + data, separate them
|
|
|
|
|
What do you mean by break?
|
|
|
|
|
«_Superman_» wrote: What do you mean by break?
Die?
|
|
|
|
|
«_Superman_» wrote: What do you mean by break?
Someone said coffee break?
|
|
|
|
|
Unhandled exception at 0x761ed252 in Win32.exe: 0xC0000005: Access violation writing location 0x00000000.
Keeps pointing at the recv function line!
Update:
WriteFile(File, Data, BytesReceived, NULL, NULL);
This line is causing the trouble, but can't identify the problem!
File is the CreateFile handle.
Data is the recv buffer from WinSock2.
BytesReceived is in the int returned by recv.
modified on Tuesday, May 4, 2010 9:25 PM
|
|
|
|
|
Validate the "BytesReceived" variable(0 to 65535) and send it to the WriteFile fn. If u r passing the BytesToWrite as -1, than this will cause the overflow of DWORD variable which will exceeds the max value.
----Parthiban
|
|
|
|
|
hi friends,
unsigned char Cstr[100] = "this is a program";
i want remove spaces from Cstr;
please help any body
|
|
|
|
|
copy the string char by char and skip the spaces.
Watched code never compiles.
|
|
|
|
|
unsigned char pChar[100] = "i like vc++! ";
printf("%s\n%s",pChar);
it will compile and run..but it displaying 100 characters...
100 character means i like vc++ after null
please help me any body
|
|
|
|
|
Member 3653751 wrote: printf("%s\n%s",pChar);
When your format string has two %s specifiers, you must have two parameters after the format string.
So add one parameter to printf() or remove one %s from format string.
modified on Tuesday, May 4, 2010 11:35 AM
|
|
|
|
|
nothing here shows you are "trimming" the string; and there's an extra "%s" in the format part of printf.
Watched code never compiles.
|
|
|
|
|
Member 3653751 wrote: unsigned char pChar[100] = "i like vc++! ";
printf("%s\n%s",pChar);
Member 3653751 wrote: it will compile and run..but it displaying 100 characters...
Because Visual C++ doesn't like you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi.
This litte program copys the string char by char and skips the spaces.
#include <iostream.h>
int count=0,count2=0;
int strLength=0;
int main()
{
unsigned char Cstr[100] = "this is a program";
unsigned char Cstr2[100] = "";
while(Cstr[count] != '\0')
{
if((int)Cstr[count] !=32)
{
Cstr2[count2 ] = Cstr[count];
count2++;
}
count++;
strLength++;
}
for(count=0;count<strLength;count++) cout<<Cstr2[count]<<"";
cout<<"\n\n\n";
return 0;
}
|
|
|
|
|
Member 3653751 wrote: i want remove spaces from Cstr;
So what trouble(s) are you having in doing so?
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
unsigned char Cstr[100] = "this is a program";
unsigned char CstrS[100];
for (int i = 0, i2 = 0; i < 100; i++)
{
if (Cstr[i] != ' ')
{
CstrS[i2] = Cstr[i];
i2++;
}
else
continue;
}
|
|
|
|
|
Hi All,
I need some help if is it possible to browse through the Hidden Drives.
I mean Hidden Drives are nothing but drive with out having a drive letter.
For example:
[ Steps to create hidden drive: MyComputer>Manage>DiskManagement>SelectDrive>ChangeDriveLetter>Click Remove Button ]
For now I am able to find the Hidden drives using some combination of following APIs:
FindFirstVolumeW
QueryDosDeviceW
GetVolumePathNamesForVolumeNameW
GetVolumeInformation
FindNextVolumeW
I need to Create Browser for the Hidden Drives. Please give some hints to proceed.
Thanks a lot in advance.
Regards
Its Me Hara
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
You have all the answers.
What problem are you facing here?
|
|
|
|
|
I was not able to get the volumes with respect to a disk.
If PC has two Hard disks, each has multiple volumes. First disk has one hidden volume, second disk has two or some hidden volumes. I need to get the total Disks, and In that particular disk the total volumes along with hidden. Any clue in this way. I got the solution as total volumes. but not with respect to disk and its volumes.. Thanks for your reply.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Not sure if this will help you but here is something you can try.
Try to open a volume using CreateFile by specifying the file name as \\.\C: for the C drive and dwCreationDisposition parameter as OPEN_EXISTING .
If CreateFile fails, it could mean no such volume exists or you do not have permission to do this.
Then you can use DeviceIoControl on the returned handle by specifying IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS as the control code.
You will get the information as a VOLUME_DISK_EXTENTS structure in the lpOutBuffer output parameter.
Remember that a disk can contain multiple volumes and a single volume can span multiple disks.
You will all this information using the above function.
|
|
|
|
|
The actual straight problem here I am facing is for "C:" drive i can give path as C:\bla\bla..... But For hidden drives i was not able to give any specific base drive path. That is main problem, Is there any way to solve it. thanks a lot for your reply.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Let's assume D: is the hidden drive.
In this case is it not possible to specify the volume name as \\.\D: ?
|
|
|
|
|
Hidden drive will not have the drive letter. If we go to the DiskManager application, and -> rightclick on one drive -> change or remove drive letter -> Click remove drive letter button. Drive letter will be removed. Also the drive will be disappered from my computer.
But When we want the drive back as normal drive then we have to go to the same place same way. and you can see your drive again in my computer. add drive letter. all the data of the drive will be available as it is. Any way i will try in my ways, if i got solution i will share with you guys. Thanks.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|