Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to create a user name and password for a database ? Pin
Alexander M.,23-Jul-03 2:03
Alexander M.,23-Jul-03 2:03 
QuestionHow to prevent binding a Type library to a ATL Attributed DLL ? need help ! Pin
talhalfon22-Jul-03 21:26
talhalfon22-Jul-03 21:26 
GeneralQuestion about file descriptor. Pin
George222-Jul-03 21:24
George222-Jul-03 21:24 
GeneralRe: Question about file descriptor. Pin
Ryan Binns22-Jul-03 23:34
Ryan Binns22-Jul-03 23:34 
GeneralRe: Question about file descriptor. Pin
George223-Jul-03 0:20
George223-Jul-03 0:20 
GeneralRe: Question about file descriptor. Pin
Ryan Binns23-Jul-03 4:17
Ryan Binns23-Jul-03 4:17 
GeneralRe: Question about file descriptor. Pin
George224-Jul-03 2:48
George224-Jul-03 2:48 
QuestionGDI+ in ATL ActiveX control??? Pin
denkor22-Jul-03 20:41
denkor22-Jul-03 20:41 
Hi, all.
I'm now working with an Atl ActiveX control which displays various of shapes such as lines and circles.
GDI+ seems to be a good choice for drawing.
however,can GDI+ be used in ATL ?
I mean ,does anyone know where to put 'GdiplusStartup' and 'GdiplusShutdown'?
I've tried to put then in 'OnCreate' and 'OnDestroy' like this:
class ATL_NO_VTABLE Catlgdiptest :
public CComObjectRootEx<ccomsinglethreadmodel>,
...
{
...
public:
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// GdiPlus
GdiplusStartupInput gdiplusstartupinput;
GdiplusStartup (&m_gdiplustoken, &gdiplusstartupinput, NULL);
return 0;
}
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
// GdiPlus
GdiplusShutdown(m_gdiplustoken);
return 0;
}

HRESULT OnDraw(ATL_DRAWINFO& di)
{
RECT& rc = *(RECT*)di.prcBounds;
Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
Graphics graphics(di.hdcDraw);
Pen pen(Color(255, 0, 0, 255));
graphics.DrawLine(&pen, rc.left, rc.top, rc.right, rc.bottom);
return S_OK;
}
...
};

But it doesn't work--the control draws nothing than a rectangle.

Is there any idea about it?
It's great to give any hint!
GeneralFocus Pin
Valeria Bogdevich22-Jul-03 20:17
Valeria Bogdevich22-Jul-03 20:17 
GeneralRe: Focus Pin
Toni7822-Jul-03 20:25
Toni7822-Jul-03 20:25 
GeneralRe: Focus Pin
Toni7822-Jul-03 22:54
Toni7822-Jul-03 22:54 
GeneralRe: Focus Pin
Valeria Bogdevich23-Jul-03 1:42
Valeria Bogdevich23-Jul-03 1:42 
GeneralRe: Focus Pin
Toni7823-Jul-03 1:47
Toni7823-Jul-03 1:47 
GeneralRe: Focus Pin
Ryan Binns22-Jul-03 23:39
Ryan Binns22-Jul-03 23:39 
GeneralRe: Focus Pin
Ryan Binns23-Jul-03 0:23
Ryan Binns23-Jul-03 0:23 
GeneralRe: Focus Pin
Valeria Bogdevich23-Jul-03 1:29
Valeria Bogdevich23-Jul-03 1:29 
GeneralRe: Focus Pin
Toni7823-Jul-03 1:49
Toni7823-Jul-03 1:49 
GeneralRe: Focus Pin
Ryan Binns23-Jul-03 3:56
Ryan Binns23-Jul-03 3:56 
GeneralRe: Focus Pin
KaЯl22-Jul-03 22:32
KaЯl22-Jul-03 22:32 
GeneralRe: Focus Pin
KaЯl23-Jul-03 2:13
KaЯl23-Jul-03 2:13 
GeneralRe: Focus Pin
KaЯl23-Jul-03 5:30
KaЯl23-Jul-03 5:30 
GeneralRe: Focus Pin
KaЯl23-Jul-03 5:37
KaЯl23-Jul-03 5:37 
GeneralDLL and Static Library Doubt Pin
Richard Lewis22-Jul-03 19:57
Richard Lewis22-Jul-03 19:57 
GeneralRe: DLL and Static Library Doubt Pin
Toni7822-Jul-03 20:19
Toni7822-Jul-03 20:19 
GeneralRe: DLL and Static Library Doubt Pin
Richard Lewis22-Jul-03 22:30
Richard Lewis22-Jul-03 22:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.