|
Perhaps you could give more details about the errors... for example what does the compiler say? Linker error?
-Dominik
|
|
|
|
|
the problem happen when I press Go Button the program, i got the following message:
Unhandled exception in file.exe: 0xC0000005: Access Violation
Best Regards
|
|
|
|
|
This probably has to do with initialization. You are most likely referring to an object that has not yet been initialized. Try to step through your code instead of using GO and determine which statement results in the error.
Good luck
|
|
|
|
|
The error code as follow:
First-chance exception in 日记.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
How can I solute it?
Don't look at me in that way!
|
|
|
|
|
white jungle wrote:
How can I solute it?
A two fingered salute works for me
Seriously, how do you expect anyone to solve your problem ? Did you get this error running your own code ? If so, why didn't you post some code to show where it crashes ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I debug the project!
And I haven't set any break point! So I don't know where throw the wrong code!
And the error code was put out in the output window,And the programsalon hadn't been stoped .So I can't find where the error occured!
If I post My code,Oh,My God!I can't Image!
Don't look at me in that way!
|
|
|
|
|
First, has the program crashed, or are you just seeing a First-chance exception in the output window?
When you are running a program in the debugger that throws exceptions, you will see a First-chance exception in the output window whenever the program throws an exception. This doesn't mean that anything is wrong. The debugger shows you this to tell you that an exception was thrown. The default action then is for the debugger to pass the exception on to the program. If the program has a catch handler for the exception, it then processes it and the program continues to run.
Some parts of the run-time library use exceptions as part of their normal execution. As long as the program is working properly, I wouldn't worry too much about it.
The debugger also allows you to change the default action for exceptions to stop when an exception occurs (rather than only stopping if the exception is not handled). This is available under the "Debug" menu, as the sub-menu choice "Exceptions...". I wouldn't normally change these settings.
Best regards,
John
|
|
|
|
|
white jungle wrote:
If I post My code,Oh,My God!I can't Image!
Then don't bother asking for help - no-one can help you without seeing the code.
You can also sprinkle your program with message boxes as another way to find where the error is, or even better, with TRACE statements, which output to the debug window when you run in debug mode.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Look at the stack window. This will tell you which function the exception occurred in. Then look at all of the functions below the stack to see if you can find any thing that has invalid data.
This should get you started.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
with this message, when I compile my soft, he can't recognize my members variable from a class.
How can I do for recognize it ?
Best Regards
youssef
|
|
|
|
|
Are you talking about in debug? Well, /OPT:REF is usually found with release mode builds and thus you wouldn't have any debug information by default.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Can someone please help me, I'm trying to edit the poperties of an exe file. Right clicking the icon only brings up the general properties and not the other tabs. I want toget the program tab up so I change the path name. And there is also a check box for ms dos programs "Exit after Run" I want to uncheck that.
|
|
|
|
|
You want to edit the path name of an executable ? To change the path, you need to cut and paste the file.
Klara wrote:
And there is also a check box for ms dos programs "Exit after Run" I want to uncheck that.
Where have you seen this dialog ? If you want a program to wait for you after it finishes running, you'll need to put in the code to wait for a keypress. As I've said already, I can't help you because I only know how to do that in C++, that is, using iostreams.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Christian wrote:
Where have you seen this dialog ?
When you right click on an icon of an exeyou can select the properties. There are several tabs usually and the second one concerns the program. For my exe I only see the general properties..file size etc.
Anyway thanks for your help.
|
|
|
|
|
I've worked it out - you want the tab you get for a shortcut, and it allows you to set the directory that it links to. Like I said, you can't change the folder of an exe, except by moving it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
i am writing a Drawing program, i use Layers in it
how should i do if i want to erase some parts of current layer and leave
other layers without changing, which means their graphics still show as
before. i want to do as the Flash's eraser.
thank u for help
BTW: i used CTypedPtrArray to store every layer
|
|
|
|
|
rainfallc wrote:
how should i do if i want to erase some parts of current layer and leave
other layers without changing, which means their graphics still show as
before. i want to do as the Flash's eraser.
You need to impliment some degree of transparency between layers ( obviously, or you'll only see the top layer ). I'm told GDI+ actually draws using the alpha layer, so you could try that, it certainly supports colour keying at least. The Intel image processing library was what I used to write a paint program with layers, it also supports tiled images beyond what is physically possible for a Windows bitmap.
rainfallc wrote:
BTW: i used CTypedPtrArray to store every layer
What are you storing pointers of ? If they are CBitmaps, you're going about it all wrong. They need to be DIBSections ( or GDI+ Bitmaps). I'd also recommend vector over dodgy MFC containers, or list or set if you want to be able to swap layers around.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
i use CTypedPtrArray to store layers, each layer is a CTypedPtrList,
and i don`t store CBitmap in layer , i make a abstract class CShape, change the IMPLEMENT_SERIAL macro to support Serailize( i need Serialize), and derive CStroke , CRectangle and so on from it, and store them in the layers.
Could u give me some more advices?
i am not familiar with DIBSections , so could u show me some codes?
thank u for your reply
|
|
|
|
|
Ah, it's a DRAWING package ? You have one image, and you keep track of all the things you draw on it ? A DIBSection is like a CBitmap/HBITMPA, but it can be any bit depth, regardless of the screen depth.
Are you using GDI+ ? How are you drawing the shapes ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
i don`t use GDI+,
the way i draw the shapes is that i offer a virtual function called Draw and pass the CDC* as the argument, then in the view, i rewrite the OnLButtonDown
,OnLButtonUp, OnMoveMove, to change the shapes` shape( there is another virtual function to change each shapes` member variables),
then in the view`s WM_PAINT message, i draw the shapes into a bitmap , then bitblt to the screen, i used another CArray to keep track of which layer is hiding.
please give me more hints
do u mean use GDI+ is more eaiser than GDI to solve these kinds of problems?
thank u for help
|
|
|
|
|
So to recap:
you have an array of layers. Each layer has an array of pointers to a base class. Your WM_PAINT steps through these arrays in order and draws everything again to a CBitmap, then to the screen.
rainfallc wrote:
i used another CArray to keep track of which layer is hiding.
Why not make a layer class that has a hidden property and holds all the things you are drawing, if you're doing it that way ? You're risking fragmentation between different aspects of what should be the same data.
rainfallc wrote:
please give me more hints
OK.
1/ If you don't need W95 support, use GDI+. It's the easiest way to do layering
2/ Don't use CBitmap, because when you come to save & load images, you'll only be able to deal with images the same bit depth as your screen. Use GDI+::Bitmap, which has the advantange of letting you load and save a ton of formats as well.
3/ Don't draw everything to the screen every time, unless you want to be able to reselect items you have previously drawn to edit/move/delete them. If you're trying to write a drawing package, you're stuck with this, but I'd still impliment suggestion 4, and redraw a layer using your array only when you want to select/delete something
4/ Make a vector of layer objects, a class that encapsulates the bitmap that represents the layer ( which has it's alpha channel set so that it can be drawn on top of lower layers correctly ), the objects in the layer if you want to select them, if the layer is to be drawn or not, etc.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
thanks for reply
i create a tool class called Eraser,
now i show three layers on the screen, the topmost one i am editing,
i draw a line on it, i want to ERASE someparts of the line, but those parts
are inside the lower layers`s shapes` region.
How could i set the Eraser`s mode , which just delete the current layers` content,.after i release the mouse button, lower layers show as before, but current layer`s image has changed?
u said:
Make a vector of layer objects, a class that encapsulates the bitmap that represents the layer ( which has it's alpha channel set so that it can be drawn on top of lower layers correctly )
could u offer a short program for the suggestion above? do u mean to draw a bitmap with its alpha channel set on other layers` images?
thanks again
|
|
|
|
|
rainfallc wrote:
How could i set the Eraser`s mode , which just delete the current layers` content,.after i release the mouse button, lower layers show as before, but current layer`s image has changed?
By erasing by reseting the alpha channel in just the layer you are drawing on. Making an eraser would seem to suggest you'd be better not keeping track of individual shapes, but just bitmaps. It's not going to take long for your paint method to groan under the strain of rerendering all this stuff.
rainfallc wrote:
u said:
Make a vector of layer objects, a class that encapsulates the bitmap that represents the layer ( which has it's alpha channel set so that it can be drawn on top of lower layers correctly )
could u offer a short program for the suggestion above? do u mean to draw a bitmap with its alpha channel set on other layers` images?
thanks again
A short program ? No. Which part do you need help with ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
oh i see, thanks very much,
if i have any more questions , please offer the help again
|
|
|
|
|
Always glad to help - just try to impliment what I've suggested and ask when you get stuck. I've also written a GDI+ paint program called Doodle on CP, which may help you get started in GDI+.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|