|
thanks for your input. I'm very greatful.
|
|
|
|
|
I have completed a very important project. I did in VC++ and uploaded to Linux server. After then, I have re-compiled my work (without errors) and run it. It wrotes Segmentation fault, but when i checked output file it is actually the one that i have intended to have. Code uses dynamic memory allocation, file read and write, and 9 nestled for loops. Moreover I have uploaded two more projects and they were working without giving the segmentation fault. Another interesting subject about the code is that it writes values to the file at the end.
If you have experienced something like this please send your comments.
Deadline for the project is by tommorrow night (15th April). However comments after that time will still be useful.
May the bug killer be with you...
Cem Kalyoncu
|
|
|
|
|
Sorry, but 99.999999% of the time, the problem is with your code, not with the compiler.
And without seeing the code, we can't have a clue about why it's failing...
I see dumb people
|
|
|
|
|
... are you trying to run a Win32 executable on a linux OS ? ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
no.. I have recompiled it using g++.
May the bug killer be with you...
Cem Kalyoncu
|
|
|
|
|
ok ... so ... probable errors, bad initializations of variable, bad allocation, bad error checking ...
be sure to initialize everything, check all pointers, ... and build in debug and trace on linux ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Unix 'segmentation fault' is much the same as Windows' 'access violation'. It's caused by trying to read or write through a bad pointer, or by trying to jump to a bad location.
Usually this means that you're trying to read or write off the end of a buffer, or you're not checking the return value of one or more functions for errors before using that value (where the function returns a pointer, e.g. fopen ). It can also be an uninitialised pointer.
Jumping to a bad location is much harder and usually requires an uninitialised function pointer.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks for all,
The answer is actually trying to access out of bounds of a variable - it should give access violation but in Windows it allocates a litle more space then you have requested (duplicates of four i guess). the proplem is with the read routine that seems nearly perfect, I found the error when I tried to free the variable. It actually gave me error at that time (before I forgot to free them ). It is very interesting not to get an error on Windows.
As Mike said it is actually Access Violation.
Thanks for all
May the bug killer be with you...
Cem Kalyoncu
|
|
|
|
|
is there any notification for system datechange ???
|
|
|
|
|
To find out your answer, I ran notepad, and parked it in a corner of the screen. I then ran Spy++
(from VC Tools menu) and monitored all messages to the notepad's top level window. When I changed
the date / time, windows broadcasts a WM_TIMECHANGE message...
To quote:
Windows 2000/XP: An application should not broadcast this message, because the system will broadcast this message when the application changes the system time.
Iain.
|
|
|
|
|
will this message be generaten whenever day changes normally. ie at midnight...
|
|
|
|
|
Anonymous wrote:
will this message be generaten whenever day changes normally. ie at midnight...
Uh, no. But you could always set a timer with a slow interval (e.g. every five minutes), and monitor
the date. If it changes between WM_TIMER messages, do your thing, else return.
OR
Use CreateWaitableTimer / SetWaitableTimer / WaitForMultipleEvents in a separate thread.
OR
I'm sure XP has a way of asking it to run your program at set times, but I can't remember it.
OR
A long list of other alternatives.
Iain.
|
|
|
|
|
...hi...
for a longer time I am looking unavailingly for a method to read out a directory with all files with an explicit extension.
can anybody help?!
thx.... tito
|
|
|
|
|
You can use the MFC class CFileFind , or the Win32 functions it wraps: ::FindFirstFile , ::FindNextFile
and ::FindClose .
Good luck!
Iain.
|
|
|
|
|
I'm trying to create a rounded box button (sorry bout my lack of knowledge bout MFC) and I followed this tutorial in creating a ownerdrawn button.
The results looks great but there's only one flaw, even my button is now not a box, on each corner of the button there's always a white/gray space to fill the area of a box.
I think is because the button area is always a box and it looks bad if I place my button on top of image/color. How can I eliminate the those spaces in the corner of my button.
Thkx
|
|
|
|
|
|
Hi
I am currently trying to display an image stored in memory to the screen. I store the image data (i.e. the pixel intensity values, obtained after some computation) in an array in the memory. Could someone tell me how I can display it?
I understand I can loop the SetPixel method of CPaintDC, but I noticed that it is quite slow, and the image appears not all at once. Can I use BitBlt to accomplish this?
|
|
|
|
|
You can construct dib and then use to paint the image on the screen.
|
|
|
|
|
If you look at the functions CBitmap::CreateBitmap , or ::CreateBitmap , you'll notice that the last
value can take a pointer to initial values. Just select this into a DC, and BitBlt / StretchBlt .
OR, if you will be changing the values, you'll need to look up StretchDIBits . This is a harder
function to use, but more flexible.
You should find examples on their use in MSDN.
Good luck,
Iain.
|
|
|
|
|
hello all,
as i required to add a toolbar to IE from my application, i had downloaded kbbar.exe from microsoft site as said in the documentation (CP) . But i didnt understand how to use this dll and from where i can add my own toolbar.
Plz help me, i will be greatfull to u.
ComputerNewton
|
|
|
|
|
The codeproject IE bar comes with source code as I remember. From my about box,
Programming: Michael Dunn.
IE Toolbar Wizard: Erik Thomson.
Searching for the articles by these two stellar chaps should help a lot.
Iain.
ps. The CP Bar is a worthwhile download in itself.
|
|
|
|
|
may i have the link to it plz
ComputerNewton
|
|
|
|
|
Don't be so !
Just under is a search box. Type "Michael Dunn" into it. Select "Authors", and press GO.
You'll get a long list. On the second page is his "Search Bar" article. On further inspection,
he doesn't include source code. But in the acknowledgements is a pointer to Erik Thompson's
"DeskBand ATL Object Wizard" article.
Go there, read, download, learn, enjoy!
Iain.
|
|
|
|
|
Thank u very much. i had found it. but only the dll and .exe but not how to do it.
ComputerNewton
|
|
|
|
|
If you use Erik Thompson's article, and download his wizard, he gives instructions on how to use use /
install it.
You can then make a new ATL project and add a IDeskBar object. All this is in his article. I've done
so and I now have my name in big letters in an band next to my explorer menu. What you put into the
band is up to you.
Iain.
|
|
|
|