<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Adobe RoboHelp 2019" />
<title>A red line may appear in C++ samples</title>
<link rel="StyleSheet" href="../../../ms_help.css" type="text/css" />
 <script type="text/javascript" language="JavaScript">
//<![CDATA[
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
     location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	onresize = reDo;
}
onerror = null; 
//]]>
</script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute;
left:0px;
top:0px;
z-index:4;
visibility:hidden; }
p.WebHelpNavBar { text-align:right; }
-->
</style>

<script type="text/javascript" src="../../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/constants.js"></script>
<script type="text/javascript" src="../../../template/scripts/utils.js"></script>
<script type="text/javascript" src="../../../template/scripts/mhutils.js"></script>
<script type="text/javascript" src="../../../template/scripts/mhlang.js"></script>
<script type="text/javascript" src="../../../template/scripts/mhver.js"></script>
<script type="text/javascript" src="../../../template/scripts/settings.js"></script>
<script type="text/javascript" src="../../../template/scripts/XmlJsReader.js"></script>
<script type="text/javascript" src="../../../template/scripts/loadparentdata.js"></script>
<script type="text/javascript" src="../../../template/scripts/loadscreen.js"></script>
<script type="text/javascript" src="../../../template/scripts/loadprojdata.js"></script>
<script type="text/javascript" src="../../../template/scripts/mhtopic.js"></script>
 <link rel="stylesheet" type="text/css" href="../../../template/styles/widgets.min.css">
 <link rel="stylesheet" type="text/css" href="../../../template/styles/topic.min.css">
<script type="text/javascript" >
gRootRelPath = "../../..";
gCommonRootRelPath = "../../..";
gTopicId = "5.2.4.0_1";
</script>
 <meta name="brsprev" value="sdk/component_object_model/sample/sample_program_list.htm">
 <meta name="brsnext" value="sdk/component_object_model/faq/an_error_is_displayed_when_referencing_cwaveformgeneratortlb_in_c_vb.htm">
 <meta name="topic-breadcrumbs" content="C-WaveformGenerator SDK > Componet Object Model > FAQ" />
</head>

<body>
<script type="text/javascript" src="../../../ehlpdhtm.js"></script>

<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P45RPFN" style="width: 0px; 
		 height: 0px; display: none; visibility: hidden;">
 <p>&#160;</p>
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->


<div><script type="text/javascript" language="javascript">//<![CDATA[
document.write("<p  style=\"text-align:left;\" class=\"breadcrumbs\">");
AddMasterBreadcrumbs("../../../c_waveformgenerator.htm", "breadcrumbs", " &gt; ", "Home", "../../../welcome/c_waveformgenerator.htm");
document.write("<a class=\"breadcrumbs\" href=\"../../welcome/CWaveformGeneratorSDK.htm\">C-WaveformGenerator SDK<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"../component_object_model.htm\">Componet Object Model<\/a>  &gt;  <a class=\"breadcrumbs\" href=\"red_underline_on_cpp_samples.htm\">FAQ<\/a>  &gt;  A red line may appear in C++ samples<\/p>");
//]]></script>
</div>

<h1>A red line may appear in C++ samples</h1>
<hr align="center" />
<p class="MsoNormal">CCWaveformGenerotor characters may show red lines 
 when describing examples of <a href="../tutorial/init_exit/init_exit.htm">C++ 
 Init and Exit Processing</a>.<br />
This is due to the effect of the &quot;#import&quot; statement.</p>
<p class="MsoNormal">By building the target project and rescanning the 
 solution, the red line will no longer be displayed.</p>
<p class="MsoNormal">&#160;</p>
<p class="MsoNormal">[Status]</p>
<p class="MsoNormal" style="margin-left: 40px;">&quot;#import&quot; is 
 used for <a href="../tutorial/create/visual_c_mfc.htm">Tutorial &gt; Create 
 Project</a>.<br />
<img src="red_underline_on_cpp_samples3.png" alt="" style=" border-left-style:Solid; border-left-width:1px; border-right-style:Solid; border-right-width:1px; border-top-style:Solid; border-top-width:1px; border-bottom-style:Solid; border-bottom-width:1px; width:100%; max-width:348px;" border="1" /></p>
<p class="MsoNormal" style="margin-left: 40px;">If you have never built 
 (compiled) this tutorial, a red line will be displayed as shown below.<br />
<img src="red_underline_on_cpp_samples1.png" alt="" style=" border-left-style:Solid; border-left-width:1px; border-right-style:Solid; border-right-width:1px; border-top-style:Solid; border-top-width:1px; border-bottom-style:Solid; border-bottom-width:1px; width:100%; max-width:483px;" border="1" /></p>
<p class="MsoNormal">&#160;</p>
<p class="MsoNormal">[Reason]</p>
<p class="MsoNormal" style="margin-left: 40px;">The &quot;#import&quot; 
 statement automatically creates two header files from the type library 
 (.tlb) specified in the #import statement during build (compilation). 
 (.tlh and .tli)</p>
<p class="MsoNormal" style="margin-left: 40px;">These two files (.tlh and 
 .tli) store information such as member functions in the type library.<br />
If these two files are not generated, member functions cannot be resolved 
 correctly.</p>
<p class="MsoNormal" style="margin-left: 40px;">For this reason, Visual 
 Studio determines that it is likely a mistake and displays a red line 
 under the member function name.</p>
<p class="MsoNormal">&#160;</p>
<p class="MsoNormal">[Workaround]</p>
<p class="MsoNormal" style="margin-left: 40px;">When you build (compile) 
 the project, these two files (.tlh and tli) are output.<br />
Then rescan the solution and the red line will no longer appear.</p>
<p class="MsoNormal" style="margin-left: 40px;"><img src="red_underline_on_cpp_samples2.png" alt="" style=" border-left-style:Solid; border-left-width:1px; border-right-style:Solid; border-right-width:1px; border-top-style:Solid; border-top-width:1px; border-bottom-style:Solid; border-bottom-width:1px; width:100%; max-width:492px;" border="1" /><br />
Example of initialization and termination processing (c++)</p>
<p class="MsoNormal">&#160;</p>
<p class="MsoNormal">[Reference]</p>
<p class="MsoNormal" style="margin-left: 40px;">For details on &quot;#import&quot;, 
 please refer to the following Microsoft website.</p>
<p class="MsoNormal" style="margin-left: 40px;">[#import directive (C++)]<br />
&#160;&#160;&#160;&#160;<a href="https://learn.microsoft.com/en-us/cpp/preprocessor/hash-import-directive-cpp?view=msvc-170" 
							 target="_blank">https://learn.microsoft.com/en-us/cpp/preprocessor/hash-import-directive-cpp?view=msvc-170</a></p>
<p class="MsoNormal">&#160;</p>
<p class="MsoNormal">&#160;</p>
<p class="MsoNormal">&#160;</p>
<p>&#160;</p>
<div style="width: 100%; position: relative;" id="footer">
	<hr style="float: aligncenter; " />
	<p>This website uses cookies. By continuing to browse our site you 
	 agree to our <a href="https://www.contec.com/privacy#anc-01">use of 
	 cookies</a>.</p>
</div>
</body>
</html>
