 |

|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|

|
Hi, am building a GUI MFC application, I have several toolbars in my application, i want my toolbars to auto align according to my application frame width, the code i have been tried is given below. By this code the toolbar is simply align in a single row. what should i do to reach my goal? thanks in advance
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
tb1.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
tb4.EnableDocking(CBRS_ALIGN_ANY);
tb8.EnableDocking(CBRS_ALIGN_ANY);
tb9.EnableDocking(CBRS_ALIGN_ANY);
tb2.EnableDocking(CBRS_ALIGN_ANY);
tb3.EnableDocking(CBRS_ALIGN_ANY);
tb6.EnableDocking(CBRS_ALIGN_ANY);
tb7.EnableDocki:confused:ng(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&tb9);
DockPaneLeftOf(&tb8, &tb9);
DockPaneLeftOf(&tb4, &tb8);
DockPaneLeftOf(&m_wndToolBar, &tb4);
DockPaneLeftOf(&tb1, &m_wndToolBar);
DockPaneLeftOf(&tb7, &tb1);
DockPaneLeftOf(&tb6, &tb7);
DockPaneLeftOf(&tb3, &tb6);
DockPaneLeftOf(&tb2, &tb3);
A learner
|
|
|
|

|
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). 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
|
|
|
|

|
The warning is probably because of the forward declaration.
Look at the documentation - Compiler Warning (level 2) C4150[^]
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|

|
Hi, in a modal dialog based MFC application, I use addFontResource() function to load font resource in application's InitInstance().
I want to use this font in all life of application.
when application ends, then release the font resource.
But I can't find the destructor of the modal dialog based MFC application, do I need to write it myself?
modified 14 hrs ago.
|
|
|
|

|
See ExitInstance() .
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|

|
It's a dialog based application, can't find ExitInstance()
|
|
|
|

|
Override it, easiest done with the class wizard.
|
|
|
|

|
is that means CDialog class has a ExitInstance() member function? inherited from ,maybe a parent class.
I will check thhat
|
|
|
|
 |
|