Some experience records during summer Development

Source: Internet
Author: User
Tags ftp login

Jeremy Lin

1. GDI + settings

This is not an experience. It is mainly used in schools. Basically, it has never been used by GDI +. It is only necessary to use it after arriving at the company. Record the configuration process of GDI + for future reference.

(1) Add gdiplus. lib to the Project Properties> linker> Add Dependencies

(2) Add in stdfx. h

#include "gdiplus.h"using namespace Gdiplus;

(3) add two member variables to the xxxapp class

GdiplusStartupInput m_Gdistart;ULONG_PTR m_GdiplusToken;

(4) Add the initinstance () function in xxxapp

GdiplusStartup(&m_GdiplusToken, &m_Gdistart, NULL);

(5) add exitinstance () in xxxapp

GdiplusShutdown(m_GdiplusToken);


Ii. debugging experience

When a new variable is detected with vs2010, it should be deleted after the new variable is not used (not necessarily in the current block;


Today, I encountered a problem: An error occurred after the delete operation. The reason is that the new space is assigned to other variables. Therefore, an error occurs after the delete operation.


3. How to know the memory size to be released for free and delete

When malloc or new is used to allocate memory space, the actually allocated space is larger than the space applied by the programmer. A part of actually allocated memory space is used to save the size, verification, and other information of the allocated memory.


Free and delete

(1) When Delete releases space, it calls the corresponding object's destructor. When new allocates space, it also calls the object's constructor to initialize the object, use malloc to allocate only the memory;

(2) Before calling free, check whether the pointer to be released is null. If delete is used, no check is required;

(3) Free and delete cannot be mixed.


Differences between Delete and delete [] in C ++

(1) Objects of the basic data type do not have destructor. After a new array space is added, delete and delete [] can be used;

(2) However, for data types of class objects, only delete [] can be used;

Ref: http://www.cnblogs.com/charley_yang/archive/2010/12/08/1899982.html


Iv. Introduction to Linux debugging

I was not familiar with Linux before, but now I have to work hard at school.

(1) Python debugging tool winpdb in Linux, some commands

BP breakpoint under an address

BL lists existing breakpoint Information

BC removes the previously set breakpoint from the system

(2) debug python in GDB

GDB Python

Break function name

Run

L display the current Code

N next step

S Follow-up function

Print Output print content


GDB prints the string value

Print stringname. c_str ()


5. remote FTP login to Ubuntu

FTP: // usrname: [email protected]


5.7-9.5 Mt

Address: http://blog.csdn.net/linj_m/article/details/39322911

For more resources, please follow the blog linjm-Machine Vision Weibo: Lin Jianmin-Machine Vision


Some experience records during summer Development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.