{"id":65,"date":"2010-03-17T11:54:44","date_gmt":"2010-03-17T11:54:44","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=65"},"modified":"2022-02-17T06:24:06","modified_gmt":"2022-02-17T06:24:06","slug":"assembly-attributes","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/application-control\/assembly-attributes","title":{"rendered":"Assembly Attributes"},"content":{"rendered":"<p>You may want to use FileVersionInfo instead of or in attaion to these as they get passed into the .exe file and are viewable in explorer, whereas assembly attributes don&#8217;t<\/p>\n<pre><code>using namespace System::Windows::Forms;<\/code><\/pre>\n<p>Assembly attributes are basically global text strings that you can get at in your code.<\/p>\n<h4>Default Assembly Attributes<\/h4>\n<p>They are in the file: AssemblyInfo.cpp<\/p>\n<pre><code>[assembly:AssemblyTitleAttribute(\"My Ap Name\")];\r\n\t\/\/\r\n\r\n[assembly:AssemblyDescriptionAttribute(\"\")];\r\n\t\/\/\r\n\r\n[assembly:AssemblyConfigurationAttribute(\"\")];\r\n\t\/\/Use to specify the build configuration (e.g. retail, debug, etc)\r\n\r\n[assembly:AssemblyCompanyAttribute(\"My Company Name\")];\r\n\t\/\/Company name - Often used when creating user direcotry for an application etc.\r\n\r\n[assembly:AssemblyProductAttribute(\"My Ap Name\")];\r\n\t\/\/Product name - Often used when creating user directory for an application, naming message boxes, etc\r\n\r\n[assembly:AssemblyCopyrightAttribute(\"Copyright (c)  2010\")];\r\n\t\/\/Often used in an about box\r\n\r\n[assembly:AssemblyTrademarkAttribute(\"\")];\r\n\t\/\/\r\n\r\n[assembly:AssemblyCultureAttribute(\"\")];\r\n\t\/\/<\/code><\/pre>\n<p>You can get at these in your code with Application:<\/p>\n<h4>Getting Version Attribute<\/h4>\n<pre><code>Assembly ^assembly = Assembly::GetExecutingAssembly();\r\nVersion ^version = assembly-&gt;GetName()-&gt;Version;\r\nlblVersion-&gt;Text = \"Version: \" + version;\r\n\r\nlblVersion-&gt;Text = Application::CompanyName;\r\nlblVersion-&gt;Text = Application::ProductName;\r\n<\/code><\/pre>\n<h4>Setting Assembly Attributes In Code<\/h4>\n<pre><code>#if DEBUG\r\n[assembly: AssemblyConfiguration(\"Debug\")]\r\n#else\r\n[assembly: AssemblyConfiguration(\"Release\")]\r\n#endif<\/code><\/pre>\n<h4>Getting An Assembly Attribute In Code<\/h4>\n<pre><code>Attribute ^Copyright = AssemblyCopyrightAttribute::GetCustomAttribute(System::Reflection::Assembly::GetExecutingAssembly(), AssemblyCopyrightAttribute::typeid);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You may want to use FileVersionInfo instead of or in attaion to these as they get passed into the .exe file and are viewable in explorer, whereas assembly attributes don&#8217;t using namespace System::Windows::Forms; Assembly attributes are basically global text strings that you can get at in your code. Default Assembly Attributes They are in the [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-application-control"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":9,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":1145,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/65\/revisions\/1145"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}