Learn how to a build a cloud-first strategyRegister Now


Error passing PaintEventArgs to functions

Posted on 2006-04-20
Medium Priority
Last Modified: 2012-06-21
My program captures a Paint event then passes the PaintEventArg to several graphics functions to perform various drawing tasks. When I only use one function, the program works. As soon as I try to string more than one function together in the calling function, I get a run time error stating "Invalid Parameter Used". Here is a code sample:


void drawPart1(PaintEventArgs * e);
void drawPart2(PaintEventArgs * e);
private: System::Void tabPage1_Paint(System::Object *  sender, System::Windows::Forms::PaintEventArgs *  e)
        drawPart1(e);  //works fine when this is the only call
        drawPart2(e);  //crashes when I include this one

void graphicForm::drawPart1(PaintEventArgs * e)
      graphics* pg = e->graphics;

void graphicForm::drawPart2(PaintEventArgs * e)
      graphics* pg = e->graphics;

Any ideas as to what is wrong?

Question by:restabro
1 Comment
LVL 48

Accepted Solution

AlexFM earned 1000 total points
ID: 16504797
I don't see any problem in this code, possibly it is somewhere in etc. part.
Does drawPart2 work when called without drawPart1 ?

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question