|
First of all you wont have that famouse window in the release build.
To catch all the errors and simple get out, you can do this.
put a try catch around the message pump, and in the catch terminate the program
Regards,
Prakash.
The World is getting smaller and so are the people.
|
|
|
|
|
Last summer we had similar problems.
Finally I bought the book "Debugging Applications for Microsoft .Net and Microsoft Windows", written by John Robbins. You should find this at Amazon.
Also take a look at the www.wintellect.com[^] website, the employer of John Robbins, a company specialized in debugging.
Also take a look at the CodeProject articles in the Debug Tips section (http://www.codeproject.com/debug/[^]). Some of the articles mention how to catch application crashes.
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
helloo
i want to get data from the http header or the packet like URL can u tell me about this that how can i get these things for the packet in ascii format i am already working on the Winpcap library i want this all in the c++ or vc using the api
best regards
|
|
|
|
|
|
An http requests of the client to the server may contain a request header and a request body (later only for POST requests). The response of the server to the client -almost- always consists of a response header and a response body.
What do you wanna get?
Peter Molnar
|
|
|
|
|
i want to get the request header from the packet and then the url so that i can open that very url request now can u tell me that how can i gewt the request header.from the client side.
du_aa
|
|
|
|
|
i want to get the request header from the packet and then the url so that i can open that very url request now can u tell me that how can i gewt the request header.from the client side.
du_aa
|
|
|
|
|
Are you on a server? Are requests being sent to your IP?
Then this is pretty easy: extract the request header from the begining of the data.
Peter Molnar
|
|
|
|
|
will u tell me plz that how can i get the request header from the begining of data what functions and api or coding will i use for it
regards
du_aa
|
|
|
|
|
Google for RFC 2616 and search MSDN for Windows Sockets
Peter Molnar
|
|
|
|
|
Hi,
I am loading a bmp file through LoadImage() and accessing the image data through GetBitmapBits().
Now i am saving the data as follows:
BITMAPFILEHEADER hdr;
LPBITMAPINFOHEADER lpbi;
CFile file;
if( !file.Open( the_filename, CFile::modeWrite|CFile::modeCreate) )
return FALSE;
lpbi = (LPBITMAPINFOHEADER)m_pFirstBuffer ;
lpbi->biBitCount=24;
int nColors = 1 << 24;
if(nColors> 256) nColors=0;
lpbi->biClrUsed=0;
lpbi->biSize=40;
lpbi->biHeight =(DWORD)bmp.bmHeight;
lpbi->biWidth=(DWORD)bmp.bmWidth ;
lpbi->biXPelsPerMeter =lpbi->biYPelsPerMeter =0;
lpbi->biClrImportant =0;
lpbi->biPlanes =1;
lpbi->biCompression =0;
lpbi->biSizeImage = bmp.bmHeight *bmp.bmWidthBytes ;
// Fill in the fields of the file header
hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM"
hdr.bfSize = (DWORD) (sizeof(BITMAPFILEHEADER) + lpbi->biSize + lpbi->biClrUsed* sizeof(RGBQUAD) + lpbi->biSizeImage);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
if (lpbi->biBitCount > 0 && lpbi->biBitCount <= 8)
{
hdr.bfOffBits = (DWORD)(sizeof(hdr) + lpbi->biSize +nColors * sizeof(RGBQUAD));
}
else
{
unsigned long cmapsize = 0;
switch (lpbi->biBitCount) {
case 16:
case 32:
if (lpbi->biCompression == BI_BITFIELDS) {
cmapsize = 3*sizeof(DWORD);
}
break;
case 24:
cmapsize = lpbi->biClrUsed*sizeof(RGBQUAD);
break;
default:
// no colormap
break;
}
hdr.bfOffBits = (DWORD)(sizeof(hdr) + lpbi->biSize + cmapsize);
}
// Write the file header
file.Write( &hdr, sizeof(hdr) );
// Write the DIB header and the bits
file.Write( lpbi, lpbi->biSize );
file.Write( m_pFirstBuffer, bmp.bmHeight *bmp.bmWidthBytes );
file.Close ();
Now i could open the saved file in Windows Paint application but if i call LoadImage() with that file name as parameter it returns NULL. GetLastError() is zero.
Could anyone tell me where i am wrong?
Regards
Neha
|
|
|
|
|
Hi Neha,
Actually , While saving the BITMAP u converted it into Device independent Bitmap.and LoadImage API cannot load DIB's , it can load only icon, cursor, animated cursor, or bitmap or OEM Bitmaps.
If u want to display this Bitmap, then u have to read the file by your own code ,get the BMP data in a buffer prepare headers, and u can use
APIs like DrawDibDraw to draw ur image
Regards
Abhishek
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
I think you got confussed.
I am using GetBitmapBits() it returns device dependent bitmap. In LoadImage() i am setting LOADFROMFILE. this will returns us the HBITMAP.I mean to say the value returned from LoadImage() ie HBITMAP is NULL.
|
|
|
|
|
// Write the DIB header and the bits
file.Write( lpbi, lpbi->biSize );
check these above line of ur code
In ur Submitted code , u have created this DIB header,
Which states that the BMP u created is DIB,and let me know if u the file extension is .bmp then that means u have created an DIB image , thats why LoadImage fails.
Check few artilces for .bmp files , u can see these Windows supported Picture files are Device independent.
Even if u used the GetBitmapBits , but while saving u converted it into DIB
Regards
Abhishek
http://www.prepressure.com/formats/bmp/fileformat.htm
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
My file extension is .DIB not .bmp.
It works for some images but for some images it doesn't.
|
|
|
|
|
Well the extension doe'snt matter,
what i think is that u r saving it as DIB
and even ur extension says it is a DIB ....
try to read it as a DIB image may be it will solve ur issue!!
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
Yes, I am wrong.
Could you please tell me how to save the DDB data?
I need to use the DDB format because DIB takes DWORD.
|
|
|
|
|
hello
i want to convert hexa data to ascii or the string format in vc can u tell me any thing for this
regards
|
|
|
|
|
long x=0x2d13a54f;
char buf[1024];
sprintf(buf,"%x",x);
after run
buf=="2d13a54f"
|
|
|
|
|
Simple and sweet answer
The World is getting smaller and so are the people.
|
|
|
|
|
In VC, on the Window Menu, there are a couple of options, Next Window, Previous Window, and Close All. I have been trying to figure out how they do that, and have search through hundreds of project files and came to this conclution. Almost No One uses the Close All function.
Welp, I must be dumb, but I can't figure out how they do that. Anyone here know how?
LOSTTWARE.com
|
|
|
|
|
ummmmm by iterating thru the doc-template docs and views?
"there is no spoon" biz stuff about me
|
|
|
|
|
I know that, I have tried fifty different things, I just keep getting the code wrong. I was currious if any one knew of an example project, that had it, or just new the code for it.
LOSTTWARE.com
|
|
|
|
|
try GetFirstDocTemplatePosition() and all the associated functions for the template itteration
then GetFirstDocPosition() for the actual docs in a particular template
go from there
its really only 10 lines of code
"there is no spoon" biz stuff about me
|
|
|
|
|
How can add a new line of characters in the Edit Box control?
shenthil ( senthilkkumar@rediffmail.com)
|
|
|
|