|
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
|
|
|
|
|
I'm calling the Win32 api function SHBrowseForFolder to display a Browse folder dialog. It allows a callback fn to be specified. Can anybody tell me, using the hwmd supplied in the callback is it possible to access the dialog's device context. Can this be done with Subclassing.
Thanks for reading
John
|
|
|
|
|
I have never used this function before, but does the HWND represent the dialog or the owner of the dialog. Anyway, you can always call GetDC to get the DC of a window. The thing that you will need to worry about is if that handle is the dialog or not. If that handle is the parent of the dialog, you can always enumerate through the windows to get your dialog handle, or cache a handle somewhere.
Checkout my Guide to Win32 Paint for Intermediates
|
|
|
|
|
I´m developing a program and I need a class for CtreeCtrl, with multiple selection of items and Drag and Drop of them between two CTreeCtrls(or Ctreeview).
Thanks in advance.
Using Visual C++ 6.0.
Windows 2000.
|
|
|
|
|
Is it possible to add a toolbar to a modal dialog?
I tried, but ended up with assertion errors, was just wondering if it can be done!
Thanx
funbag!
skydiving....if at first you don't succeed, you're fecked!
|
|
|
|
|
In theory, no, but I believe in practise it is possible to hack a solution, so long as you don't want them to float.
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
|
|
|
|
|
Hi,
We have a big monolitic ( ), project, that takes half an hour to compile ( Scassi HD, and 500 Mb. Memory), we don´t have time to chop it into smaller pieces ( now it´s not the time for that )...
... But we have like three more computers free, so would it be possible to send to that computers a bunch of files, and that machines could compile them ? ( so if I have 400 files I could compile 50 here, 50 there, 50..., in paralel).
Does can be done on VStudio 6.0 ? And .net ? ... or that´s to good to be true ?
Thanks in advance, Greetings
Braulio
|
|
|
|
|
Hi
i got a serious Problem with the Blocking Sockets Part of WinSock2.
A Java Applet is connecting to my TCP/IP Server (written in C++) - and now they are talking... and it works - ... but everytime the Java Applet sends a Message to the C++ the LAST BYTE doesn´t arrive. Its there when the next message is sent from the Applet - but until then.... no LAST BYTE....
does anybody know how to workaround - or WHY the H**** this is occuring ?
Daniel
|
|
|
|
|
Do you have more information? What protocol do you use on your socket? HTTP, FTP, in-house?
If the protocol you use specifies in its header the number of incoming bytes, make sure you don't miscalculate.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|