Click here to Skip to main content
15,887,334 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WM_GETTEXT does not returns data from Grid Control of external application Pin
Richard MacCutchan7-Mar-14 5:54
mveRichard MacCutchan7-Mar-14 5:54 
QuestionAuto align of toolbar by frame width Pin
akhil_sudheesh6-Mar-14 19:44
akhil_sudheesh6-Mar-14 19:44 
AnswerRe: Auto align of toolbar by frame width Pin
Rage12-Mar-14 22:15
professionalRage12-Mar-14 22:15 
GeneralRe: Auto align of toolbar by frame width Pin
akhil_sudheesh13-Mar-14 19:55
akhil_sudheesh13-Mar-14 19:55 
AnswerRe: Auto align of toolbar by frame width Pin
Rage14-Mar-14 0:07
professionalRage14-Mar-14 0:07 
AnswerRe: Auto align of toolbar by frame width Pin
Rage14-Mar-14 0:15
professionalRage14-Mar-14 0:15 
GeneralRe: Auto align of toolbar by frame width Pin
akhil_sudheesh16-Mar-14 21:29
akhil_sudheesh16-Mar-14 21:29 
Questionstd::shared_ptr causing C4150 warning even if custom deleter is used in Visual C++ 2012 [Solved] Pin
Elerian6-Mar-14 10:17
Elerian6-Mar-14 10:17 
Hello everybody,

I am playing with LibSDL and tried to use smart pointers for some of the objects created by the Library (i.E. SDL_CreateWindow returns a SDL_Window* which I would like to put into a std::shared_ptr<sdl_window>). For the rest of the post I will simple refer to SDL_Window but the same applies to other SDL objects.

The SDL_Window structure in the SDL header is a forward declaration for a simple structure without a destructor (plain old data) but there is a function called SDL_DestroyWindow which destroyes the SDL_Window and frees the allocated memory.

I use the following code to declare and initialize my smart pointer:
std::shared_ptr<SDL_Window> window( 
  SDL_CreateWindow( "Title", 0, 0, 640, 480, SDL_WINDOW_SHOWN ),
  SDL_DestroyWindow 
);


Now if I assign a nullptr to the initialized shared_ptr I get warning C4150 for deleting a pointer to the undefined or incomplete type SDL_Window but the SDL_DestroyWindow function gets called.

Am I doing something wrong or will I have to ignore this warning?

Thank you for your help,
Andreas

modified 7-Mar-14 14:40pm.

AnswerRe: std::shared_ptr causing C4150 warning even if custom deleter is used in Visual C++ 2012 Pin
«_Superman_»6-Mar-14 14:24
professional«_Superman_»6-Mar-14 14:24 
GeneralRe: std::shared_ptr causing C4150 warning even if custom deleter is used in Visual C++ 2012 Pin
Elerian7-Mar-14 8:10
Elerian7-Mar-14 8:10 
AnswerRe: std::shared_ptr causing C4150 warning even if custom deleter is used in Visual C++ 2012 Pin
Elerian7-Mar-14 8:20
Elerian7-Mar-14 8:20 
QuestionThe destructor of MFC application [Solved] Pin
econy6-Mar-14 7:02
econy6-Mar-14 7:02 
AnswerRe: The destructor of MFC application Pin
David Crow6-Mar-14 7:09
David Crow6-Mar-14 7:09 
GeneralRe: The destructor of MFC application Pin
econy6-Mar-14 8:41
econy6-Mar-14 8:41 
GeneralRe: The destructor of MFC application Pin
jeron16-Mar-14 9:15
jeron16-Mar-14 9:15 
GeneralRe: The destructor of MFC application Pin
econy6-Mar-14 10:14
econy6-Mar-14 10:14 
GeneralRe: The destructor of MFC application Pin
jeron16-Mar-14 10:50
jeron16-Mar-14 10:50 
AnswerRe: The destructor of MFC application Pin
«_Superman_»6-Mar-14 14:30
professional«_Superman_»6-Mar-14 14:30 
GeneralRe: The destructor of MFC application Pin
econy7-Mar-14 5:15
econy7-Mar-14 5:15 
Questionso confused. Should I learn Android development? if so, where should I start? Pin
Falconapollo6-Mar-14 4:51
Falconapollo6-Mar-14 4:51 
AnswerRe: so confused. Should I learn Android development? if so, where should I start? Pin
Orjan Westin6-Mar-14 5:36
professionalOrjan Westin6-Mar-14 5:36 
GeneralRe: so confused. Should I learn Android development? if so, where should I start? Pin
Falconapollo6-Mar-14 14:44
Falconapollo6-Mar-14 14:44 
AnswerRe: so confused. Should I learn Android development? if so, where should I start? Pin
David Crow6-Mar-14 7:19
David Crow6-Mar-14 7:19 
GeneralRe: so confused. Should I learn Android development? if so, where should I start? Pin
Falconapollo6-Mar-14 14:45
Falconapollo6-Mar-14 14:45 
AnswerRe: so confused. Should I learn Android development? if so, where should I start? Pin
charlieg6-Mar-14 15:15
charlieg6-Mar-14 15:15 

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.