Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Unwanted control characters in a CString Pin
David Crow4-Dec-07 16:43
David Crow4-Dec-07 16:43 
GeneralCalling CreateProcessAsUser from service on to Winsta0//winlogon desktop in Vista. Pin
Ronakkumar Patel4-Dec-07 9:18
Ronakkumar Patel4-Dec-07 9:18 
GeneralCImage and VC++ 6 Pin
RomTibi4-Dec-07 9:11
RomTibi4-Dec-07 9:11 
GeneralRe: CImage and VC++ 6 Pin
David Crow4-Dec-07 10:34
David Crow4-Dec-07 10:34 
GeneralRe: CImage and VC++ 6 Pin
Hamid_RT4-Dec-07 18:20
Hamid_RT4-Dec-07 18:20 
GeneralAdding WM_VSCROLL to message handler for slider control in VS 2005 with C++ and MFC Pin
GrizzlyDoug4-Dec-07 8:04
GrizzlyDoug4-Dec-07 8:04 
GeneralRe: Adding WM_VSCROLL to message handler for slider control in VS 2005 with C++ and MFC Pin
Mark Salsbery4-Dec-07 8:31
Mark Salsbery4-Dec-07 8:31 
GeneralGDI+ samples and malloc/free [modified] Pin
bob169724-Dec-07 7:16
bob169724-Dec-07 7:16 
In the MSDN source code for some GDI+ methods, the authors use malloc and free. Why would they do this if RectF is a class? Is this a hint that it is merely the equivalent to a struct with the ctor and dtor doing nada? Should we follow this convention or use new/delete instead?

Here's an example for GetRegionScans()...

VOID Example_GetRegionScansRect(HDC hdc)
{
   Graphics graphics(hdc);
   SolidBrush solidBrush(Color(255, 255, 0, 0));
   Pen pen(Color(255, 0, 0, 0));
   GraphicsPath path;
   Matrix matrix;
   Rect* rects = NULL;
   INT count = 0;  

   // Create a region from a path.
   path.AddEllipse(10, 10, 50, 300);
   Region pathRegion(&path);    
   graphics.FillRegion(&solidBrush, &pathRegion);

   // Get the rectangles.
   graphics.GetTransform(&matrix);
   count = pathRegion.GetRegionScansCount(&matrix);
   rects = (Rect*)malloc(count*sizeof(Rect));
   pathRegion.GetRegionScans(&matrix, rects, &count);  

   // Draw the rectangles.
   for(INT j = 0; j < count; ++j)
      graphics.DrawRectangle(&pen, rects[j]);

   free(rects);
}


modified on Tuesday, December 04, 2007 1:45:44 PM

GeneralRe: GDI+ samples and malloc/free Pin
David Crow4-Dec-07 7:22
David Crow4-Dec-07 7:22 
GeneralRe: GDI+ samples and malloc/free Pin
bob169724-Dec-07 7:41
bob169724-Dec-07 7:41 
GeneralRe: GDI+ samples and malloc/free Pin
DoomedOne4-Dec-07 9:20
DoomedOne4-Dec-07 9:20 
Questiondll using in VB or VC# Pin
kingday4-Dec-07 7:09
kingday4-Dec-07 7:09 
GeneralRe: dll using in VB or VC# Pin
CPallini4-Dec-07 9:22
mveCPallini4-Dec-07 9:22 
QuestionAlternatives to IExpress? Pin
chaiguy13374-Dec-07 5:44
chaiguy13374-Dec-07 5:44 
QuestionRe: 2D Tree Visualisation Pin
Lea Hayes4-Dec-07 3:14
Lea Hayes4-Dec-07 3:14 
GeneralRe: 2D Tree Visualisation Pin
Matthew Faithfull4-Dec-07 3:42
Matthew Faithfull4-Dec-07 3:42 
GeneralRe: 2D Tree Visualisation Pin
CPallini4-Dec-07 4:53
mveCPallini4-Dec-07 4:53 
GeneralRe: 2D Tree Visualisation Pin
zlike4-Dec-07 5:02
zlike4-Dec-07 5:02 
Generalcompile error about member variable initialization Pin
George_George4-Dec-07 2:49
George_George4-Dec-07 2:49 
GeneralRe: compile error about member variable initialization Pin
CPallini4-Dec-07 3:22
mveCPallini4-Dec-07 3:22 
JokeOff Topic Pin
toxcct4-Dec-07 5:37
toxcct4-Dec-07 5:37 
GeneralRe: Off Topic Pin
CPallini4-Dec-07 6:13
mveCPallini4-Dec-07 6:13 
JokeRe: Off Topic Pin
toxcct4-Dec-07 21:48
toxcct4-Dec-07 21:48 
GeneralRe: compile error about member variable initialization Pin
toxcct4-Dec-07 3:23
toxcct4-Dec-07 3:23 
GeneralRe: compile error about member variable initialization Pin
Matthew Faithfull4-Dec-07 3:33
Matthew Faithfull4-Dec-07 3:33 

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.