always use memset on the structures

never leave a structure with unfilled values, for example:

BROWSEINFO bi;
SHBrowseForFolder(&bi);

in order to avoid this, a good practice would be one of these:

- remember to always initialize members we don't need:
bi.hwndOwner = NULL;

- just initialize the variabile:
BROWSEINFO bi = { 0 };

- use memset on the structure:
memset(bi, 0, sizeof(BRWOSEINFO));

Comments

Popular posts from this blog

Xamarin.Forms XmlnsDefinition attribute: All of your namespaces become one

Problems