<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Software Solutions &#187; HowTo</title>
	<atom:link href="http://ossmall.info/category/ms-visual-studio/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://ossmall.info</link>
	<description>Open Software Solutions</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:59:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to bind a Rich Text Box control to an element that is returned from a Web service in InfoPath and Visual Studio .NET 2003</title>
		<link>http://ossmall.info/how-to-bind-a-rich-text-box-control-to-an-element-that-is-returned-from-a-web-service-in-infopath-and-visual-studio-net-2003/</link>
		<comments>http://ossmall.info/how-to-bind-a-rich-text-box-control-to-an-element-that-is-returned-from-a-web-service-in-infopath-and-visual-studio-net-2003/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 10:06:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[MS Office InfoPath]]></category>

		<guid isPermaLink="false">http://ossmall.info/how-to-bind-a-rich-text-box-control-to-an-element-that-is-returned-from-a-web-service-in-infopath-and-visual-studio-net-2003/</guid>
		<description><![CDATA[This article describes how to bind a Rich Text Box control on a Microsoft Office InfoPath 2007 form or on a Microsoft Office InfoPath 2003 form to an XML element that is returned from a Web service. For a Rich Text Box control to bind to an XML element that is returned from a Web [...]]]></description>
			<content:encoded><![CDATA[<p>This article describes how to bind a Rich Text Box control on a Microsoft Office InfoPath 2007 form or on a Microsoft Office InfoPath 2003 form to an XML element that is returned from a Web service.</p>
<p>For a Rich Text Box control to bind to an XML element that is returned from a Web service, the Rich Text Box control must contain XHTML content. The element must have the following XML schema:</p>
<pre>        &lt;xsd:element name="[elementname]"&gt;</pre>
<pre>          &lt;xsd:complexType mixed="true"&gt;</pre>
<pre>            &lt;xsd:sequence&gt;</pre>
<pre>              &lt;xsd:any namespace="http://www.w3.org/1999/xhtml" processContents="lax"</pre>
<pre>               minOccurs="0" maxOccurs="unbounded"/&gt;</pre>
<pre>            &lt;/xsd:sequence&gt;</pre>
<pre>          &lt;/xsd:complexType&gt;</pre>
<pre>        &lt;/xsd:element&gt;</pre>
<p>The <var>&lt;elementname&gt;</var> is the name of the XML element that is returned from the Web service.</p>
<p>InfoPath can automatically detect if an element is an XHTML element by querying the element for a sample value when InfoPath connects to the Web service data source for the first time. This article describes how to create a Web service that returns valid XHTML. This article also describes how to display the XHTML that is returned from the Web service in a Rich Text Box control on an InfoPath form.</p>
<h3>Create the Web service</h3>
<table border="1" cellpadding="0">
<tr>
<td><script type="text/javascript"> loadTOCNode(2, \'summary\');   </script>1.</td>
<td>Start Microsoft Visual Studio .NET.</td>
</tr>
<tr>
<td>2.</td>
<td>On the<strong> File</strong> menu, click <strong>New</strong>,   and then click <strong>Project</strong>.</td>
</tr>
<tr>
<td>3.</td>
<td>In the <strong>Project Types</strong> list, click <strong>Visual   C# Projects</strong>. In the <strong>Templates</strong> list, click <strong>ASP.NET   Web Service</strong>.</td>
</tr>
<tr>
<td>4.</td>
<td>In the <strong>Location</strong> box, type http://&lt;SERVER&gt;/RichTextService where <var>&lt;SERVER&gt;</var>   is the name of your Web server, and then click <strong>OK</strong>.</td>
</tr>
<tr>
<td>5.</td>
<td>Right-click <strong>Service1.asmx</strong>, and then click   <strong>View Code</strong>.</td>
</tr>
<tr>
<td>6.</td>
<td>Add the following Web Service method to the <strong>Service1</strong>   class:</p>
<pre>        [WebMethod]</pre>
<pre>        public System.Xml.XmlNode GetXHTMLRichText()</pre>
<pre>        {</pre>
<pre>         //Create a temporary XmlDocument object to generate nodes.</pre>
<pre>         System.Xml.XmlDocument tempDocument = new System.Xml.XmlDocument();</pre>
<pre></pre>
<pre>         //Create a wrapper node for the data.  This is necessary so InfoPath</pre>
<pre>         //correctly detects the XHTML content</pre>
<pre>         System.Xml.XmlElement theNode = (System.Xml.XmlElement)tempDocument.CreateNode(</pre>
<pre>            System.Xml.XmlNodeType.Element, "theNode", "http://somearbitrarynamespace/" );</pre>
<pre></pre>
<pre>         //Create a "font" element in the xhtml namespace.</pre>
<pre>         System.Xml.XmlElement theFontNode = (System.Xml.XmlElement)tempDocument.CreateNode(</pre>
<pre>            System.Xml.XmlNodeType.Element, "font", "http://www.w3.org/1999/xhtml" );</pre>
<pre>         theFontNode.InnerText= "Red Text";</pre>
<pre></pre>
<pre>         //Add a color attribute.</pre>
<pre>         System.Xml.XmlAttribute colorAttribute = tempDocument.CreateAttribute(</pre>
<pre>            "color" );</pre>
<pre>         colorAttribute.Value = "#ff0000";</pre>
<pre>         theFontNode.Attributes.Append( colorAttribute );</pre>
<pre></pre>
<pre>         //Append the font node to the wrapper node</pre>
<pre>         theNode.AppendChild( theFontNode );</pre>
<pre></pre>
<pre>         //Return the wrapper element.</pre>
<pre>         return theNode;</pre>
<pre>        }</pre>
</td>
</tr>
<tr>
<td>7.</td>
<td>On the <strong>Build</strong> menu, click <strong>Build   Solution</strong>.</td>
</tr>
<tr>
<td>8.</td>
<td>Exit Visual Studio .NET.</td>
</tr>
</table>
<h3>Create the InfoPath form</h3>
<h4><script type="text/javascript"> loadTOCNode(2, \'summary\'); </script>In InfoPath 2003</h4>
<table border="0" cellpadding="0">
<tr>
<td><script type="text/javascript"> loadTOCNode(3, \'summary\');   </script>1.</td>
<td>Start InfoPath 2003.</td>
</tr>
<tr>
<td>2.</td>
<td>On the <strong>File</strong> menu, click <strong>Design a   Form</strong>.</td>
</tr>
<tr>
<td>3.</td>
<td>In the Design a Form task pane, click <strong>New from   Data Connection&#8230;</strong>.The Data Source Setup Wizard starts.</td>
</tr>
<tr>
<td>4.</td>
<td>Setup the data source as follows:</p>
<table border="0" cellpadding="0">
<tr>
<td>a.</td>
<td>Click <strong>Web Service</strong> for the data source,     and then click<strong> Next</strong>.</td>
</tr>
<tr>
<td>b.</td>
<td>Click <strong>Receive data</strong>, and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>c.</td>
<td>Type http://&lt;SERVER&gt;/RichTextService/Service1.asmx     for the location of the Web service, and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>d.</td>
<td>In the <strong>Select an operation</strong> list, click <strong>GetXHTMLRichText</strong>,     and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>e.</td>
<td>Click <strong>Finish</strong>.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>5.</td>
<td>Switch to the Data Source task pane, and then expand the <strong>dataFields</strong>   group.</td>
</tr>
<tr>
<td>6.</td>
<td>Expand the <strong>GetXHTMLRichTextResponse</strong>   group, and then move the <strong>GetXHTMLRichTextResult</strong> element to   your form.InfoPath adds a Rich Text Box control to the view.</td>
</tr>
</table>
<h4 id="tocHeadRef">In InfoPath 2007</h4>
<table border="0" cellpadding="0">
<tr>
<td><script type="text/javascript"> loadTOCNode(3, \'summary\');   </script>1.</td>
<td>Start InfoPath 2007.</td>
</tr>
<tr>
<td>2.</td>
<td>In the left pane of the <strong>Getting Started</strong>   dialog box, click <strong>Design a Form Template</strong>.<br />
In the Design a Form Template window, click <strong>Blank</strong>, and then   click <strong>OK</strong>.</td>
</tr>
<tr>
<td>3.</td>
<td>On the <strong>Tools</strong> menu, click <strong>Data   Connections</strong>.</td>
</tr>
<tr>
<td>4.</td>
<td>In the Data Connections window, click <strong>Add</strong>.The Data Source Setup Wizard starts.</td>
</tr>
<tr>
<td>5.</td>
<td>Set up the data source as follows:</p>
<table border="0" cellpadding="0">
<tr>
<td>a.</td>
<td>Click to select <strong>Create a new connection to</strong>,     click to select <strong>Receive data</strong>, and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>b.</td>
<td>Click to select <strong>Web Service</strong> for the     data source, and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>c.</td>
<td>Type http://&lt;SERVER&gt;/RichTextService/Service1.asmx     for the location of the Web service, and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>d.</td>
<td>In the <strong>Select an operation</strong> list, click <strong>GetXHTMLRichText</strong>,     and then click <strong>Next</strong>.</td>
</tr>
<tr>
<td>e.</td>
<td>Click <strong>Finish</strong>.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>6.</td>
<td>Switch to the Data Source task pane, and then expand the <strong>dataFields</strong>   group.</td>
</tr>
<tr>
<td>7.</td>
<td>Expand the <strong>GetXHTMLRichTextResponse</strong>   group, and then move the <strong>GetXHTMLRichTextResult</strong> element to   the form.InfoPath adds a Rich Text Box control to the view.</td>
</tr>
</table>
<h3>Try it out</h3>
<table border="0" cellpadding="0">
<tr>
<td><script type="text/javascript"> loadTOCNode(2, \'summary\');   </script>1.</td>
<td>On the Task pane drop-down list, click <strong>Views</strong>.</td>
</tr>
<tr>
<td>2.</td>
<td>In the <strong>Views</strong> list, click <strong>Query</strong>.   Right-click <strong>Query</strong>, and then click <strong>Set as Default</strong>.</td>
</tr>
<tr>
<td>3.</td>
<td>On the <strong>File</strong> menu, point to <strong>Preview   Form</strong>, and then click <strong>Default</strong>.</td>
</tr>
<tr>
<td>4.</td>
<td>Click <strong>Run Query</strong>.</td>
</tr>
<tr>
<td>5.</td>
<td>On the <strong>View</strong> menu, click <strong>Data   Entry</strong>.Notice the value that is in the Rich Text Box control on the form. The value   that is returned by the Web service is <strong>Red Text</strong>, and the   value is formatted in red.</td>
</tr>
</table>
<hr align="center" size="2" width="100%" />
<h5>APPLIES TO</h5>
<table border="0" cellpadding="0">
<tr>
<td></td>
<td>Microsoft Office InfoPath 2007</td>
</tr>
<tr>
<td></td>
<td>Microsoft Office InfoPath 2003, Service Pack 1 (SP1)</td>
</tr>
<tr>
<td></td>
<td>Microsoft Office InfoPath 2003</td>
</tr>
<tr>
<td></td>
<td>Microsoft Visual Studio .NET 2003 Enterprise Developer</td>
</tr>
</table>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<h5>Microsoft Knowledge Base Article</h5>
<p class="MsoNormal">This article contents is Microsoft Copyrighted material.<br />
Microsoft Corporation. All rights reserved. <a href="http://support.microsoft.com/tou/">Terms of Use</a> | <a href="http://support.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx">Trademarks</a></p>
<p><o:p> </o:p></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/how-to-bind-a-rich-text-box-control-to-an-element-that-is-returned-from-a-web-service-in-infopath-and-visual-studio-net-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permission Calculator may add exaggerated or overly restrictive permissions to the application in Visual Studio 2008</title>
		<link>http://ossmall.info/permission-calculator-may-add-exaggerated-or-overly-restrictive-permissions-to-the-application-in-visual-studio-2008/</link>
		<comments>http://ossmall.info/permission-calculator-may-add-exaggerated-or-overly-restrictive-permissions-to-the-application-in-visual-studio-2008/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 12:55:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/permission-calculator-may-add-exaggerated-or-overly-restrictive-permissions-to-the-application-in-visual-studio-2008/</guid>
		<description><![CDATA[When you run the Permission Calculator in Microsoft Visual Studio 2008, the Permission Calculator may add exaggerated permissions or overly restrictive permissions to the application. CAUSE This problem occurs when the Permission Calculator cache files are not installed on the computer that is running Visual Studio 2008. WORKAROUND To work around this problem, use one [...]]]></description>
			<content:encoded><![CDATA[<p class="section">
<p class="sbody">When you run the Permission Calculator in Microsoft Visual Studio 2008, the Permission Calculator may add exaggerated permissions or overly restrictive permissions to the application.</p>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">CAUSE</h2>
<p class="sbody">This problem occurs when the Permission Calculator cache files are not installed on the computer that is running Visual Studio 2008.</p>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">WORKAROUND</h2>
<p class="sbody">To work around this problem, use one of the following methods.</p>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<h3 id="tocHeadRef">Method 1</h3>
<p>In Visual Studio 2008, turn on the Exception Assistant. When you debug the application, the Exception Assistant is displayed. You can use the Exception Assistant to grant specific permissions for the application. This process is required for each permission.</p>
<p>To turn on the Exception Assistant in Visual Studio 2008, follow these steps:</p>
<table class="list ol">
<tr>
<td class="number">1.</td>
<td class="text">On the <strong class="uiterm">Tools</strong> menu, click <strong class="uiterm">Options</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">In the <strong class="uiterm">Options</strong> dialog box, expand <strong class="uiterm">Debugging</strong>, and then click <strong class="uiterm">General</strong>.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">Click to select the <strong class="uiterm">Enable the exception assistant</strong> check box, and then click <strong class="uiterm">OK</strong>.</td>
</tr>
</table>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<h3 id="tocHeadRef">Method 2</h3>
<p>Go directly to the <strong class="uiterm">Security</strong> tab of the project options, and then manually review the permissions.  To do this, follow these steps:</p>
<table class="list ol">
<tr>
<td class="number">1.</td>
<td class="text">In <strong class="uiterm">Solution Explorer</strong>, right-click the project name, and then click <strong class="uiterm">Properties</strong>.</td>
</tr>
<tr>
<td class="number">2.</td>
<td class="text">Click the <strong class="uiterm">Security</strong> tab.</td>
</tr>
<tr>
<td class="number">3.</td>
<td class="text">In the <strong class="uiterm">ClickOnce Security Permissions</strong> area, review the permissions, and then manually grant the permissions that are required for the application.</td>
</tr>
</table>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">STATUS</h2>
<p class="sbody">Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &#8220;Applies to&#8221; section.</p>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">MORE INFORMATION</h2>
<p class="sbody">For more information about how to determine the permissions for a ClickOnce application, visit the following Microsoft Developer Network (MSDN) Web site:</p>
<p class="indent"><a href="http://msdn2.microsoft.com/en-us/library/91z17fc9%28VS.90%29.aspx">http://msdn2.microsoft.com/en-us/library/91z17fc9(VS.90).aspx</a><span class="pLink"> (http://msdn2.microsoft.com/en-us/library/91z17fc9(VS.90).aspx)</span></p>
<p>For more information about the Exception Assistant, visit the following MSDN Web site:</p>
<p class="indent"><a href="http://msdn2.microsoft.com/en-us/library/197c1fsc.aspx">http://msdn2.microsoft.com/en-us/library/197c1fsc.aspx</a><span class="pLink"> (http://msdn2.microsoft.com/en-us/library/197c1fsc.aspx)</span></p>
<p class="topOfPage"><a href="http://kbalertz.com/945356/Permission-Calculator-exaggerated-permissions-overly-restrictive-permissions-application-Visual-Studio.aspx#top"><br />
</a></p>
<hr />
<h5>APPLIES TO</h5>
<table class="list">
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2008 Standard Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2008 Professional Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2008 Academic Edition</td>
</tr>
</table>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<h5>Microsoft Knowledge Base Article</h5>
<p class="MsoNormal">This article contents is Microsoft Copyrighted material.<br />
Microsoft Corporation. All rights reserved. <a href="http://support.microsoft.com/tou/">Terms of Use</a> | <a href="http://support.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx">Trademarks</a></p>
<p><o:p> </o:p></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/permission-calculator-may-add-exaggerated-or-overly-restrictive-permissions-to-the-application-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You may encounter resource ID collisions when you try to rename duplicated resources by using Visual C++</title>
		<link>http://ossmall.info/you-may-encounter-resource-id-collisions-when-you-try-to-rename-duplicated-resources-by-using-visual-c/</link>
		<comments>http://ossmall.info/you-may-encounter-resource-id-collisions-when-you-try-to-rename-duplicated-resources-by-using-visual-c/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 12:54:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/you-may-encounter-resource-id-collisions-when-you-try-to-rename-duplicated-resources-by-using-visual-c/</guid>
		<description><![CDATA[If you duplicate a resource a few times in the resource browser by using copy and paste, you will find that it is possible to run into resource ID collisions when you try to rename the resources using the resource property dialog box. That is, when you try to rename your resources, you will find [...]]]></description>
			<content:encoded><![CDATA[<p>If you duplicate a resource a few times in the resource browser by using copy and paste, you will find that it is possible to run into resource ID collisions when you try to rename the resources using the resource property dialog box. That is, when you try to rename your resources, you will find that the resource editor may try to assign your new resource name an integer ID that already exists. This will cause a resource editor error message.</p>
<h2>CAUSE</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'cause'); </script>This problem is the result of the Resource Editor not correctly assigning new IDs to resource names when you try to give a resource a new name. The Resource Editor actually is trying to assign the new resource name an integer ID that is already used by another resource. This will cause the resource ID collision.</p>
<h2>RESOLUTION</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'resolution'); </script>After you have duplicated your resources and before you start to rename them, take the following steps to ensure that your resource names have unique integer identifiers:</p>
<table border="0" cellpadding="0">
<tr>
<td>1.</td>
<td>If you are using Visual C++, versions 2.x, make sure that   the resource file is open by double-clicking the .rc file in the project   window. In Visual C++ versions 4.x, click the <strong>Resource</strong> tab   in the <strong>Project</strong> window. In Visual C++ versions 5.0 and 6.0,   click the <strong>ResourceView</strong> tab in the <strong>Project Workspace</strong>   pane.</td>
</tr>
<tr>
<td>2.</td>
<td>If you are using Visual C++ 2.x, open the <strong>Symbols</strong>   dialog box. To do this,click <strong>Symbols</strong> on the <strong>Resource</strong>   menu. In Visual C++ versions 4.0, 4.1, 4.2, 5.0, and 6.0, click <strong>Resource   Symbols</strong> on the <strong>View</strong> menu.</td>
</tr>
<tr>
<td>3.</td>
<td>Click <strong>New</strong>. The <strong>New Symbol</strong>   dialog box appears.</td>
</tr>
<tr>
<td>4.</td>
<td>In the name edit control, type the new symbol name that   you want to use.</td>
</tr>
<tr>
<td>5.</td>
<td>In the Value edit control, type the new symbol value that   you want to use. You must make sure that this value is not being used by any   of the resources that are listed in the <strong>Resource Symbols</strong>   dialog box.</td>
</tr>
<tr>
<td>6.</td>
<td>Close the <strong>New Symbol</strong> dialog box by   clicking <strong>OK</strong>.</td>
</tr>
<tr>
<td>7.</td>
<td>Close the Symbols Browser by clicking <strong>OK</strong>.</td>
</tr>
</table>
<p>You can now rename your resources using the symbols you created without worrying about whether the symbol has already been defined.</p>
<h2>STATUS</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'status'); </script>Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &#8220;Applies to&#8221; section.</p>
<h2>MORE INFORMATION</h2>
<h3><script type="text/javascript"> loadTOCNode(1, 'moreinformation'); </script>Steps to reproduce the problem</h3>
<table border="0" cellpadding="0">
<tr>
<td><script type="text/javascript"> loadTOCNode(2, 'moreinformation');   </script>1.</td>
<td>Use Appwizard to generate a new MDI application.</td>
</tr>
<tr>
<td>2.</td>
<td>In Visual C++ 2.x, open the .rc file in the project   window. In Visual C++ 4.0, 4.1, or 4.2, click the <strong>Resource</strong>   tab in the <strong>Project</strong> window to view the resources. In Visual   C++, versions 5.0 and 6.0, click the <strong>ResourceView</strong> tab in the   <strong>Project Workspace</strong> pane.</td>
</tr>
<tr>
<td>3.</td>
<td>Expand <strong>Accelerator</strong>, <strong>Icon</strong>,   <strong>Menu</strong>, and <strong>Toolbar</strong>.</td>
</tr>
<tr>
<td>4.</td>
<td>Select the <strong>IDR_MAINFRAME Accelerator</strong>   resource.</td>
</tr>
<tr>
<td>5.</td>
<td>Press CTRL+C</td>
</tr>
<tr>
<td>6.</td>
<td>Press CTRL+V four times to   make four copies of the Accelerator table IDR_MAINFRAME. There are now five   versions of the Accelerator table named IDR_MAINFRAME through IDR_MAINFRAME4</td>
</tr>
<tr>
<td>7.</td>
<td>Repeat steps 4 through 6 for the Icon, Menu, and Toolbar   resources. You may notice inconsistencies in the default naming of the pasted   resources. That is, you may see the default names come up as IDR_MAINFRAME,   IDR_MAINFRAME2, IDR_MAINFRAME3, IDR_MAINFRAME4 and so on (IDR_MAINFRAME1 was   skipped).</td>
</tr>
<tr>
<td>8.</td>
<td>Start renaming all of the Accelerators so that you have IDR_MAINFRAME   and IDR_TEST1 through IDR_TEST4</td>
</tr>
<tr>
<td>9.</td>
<td>Start renaming all of Icons in the same way the   accelerators were named in step 8. You won&#8217;t be able to because you will get   an error message that says:</p>
<p><font color="#ff0000">The resource &#8216;IDR_XTYPE&#8217; of this type uses the same   identifier value.</font></p>
<p>Where X is the project name.</td>
</tr>
</table>
<hr align="center" size="2" width="100%" />
<h5>APPLIES TO</h5>
<table border="0" cellpadding="0">
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 2.0 Professional Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 2.1</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 2.2</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 4.0 Standard Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 4.1 Subscription</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 4.2 Enterprise Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 5.0 Enterprise Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 6.0 Enterprise Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 4.2 Professional Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 5.0 Professional Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 6.0 Professional Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++, 32-bit Learning Edition 6.0</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ .NET 2003 Standard Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ .NET 2002 Standard Edition</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Microsoft Visual C++ 2005 Express Edition</td>
</tr>
</table>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/you-may-encounter-resource-id-collisions-when-you-try-to-rename-duplicated-resources-by-using-visual-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Description of the DebuggerFirewall utility that makes the Visual Studio Remote Debugger work through the Windows XP Service Pack 2 firewall</title>
		<link>http://ossmall.info/description-of-the-debuggerfirewall-utility-that-makes-the-visual-studio-remote-debugger-work-through-the-windows-xp-service-pack-2-firewall/</link>
		<comments>http://ossmall.info/description-of-the-debuggerfirewall-utility-that-makes-the-visual-studio-remote-debugger-work-through-the-windows-xp-service-pack-2-firewall/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 16:05:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/description-of-the-debuggerfirewall-utility-that-makes-the-visual-studio-remote-debugger-work-through-the-windows-xp-service-pack-2-firewall/</guid>
		<description><![CDATA[INTRODUCTION To use remote debugging with Microsoft Visual Studio .NET or with Microsoft Visual Studio 2005 on a computer that is running Microsoft Windows XP Service Pack 2 and later versions, the Microsoft Windows firewall on both the local computer and on the remote computer have to be configured correctly. The DebuggerFirewall configuration utility performs [...]]]></description>
			<content:encoded><![CDATA[<h3>INTRODUCTION</h3>
<p><script type="text/javascript"> loadTOCNode(1, \\'summary\\'); </script>To use remote debugging with Microsoft Visual Studio .NET or with Microsoft Visual Studio 2005 on a computer that is running Microsoft Windows XP Service Pack 2 and later versions, the Microsoft Windows firewall on both the local computer and on the remote computer have to be configured correctly. The DebuggerFirewall configuration utility performs most of the configuration automatically to permit debugging.</p>
<h3>MORE INFORMATION</h3>
<p><script type="text/javascript"> loadTOCNode(1, \\'moreinformation\\'); </script>The configuration utility is an HTML application (.hta) file. Download the configuration utility and then run the configuration utility on both the local computer and the remote computer that is running Windows XP Service Pack 2. Do this after you have installed the Visual Studio Remote Debugger and the remote debugger components. The following file is available for download from the Microsoft Download Center:<br />
<!--[if gte vml 1]>                                                  <![endif]--><img src="file:///C:/DOCUME%7E1/marius/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif" alt="Download" title="Download" v:shapes="_x0000_i1027" height="16" width="24" /><a href="http://download.microsoft.com/download/8/5/7/857e38ca-34f2-47e8-8300-56405f85fc4c/debuggerfirewallconfiguration.exe">Download the Debuggerfirewallconfiguration.exe package now.</a> (http://download.microsoft.com/download/8/5/7/857e38ca-34f2-47e8-8300-56405f85fc4c/debuggerfirewallconfiguration.exe)</p>
<p>Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.</p>
<p>The configuration utility automatically configures the Windows firewall as needed to permit remote debugging. You have to be an Administrator on the computer that you are using to run the utility.</p>
<p>The configuration utility does not do the following:</p>
<table border="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
<td>Configure DCOM on your Visual Studio. NET or Visual Studio   2005 computer</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Provide remote script debugging</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Provide remote Web server debugging</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Provide debugging for users who are not Administrators</td>
</tr>
</table>
<hr align="center" size="2" width="100%" />
<h5>APPLIES TO</h5>
<table border="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2002 Academic Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2002 Enterprise Architect</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2002 Enterprise Developer</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2002 Professional Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2003 Academic Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2003 Enterprise Architect</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2003 Enterprise Developer</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio .NET 2003 Professional Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio 2005 Professional Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Visual Studio 2005 Standard Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Windows XP Home Edition</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>Microsoft Windows XP Professional</td>
</tr>
</table>
<h4>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</h4>
<h4>Microsoft Knowledge Base Article</h4>
<p class="MsoNormal">This article contents is Microsoft Copyrighted material.<br />
Microsoft Corporation. All rights reserved. <a href="http://support.microsoft.com/tou/">Terms of Use</a> | <a href="http://support.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx">Trademarks</a><br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/description-of-the-debuggerfirewall-utility-that-makes-the-visual-studio-remote-debugger-work-through-the-windows-xp-service-pack-2-firewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You receive an assertion in Wincore.cpp when you use a Visual C++ 4.x MFC application spawned from a Windows NT service or as a Windows NT service</title>
		<link>http://ossmall.info/you-receive-an-assertion-in-wincorecpp-when-you-use-a-visual-c-4x-mfc-application-spawned-from-a-windows-nt-service-or-as-a-windows-nt-service/</link>
		<comments>http://ossmall.info/you-receive-an-assertion-in-wincorecpp-when-you-use-a-visual-c-4x-mfc-application-spawned-from-a-windows-nt-service-or-as-a-windows-nt-service/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 13:26:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/you-receive-an-assertion-in-wincorecpp-when-you-use-a-visual-c-4x-mfc-application-spawned-from-a-windows-nt-service-or-as-a-windows-nt-service/</guid>
		<description><![CDATA[When you use a Visual C++ 4.x MFC application spawned from a Windows NT service or as a Windows NT service, an assertion may occur in Wincore.cpp. Specifically, it occurs on the following line in _AfxActivationWndProc():   LRESULT CALLBACK _AfxActivationWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) {     WNDPROC oldWndProc = (WNDPROC)::GetProp(hWnd, szAfxOldWndProc);     [...]]]></description>
			<content:encoded><![CDATA[<p>When you use a Visual C++ 4.x MFC application spawned from a Windows NT service or as a Windows NT service, an assertion may occur in Wincore.cpp. Specifically, it occurs on the following line in _AfxActivationWndProc():</p>
<pre>  LRESULT CALLBACK</pre>
<pre> _AfxActivationWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)</pre>
<pre> {</pre>
<pre></pre>
<pre>    WNDPROC oldWndProc = (WNDPROC)::GetProp(hWnd, szAfxOldWndProc);</pre>
<pre>    ASSERT(oldWndProc != NULL);  // &lt;----- assert occurs here</pre>
<pre>    .</pre>
<pre>    .</pre>
<pre>    .</pre>
<pre> }</pre>
<pre></pre>
<p>The assertion occurs on line 385 with Visual C++ versions 4.2 and 4.2b, on line 384 with Visual C++ version 4.1, line 392 with Visual C++ version 5.0, and on line 389 with Visual C++ 6.0.</p>
<h2>CAUSE</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'cause'); </script>MFC subclasses all non-MFC created windows to handle specific activation issues. While subclassing a non-MFC created window, the old window procedure is stored in the properties of the window. Logging off of an Windows NT session causes the atoms used to identify the properties to be destroyed and the property cannot be retrieved. This causes the assertion to occur.</p>
<p>MFC was not designed for Windows NT services. As a result, if an MFC application is spawned from a Windows NT service, minimized, and then a user logs-off, then the assertion will occur.</p>
<p>Also keep in mind that there are other problems to consider when spawning an MFC application from a service or as a service. The OnEndSession() message handler for the main frame window closes out the CDocument object. So the WM_ENDSESSION message must be handled to prevent this from happening.</p>
<h2>RESOLUTION</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'resolution'); </script>You can do one of the following things:</p>
<table border="0" cellpadding="0">
<tr>
<td>
<ul></ul>
</td>
<td>Unsubclass all of the non-MFC windows at some time before   logoff or during logoff such as in the WM_ENDSESSION handler.</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Modify the MFC code and rebuild the MFC libraries. In this   case, you can modify the MFC code to prevent it from subclassing any non-MFC   windows or modify the code so that you can store the old window procedure in   a list rather than in properties for the window. As each window is destroyed   (WM_NCDESTROY is received), look up the window handle in your list and   unsubclass it like MFC does in the _AfxActivationWndProc() function.</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>Separate the GUI part of the application from the service   part. In other words, have a GUI client startup every time the user logs on.   Then, have the GUI client talk to the service through some form of   interprocess communication, such as named pipes or sockets. The service   should maintain the data and the GUI starts up each time when you log on.</td>
</tr>
</table>
<p>MFC subclasses non-MFC windows to generally handle obscure window activation issues. For example, it ensures proper activation of toplevel windows when doing in-place OLE activation. It also ensures that the last active popup is activated when a user clicks on a disabled window that is part of the application. Normally, if you have a main window that owns a modal dialog box and some other popup window like a floating toolbar, and you switch activation to another application, and click on the toolbar that was disabled by the modal dialog box, Windows beeps and does not activate the application. MFC ensures that the modal dialog box is brought to the top when you click on the toolbar. Note that MFC handles all of these activation issues for MFC-created windows and non-MFC created Windows. The old window procedure is stored as a property associated with the window only for non-MFC windows. If you unsubclass the non-MFC windows (as the first technique suggests above), you still get these activation features for any windows that were created as MFC CWnd-derived objects.</p>
<h3>Unsubclassing the non-MFC Windows</h3>
<p><script type="text/javascript"> loadTOCNode(2, 'resolution'); </script>The first technique listed above may be an easy workaround for developers who have already written an application and don&#8217;t want to rework their design, rebuild the MFC libraries, or don&#8217;t need to handle the activation issues MFC handles.</p>
<p>You can unsubclass non-MFC Windows in the WM_ENDSESSION handler of your main frame window. The following sample code demonstrates how to enumerate all of the windows for your process and unsubclass them: For Visual C++ 4.x and Visual C++ 5.0:</p>
<pre>    static const TCHAR szAfxOldWndProc[] = _T("AfxOldWndProc");</pre>
<pre></pre>
<p>For Visual C++ 6.0:</p>
<pre>    static const TCHAR szAfxOldWndProc[] = _T("AfxOldWndProc423");  // Visual C++ 6.0</pre>
<pre></pre>
<p>And add the functions:</p>
<pre>    BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam)</pre>
<pre> {</pre>
<pre>    //check for property and unsubclass if necessary</pre>
<pre>    WNDPROC oldWndProc = (WNDPROC)::GetProp(hWnd, szAfxOldWndProc);</pre>
<pre>    if (oldWndProc!=NULL)</pre>
<pre>    {</pre>
<pre>       SetWindowLong(hWnd, GWL_WNDPROC, (DWORD)oldWndProc);</pre>
<pre>       RemoveProp(hWnd, szAfxOldWndProc);</pre>
<pre>    }</pre>
<pre></pre>
<pre>    return TRUE;</pre>
<pre></pre>
<pre> }</pre>
<pre></pre>
<pre> void CMainFrame::OnEndSession(BOOL bEnding)</pre>
<pre> {</pre>
<pre>    // unsubclass the non-MFC windows which MFC has subclassed</pre>
<pre>    DWORD dwProcessId;</pre>
<pre></pre>
<pre>    DWORD dwThreadId= GetWindowThreadProcessId(m_hWnd,&amp;dwProcessId);</pre>
<pre>    EnumThreadWindows(dwThreadId, EnumProc,(LPARAM) dwThreadId);</pre>
<pre></pre>
<pre> }</pre>
<pre></pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/you-receive-an-assertion-in-wincorecpp-when-you-use-a-visual-c-4x-mfc-application-spawned-from-a-windows-nt-service-or-as-a-windows-nt-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Static, identifiers , missing ,from , ClassView ,Globals, folder , Visual ,C++</title>
		<link>http://ossmall.info/static-identifiers-missing-from-classview-globals-folder-visual-c/</link>
		<comments>http://ossmall.info/static-identifiers-missing-from-classview-globals-folder-visual-c/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 13:27:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/static-identifiers-missing-from-classview-globals-folder-visual-c/</guid>
		<description><![CDATA[The Globals folder in the ClassView of Developer&#8217;s Studio is used to display and provide quick access to global identifiers in the current project. Identifiers declared as static that have file scope are missing from the ClassView Globals folder. Note In Microsoft Visual C++ .NET and in Microsoft Visual C++ 2005, the nonstatic identifiers do [...]]]></description>
			<content:encoded><![CDATA[<p>The Globals folder in the ClassView of Developer&#8217;s Studio is used to display and provide quick access to global identifiers in the current project. Identifiers declared as static that have file scope are missing from the ClassView Globals folder.</p>
<p><strong>Note</strong> In Microsoft Visual C++ .NET and in Microsoft Visual C++ 2005, the nonstatic identifiers do not appear either.</p>
<h2>STATUS</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'status'); </script>Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.</p>
<h2>MORE INFORMATION</h2>
<h3><script type="text/javascript"> loadTOCNode(1, 'moreinformation'); </script>Sample Code to Demonstrate Problem</h3>
<pre><script type="text/javascript">
loadTOCNode(2, 'moreinformation');
</script>   // Main.cpp</pre>
<pre>   #include &lt;StdIo.h&gt;</pre>
<pre>   ...</pre>
<pre>   static int nGlobalStaticInt;  // Will not show up in Globals Folder</pre>
<pre>   int        nGlobalInt;        // Will show up in Globals Folder</pre>
<pre>   ...</pre>
<pre>   void main(void)</pre>
<pre>   {</pre>
<pre>   }</pre>
<pre></pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/static-identifiers-missing-from-classview-globals-folder-visual-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An attempt to create a debugging library that uses precompiled headers may fail, and fatal build errors may be generated</title>
		<link>http://ossmall.info/an-attempt-to-create-a-debugging-library-that-uses-precompiled-headers-may-fail-and-fatal-build-errors-may-be-generated/</link>
		<comments>http://ossmall.info/an-attempt-to-create-a-debugging-library-that-uses-precompiled-headers-may-fail-and-fatal-build-errors-may-be-generated/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 12:49:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/an-attempt-to-create-a-debugging-library-that-uses-precompiled-headers-may-fail-and-fatal-build-errors-may-be-generated/</guid>
		<description><![CDATA[An attempt to create a debugging library that uses precompiled headers may fail and fatal build errors may be generated. With the 16-bit edition, the CVPACK and LINK utilities may generate the following error message: CVPACK : fatal error CK1017: cannot find precompiled types file; relink with file.obj LINK : warning LNK4027: CVPACK error With [...]]]></description>
			<content:encoded><![CDATA[<p>An attempt to create a debugging library that uses precompiled headers may fail and fatal build errors may be generated. With the 16-bit edition, the CVPACK and LINK utilities may generate the following error message:</p>
<p><font color="#ff0000">CVPACK : fatal error CK1017: cannot find precompiled types file; relink with file.obj<br />
LINK : warning LNK4027: CVPACK error</font></p>
<p>With the 32-bit edition, the LINK utility may generate the following error message:</p>
<p><font color="#ff0000">LINK : fatal error LNK1211: precompiled type information not found; &#8220;&lt;filename&gt;&#8221; not linked or overwritten</font></p>
<p><strong>Note</strong> If you build a static library in a Visual Studio .NET version with precompiled header file, and you use the compiler debug switches /ZI or /Zi, you may not receive the errors that are listed in this article, but you may see either of the following two problems while debugging your application and trying to view any variables from the library in the Watch window:</p>
<table border="0" cellpadding="0">
<tr>
<td>
<ul></ul>
</td>
<td>You may receive the following error message in the Watch   window:</p>
<p><font color="#ff0000">CXX0033:Error:error in OMF type information</font></td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td>While expanding a class object, you may see only blank   entries for the class members.</td>
</tr>
</table>
<p>The resolution for this debugging problem is the same as is described in the &#8220;Resolution&#8221; section of this article.</p>
<h2>CAUSE</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'cause'); </script>When you specify the <strong>/Yc</strong> and <strong>/Z7</strong> options on the compiler command line, Microsoft C/C++ generates a precompiled header file that contains CodeView debugging information. The error occurs only when you store the precompiled header in a library, use the library to build an object module, and the source code does not refer to any of the functions the precompiled header file defines.</p>
<h2>RESOLUTION</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'resolution'); </script>There are two methods to work around this situation, as follows:</p>
<table border="0" cellpadding="0">
<tr>
<td>
<ul></ul>
</td>
<td>Specify the <strong>/Yd</strong> compiler option switch to add the   CodeView information from the precompiled header to each object module. This   method is less desirable because it generally produces large object modules   that can increase the time required to link the application.</td>
</tr>
<tr>
<td>
<ul></ul>
</td>
<td><strong>Note</strong> The following work-around is for 32-bit   versions only. Specify the <strong>/Yl&lt;symbol&gt;</strong> compiler option switch,   where <strong>&lt;symbol&gt;</strong> is the name of an arbitrary symbol in the   library, when you create a precompiled header file that does not contain any   function definitions. This switch directs the compiler to store the debugging   information in the precompiled header file.</td>
</tr>
</table>
<h2>STATUS</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'status'); </script>This behavior is by design.</p>
<h2>MORE INFORMATION</h2>
<p><script type="text/javascript"> loadTOCNode(1, 'moreinformation'); </script>When you compile a module with the <strong>/Yc</strong> and <strong>/Yl&lt;symbol_name&gt;</strong> option switches using the 32-bit edition, the compiler creates a symbol similar to __@@_PchSym_@00@&#8230;@&lt;symbol_name&gt;, where the ellipsis (&#8230;) represents a linker generated character string, and stores it in the object module. Any source file that you compile with this precompiled header refers to the specified symbol, which causes the linker to include the object module and its debugging information from the library.</p>
<p>The following code example demonstrates the problem.</p>
<h3>Sample code</h3>
<pre><script type="text/javascript">
loadTOCNode(2, 'moreinformation');
</script>   /*</pre>
<pre></pre>
<pre>    * To demonstrate this problem, perform the following five steps:</pre>
<pre>    *</pre>
<pre>    * 1. Compile TEST1.C as follows: cl /Yctest.h /Z7 /c TEST1.C</pre>
<pre>    * 2. Compile TEST2.C as follows: cl /Yutest.h /Z7 /c TEST2.C</pre>
<pre>    * 3. Build a library that contains TEST1.OBJ and TEST2.OBJ as</pre>
<pre>    *    follows: lib /out:test.lib test1.obj test2.obj</pre>
<pre>    * 4. Compile TEST3.C as follows: cl /Yutest.h /Z7 /c TEST3.C</pre>
<pre>    * 5. Link the application as follows:</pre>
<pre>    *       link /debugtype:cv /debug:notmapped,full test3.obj test.lib</pre>
<pre>    *</pre>
<pre>    * To correct this problem, do one of the following:</pre>
<pre>    *</pre>
<pre>    *   1. 32-bit only)  Compile TEST1.C in step 1 as follows:</pre>
<pre>    *        cl /Yctest.h /YlAnyName /Z7 /c TEST1.C</pre>
<pre>    *      Then, repeat step 2 through 5.</pre>
<pre>    *</pre>
<pre>    *   2. Repeat steps 1 through 5, adding the /Yd command line option</pre>
<pre>    *      to steps 1, 2, and 4.</pre>
<pre></pre>
<pre>    */</pre>
<pre></pre>
<h3>TEST.H</h3>
<pre><script type="text/javascript">
loadTOCNode(2, 'moreinformation');
</script>   #include &lt;stdio.h&gt;</pre>
<pre></pre>
<h3>TEST1.C</h3>
<pre><script type="text/javascript">
loadTOCNode(2, 'moreinformation');
</script>   #include "test.h"</pre>
<pre></pre>
<h3>TEST2.C</h3>
<pre><script type="text/javascript">
loadTOCNode(2, 'moreinformation');
</script>   #include "test.h"</pre>
<pre></pre>
<pre>   void test2func(void)</pre>
<pre>   {</pre>
<pre>      printf("inside TEST2FUNC...\n");</pre>
<pre>   }</pre>
<pre></pre>
<h3>TEST3.C</h3>
<pre><script type="text/javascript">
loadTOCNode(2, 'moreinformation');
</script>   #include "test.h"</pre>
<pre></pre>
<pre>   void test2func(void);</pre>
<pre></pre>
<pre>   void main(void)</pre>
<pre>   {</pre>
<pre>      printf("inside MAIN...\n");</pre>
<pre>   }</pre>
<pre></pre>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/an-attempt-to-create-a-debugging-library-that-uses-precompiled-headers-may-fail-and-fatal-build-errors-may-be-generated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application will not read the changes made to app.config or machine.config at runtime</title>
		<link>http://ossmall.info/application-will-not-read-the-changes-made-to-appconfig-or-machineconfig-at-runtime/</link>
		<comments>http://ossmall.info/application-will-not-read-the-changes-made-to-appconfig-or-machineconfig-at-runtime/#comments</comments>
		<pubDate>Mon, 10 May 2010 09:44:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://ossmall.info/application-will-not-read-the-changes-made-to-appconfig-or-machineconfig-at-runtime/</guid>
		<description><![CDATA[Change the app.config or machine.config when the application that uses them is running. Result The application will not be able to read these changes, and the new changes made to the .config files will not be reflected in the application. Cause .NET Framework will read the .config file once at application startup and then not read them [...]]]></description>
			<content:encoded><![CDATA[<p class="section">
<p class="sbody">Change the app.config or machine.config when the application that uses them is running.</p>
<p class="topOfPage"><a href="http://kbalertz.com/948855/Application-changes-runtime.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">Result</h2>
<p class="sbody">The application will not be able to read these changes, and the new changes made to the .config files will not be reflected in the application.</p>
<p class="topOfPage"><a href="http://kbalertz.com/948855/Application-changes-runtime.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">Cause</h2>
<p class="sbody">.NET Framework will read the .config file once at application startup and then not read them again during that session.</p>
<p class="topOfPage"><a href="http://kbalertz.com/948855/Application-changes-runtime.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">Resolution</h2>
<p class="sbody">Restart the application so it can read these changes.</p>
<p class="topOfPage"><a href="http://kbalertz.com/948855/Application-changes-runtime.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">More Information</h2>
<p class="sbody"><a href="http://blogs.msdn.com/junfeng/archive/2005/02/20/376880.aspx">App.Config reloading</a><span class="pLink"> (http://blogs.msdn.com/junfeng/archive/2005/02/20/376880.aspx)</span><br />
<a href="http://msdn2.microsoft.com/en-us/library/ms229697.aspx">Machine.Configuration Files</a><span class="pLink"> (http://msdn2.microsoft.com/en-us/library/ms229697.aspx)</span></p>
<p class="topOfPage"><a href="http://kbalertz.com/948855/Application-changes-runtime.aspx#top"><br />
</a></p>
<h2 class="subTitle" id="tocHeadRef">DISCLAIMER</h2>
<p class="sbody">MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.</p>
<p>TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.</p>
<p class="topOfPage"><a href="http://kbalertz.com/948855/Application-changes-runtime.aspx#top"><br />
</a></p>
<hr />
<h5>APPLIES TO</h5>
<table class="list">
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2005 Express Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2005 Professional Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2005 Standard Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2005 Team Suite</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2008 Academic Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2008 Professional Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio 2008 Standard Edition</td>
</tr>
<tr>
<td class="bullet">•</td>
<td class="text">Microsoft Visual Studio Team System 2008 Team Suite</td>
</tr>
</table>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<h5>Microsoft Knowledge Base Article</h5>
<p class="MsoNormal">This article contents is Microsoft Copyrighted material.<br />
Microsoft Corporation. All rights reserved. <a href="http://support.microsoft.com/tou/">Terms of Use</a> | <a href="http://support.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx">Trademarks</a></p>
<div class="aizatto_related_posts"><span class="aizatto_related_posts_header" >Related Articles or Pages</span><ul></ul></div>]]></content:encoded>
			<wfw:commentRss>http://ossmall.info/application-will-not-read-the-changes-made-to-appconfig-or-machineconfig-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

