Brett, here is the code chunk in the Shape plugin object that I believe you suggest we check out (adjust) to get started with (as an example) with creating our own plugins. I understand this is not officially supported content, I am just hoping you have a minute to share a bit more information so I can get a grasp on how to approach learning plugin creation in C++.
Here's the code chunk:
I plan on working on this code chunk specifically to understand each part, to start with. But, any insight on what we are looking at to change first, to make our own plugin would be greatly appreciated. I am sure a few others here will agree when I say I appreciate your time and patience with me on this topic.
Here's the code chunk:
Code:
void CShapeObject::DrawShape(HDC hDC, HWND hMainWnd, RECT rcObRect,BOOL bVisible,BOOL bEnabled) { if(!bVisible) return; //CBrush brushFill; HBRUSH brushFill; HBRUSH brushOld; HPEN penStroke; HPEN penOld; if(m_nFillMode == modeSolid) { brushFill = CreateSolidBrush(m_crFillColor); //brushFill.CreateSolidBrush(m_crFillColor); } else { brushFill = (HBRUSH) GetStockObject(NULL_BRUSH); //brushFill.CreateStockObject(NULL_BRUSH); } if(m_nStrokeMode == modeSolid) { penStroke = CreatePen(PS_SOLID,m_nStrokeWidth,m_crStrokeColor); //penStroke.CreatePen(PS_SOLID,m_nStrokeWidth,m_crStrokeColor); } else { penStroke = CreatePen(PS_NULL,m_nStrokeWidth,m_crStrokeColor); //penStroke.CreatePen(PS_NULL,m_nStrokeWidth,m_crStrokeColor); } brushOld = (HBRUSH)SelectObject(hDC,brushFill); penOld = (HPEN)SelectObject(hDC,penStroke); switch(m_nType) { case typeElipse: Ellipse(hDC,rcObRect.left,rcObRect.top,rcObRect.right,rcObRect.bottom); break; case typeRectangle: Rectangle(hDC,rcObRect.left,rcObRect.top,rcObRect.right,rcObRect.bottom); break; case typeRoundedRect: RoundRect(hDC,rcObRect.left,rcObRect.top,rcObRect.right,rcObRect.bottom,m_nCornerWidth,m_nCornerHeight); break; } SelectObject(hDC,brushOld); SelectObject(hDC,penOld); DeleteObject(brushFill); DeleteObject(penStroke); }
Comment