{"id":26923,"date":"2007-05-09T10:00:00","date_gmt":"2007-05-09T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2007\/05\/09\/dont-be-helpless-at-least-look-at-the-function-youre-using\/"},"modified":"2007-05-09T10:00:00","modified_gmt":"2007-05-09T10:00:00","slug":"dont-be-helpless-at-least-look-at-the-function-youre-using","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20070509-00\/?p=26923","title":{"rendered":"Don&#039;t be helpless: At least look at the function you&#039;re using"},"content":{"rendered":"<p>\nSometimes I see people ask a question and get an answer,\nbut the answer doesn&#8217;t quite work.\nBut instead of trying to understand the answer in order to see why\nit doesn&#8217;t work and develop a better solution, they just play stupid.\nHere&#8217;s an example.\nThe names have been changed but the story&#8217;s the same.\n<\/p>\n<blockquote CLASS=\"m\"><p>\nHow do I get a handle to a bright pink elephant?\nWe have a dialog box that talks about elephants, and we&#8217;d like to\nput some information about the bright pink ones on it.\n<\/p><\/blockquote>\n<p>\nAn answer came back rather quickly.\n<\/p>\n<blockquote CLASS=\"m\"><p>\nUse <code>GetElephantHandle(EPHNT_BRIGHTPINK)<\/code>.\n<\/p><\/blockquote>\n<p>\nSome time later, the customer came back with a follow-up question.\n<\/p>\n<blockquote CLASS=\"m\"><p>\nI can&#8217;t get it to work.\nI get a compiler error:<\/p>\n<pre>\nerror C2065: 'EPHNT_BRIGHTPINK' : undeclared identifier\n<\/pre>\n<p>\nAm I missing a header file?\n<\/p>\n<\/blockquote>\n<p>\n(So much for\n<a HREF=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2006\/11\/03\/942851.aspx#1001062\">\npeople knowing what to do when they get this error message<\/a>.)\n<\/p>\n<p>\nDon&#8217;t be helpless.\nYour head isn&#8217;t just for looks.\nAt least pretend to try to understand what you&#8217;re doing.\nIn this case, the function is <code>GetElephantHandle<\/code>,\nand you&#8217;re having trouble because the <code>EPHNT_BRIGHTPINK<\/code>\nvalue we want isn&#8217;t defined.\nWhy not check out the values that <strong>are<\/strong> defined?\n<\/p>\n<pre>\n#define EPHNT_DUMBO         0\n#define EPHNT_BABAR         1\n#define EPHNT_WHITE         2\n#define EPHNT_BRIGHT_PINK   3\n<\/pre>\n<p>\nWow, I bet the person who wrote <code>EPHNT_BRIGHTPINK<\/code> really meant\n<code>EPHNT_BRIGHT_PINK<\/code>.\n<\/p>\n<p>\nArmed with this new skill, perhaps you can solve this person&#8217;s problem:\n<\/p>\n<blockquote CLASS=\"m\"><p>\nSomebody recommended that I add the <code>DS_SHELLEXT<\/code> style\nto my property sheet dialog template to fix a sizing problem,\nbut when I try that, I get an error that tells\nme that <code>DS_SHELLEXT<\/code> is not defined.\nIs there a file I have to include?\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I see people ask a question and get an answer, but the answer doesn&#8217;t quite work. But instead of trying to understand the answer in order to see why it doesn&#8217;t work and develop a better solution, they just play stupid. Here&#8217;s an example. The names have been changed but the story&#8217;s the same. [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-26923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>Sometimes I see people ask a question and get an answer, but the answer doesn&#8217;t quite work. But instead of trying to understand the answer in order to see why it doesn&#8217;t work and develop a better solution, they just play stupid. Here&#8217;s an example. The names have been changed but the story&#8217;s the same. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/26923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=26923"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/26923\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=26923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=26923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=26923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}