<?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"
	>

<channel>
	<title>VC基础编程</title>
	<atom:link href="http://www.netinformatique.info/feed" rel="self" type="application/rss+xml" />
	<link>http://www.netinformatique.info</link>
	<description>VC基础编程</description>
	<pubDate>Thu, 18 Sep 2008 11:55:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>[资源][编辑器]vc中的资源编辑器</title>
		<link>http://www.netinformatique.info/2008/09/4958.html</link>
		<comments>http://www.netinformatique.info/2008/09/4958.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 04:58:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[编辑器]]></category>

		<category><![CDATA[资源]]></category>

		<guid isPermaLink="false">/wp/?p=4958</guid>
		<description><![CDATA[新建Icon资源后,出现一个青色的空的32*32的icon,可以在其上画图,右边的颜色工具条里面有很多颜色供选择,里面有
2个特殊的颜色,一个是青色的,一个是粉红色的,好像是叫什么&#8221;屏幕背景颜色&#8221;,请问这2中颜色有何区别?????
如果你把青色的都擦出那么图标就变成白色的了。
青色是透明的那么那个粉红色的又是什么

我把整个图标用Inverse Color颜色刷了一下,让后将生成的图标放在桌面上,看起来就是透明的,好像没有什么反转的效果
楼上各位正解，实际上自己可以试一下。
 
]]></description>
			<content:encoded><![CDATA[<p>新建Icon资源后,出现一个青色的空的32*32的icon,可以在其上画图,右边的颜色工具条里面有很多颜色供选择,里面有<br />
2个特殊的颜色,一个是青色的,一个是粉红色的,好像是叫什么&#8221;屏幕背景颜色&#8221;,请问这2中颜色有何区别?????</p>
<p>如果你把青色的都擦出那么图标就变成白色的了。</p>
<p>青色是透明的那么那个粉红色的又是什么</p>
<p><img src="http://i.msdn.microsoft.com/Aa294168.v10sfsc(en-us,VS.60).gif" alt="" /></p>
<p>我把整个图标用Inverse Color颜色刷了一下,让后将生成的图标放在桌面上,看起来就是透明的,好像没有什么反转的效果</p>
<p>楼上各位正解，实际上自己可以试一下。</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4958.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[字符][替换]中间字符如何替换</title>
		<link>http://www.netinformatique.info/2008/09/4957.html</link>
		<comments>http://www.netinformatique.info/2008/09/4957.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 03:58:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[字符]]></category>

		<category><![CDATA[替换]]></category>

		<guid isPermaLink="false">/wp/?p=4957</guid>
		<description><![CDATA[我有一个数据表，表中纪录很多，其中有D22401-3YT2(大约有30条纪录），D22102-3YT12(大约有35条纪录），D224032-32YT2(大约也有30条纪录），D22121-5YT3（大约30多条纪录），现在问题是对D22401-3YT2,D22102-3YT12,D224032-32YT2中的YT变换为LY,但是对D22121-5YT3中的YT又不变换。我是用  REPL &#160; ALL &#160; XX &#160; WITH &#160;  &#39;D22401-3LY2 &#39; &#160; FOR &#160; TRIM(LL)== &#39;D22401-3YT2 &#39;这样的语句一个一个来实现的。  有没有一个语句能够同时将YT变换为LY呢？
use &#160; 表名  replace &#160; xx &#160; with &#160; strtran(xx, &#39;YT &#39;, &#39;LY &#39;) &#160; for &#160; alltrim(xx) &#60;&#62;  &#39;D22121-5YT3 &#39; 
 或 
 update &#160; 表名 &#160; set &#160; xx=strtran(xx, &#39;YT &#39;, [...]]]></description>
			<content:encoded><![CDATA[<p>我有一个数据表，表中纪录很多，其中有D22401-3YT2(大约有30条纪录），D22102-3YT12(大约有35条纪录），D224032-32YT2(大约也有30条纪录），D22121-5YT3（大约30多条纪录），现在问题是对D22401-3YT2,D22102-3YT12,D224032-32YT2中的YT变换为LY,但是对D22121-5YT3中的YT又不变换。我是用 <br /> REPL &nbsp; ALL &nbsp; XX &nbsp; WITH &nbsp;  &#39;D22401-3LY2 &#39; &nbsp; FOR &nbsp; TRIM(LL)== &#39;D22401-3YT2 &#39;这样的语句一个一个来实现的。 <br /> 有没有一个语句能够同时将YT变换为LY呢？</p>
<p>use &nbsp; 表名 <br /> replace &nbsp; xx &nbsp; with &nbsp; strtran(xx, &#39;YT &#39;, &#39;LY &#39;) &nbsp; for &nbsp; alltrim(xx) &lt;&gt;  &#39;D22121-5YT3 &#39; </p>
<p> 或 </p>
<p> update &nbsp; 表名 &nbsp; set &nbsp; xx=strtran(xx, &#39;YT &#39;, &#39;LY &#39;) &nbsp; where &nbsp; alltrim(xx) &lt;&gt;  &#39;D22121-5YT3 &#39;</td>
<p>我试了 <br /> UPDATE &nbsp; SS &nbsp; SET &nbsp; XX=STRTRAN(LJH, &#39;YT &#39;, &#39;LY &#39;) &nbsp; WHERE &nbsp;  &nbsp; HH= &#39;DD &#39; &nbsp; AND &nbsp; HH &lt;&gt;  &#39;DD-4308YTDB3 &#39; &nbsp; AND &nbsp; HH &lt;&gt;  &#39;DD-4308YTDB5 &#39; <br /> 但是没有任何用处， <br /> 是怎么回事？</td>
<p>UPDATE &nbsp; SS &nbsp; SET &nbsp; XX=STRTRAN(XX, &#39;YT &#39;, &#39;LY &#39;) &nbsp; WHERE &nbsp;  &nbsp; HH= &#39;DD &#39; &nbsp; AND &nbsp; HH &lt;&gt;  &#39;DD-4308YTDB3 &#39; &nbsp; AND &nbsp; HH &lt;&gt;  &#39;DD-4308YTDB5 &#39;  </td>
<p>哈哈，是我将字段名写错了，是可行的。多谢十三豆先生</td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4957.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[MSDN][列举][进程]MSDN中列举进程代码无法运行出结果问题</title>
		<link>http://www.netinformatique.info/2008/09/4956.html</link>
		<comments>http://www.netinformatique.info/2008/09/4956.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 03:58:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[MSDN]]></category>

		<category><![CDATA[列举]]></category>

		<category><![CDATA[进程]]></category>

		<guid isPermaLink="false">/wp/?p=4956</guid>
		<description><![CDATA[我复制了MSDN中列举所有进程的代码，但执行后无法打印出结果，  不知道是怎么回事：  BOOL GetProcessW1::GetProcessList(){  	HANDLE&#160; &#160; &#160; &#160;  hProcessSnap = NULL;   &#160; &#160; BOOL&#160; &#160; &#160; &#160; &#160;  bRet&#160; &#160; &#160; = FALSE;   &#160; &#160; PROCESSENTRY32 pe32&#160; &#160; &#160; = {0};  
 &#160; &#160; //&#160; Take a snapshot of all processes in the system.  [...]]]></description>
			<content:encoded><![CDATA[<p>我复制了MSDN中列举所有进程的代码，但执行后无法打印出结果， <br /> 不知道是怎么回事： <br /> BOOL GetProcessW1::GetProcessList(){ <br /> 	HANDLE&nbsp; &nbsp; &nbsp; &nbsp;  hProcessSnap = NULL;  <br /> &nbsp; &nbsp; BOOL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  bRet&nbsp; &nbsp; &nbsp; = FALSE;  <br /> &nbsp; &nbsp; PROCESSENTRY32 pe32&nbsp; &nbsp; &nbsp; = {0};  </p>
<p> &nbsp; &nbsp; //&nbsp; Take a snapshot of all processes in the system.  </p>
<p> &nbsp; &nbsp; hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);  </p>
<p> &nbsp; &nbsp; if (hProcessSnap == INVALID_HANDLE_VALUE)  <br /> &nbsp; &nbsp; &nbsp; &nbsp; return (FALSE);  </p>
<p> &nbsp; &nbsp; //&nbsp; Fill in the size of the structure before using it.  </p>
<p> &nbsp; &nbsp; pe32.dwSize = sizeof(PROCESSENTRY32);  </p>
<p> &nbsp; &nbsp; //&nbsp; Walk the snapshot of the processes, and for each process,  <br /> &nbsp; &nbsp; //&nbsp; display information.  </p>
<p> &nbsp; &nbsp; if (Process32First(hProcessSnap, &amp;pe32))  <br /> &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; DWORD&nbsp; &nbsp; &nbsp; &nbsp;  dwPriorityClass;  <br /> &nbsp; &nbsp; &nbsp; &nbsp; BOOL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bGotModule = FALSE;  <br /> &nbsp; &nbsp; &nbsp; &nbsp; MODULEENTRY32 me32&nbsp; &nbsp; &nbsp;  = {0};  </p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; do  <br /> &nbsp; &nbsp; &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bGotModule = GetProcessModule(pe32.th32ProcessID,  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pe32.th32ModuleID, &amp;me32, sizeof(MODULEENTRY32));  </p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (bGotModule)  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HANDLE hProcess;  </p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Get the actual priority class.  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hProcess = OpenProcess (PROCESS_ALL_ACCESS,  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FALSE, pe32.th32ProcessID);  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwPriorityClass = GetPriorityClass (hProcess);  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle (hProcess);  </p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Print the process&#39;s information.  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf( &quot;<br />
Priority Class Base	%d<br />
&quot;,  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pe32.pcPriClassBase);  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf( &quot;PID			%d<br />
&quot;, pe32.th32ProcessID); <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf( &quot;Thread Count		%d<br />
&quot;, pe32.cntThreads); <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf( &quot;Module Name		%s<br />
&quot;, me32.szModule); <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf( &quot;Full Path		%s</p>
<p>&quot;, me32.szExePath); </p>
<p> 				// <br /> 				CString str,strTemp=&quot; &quot;; <br /> 				str.Format(&quot;%d&quot;,pe32.pcPriClassBase); <br /> 				strTemp+=str; <br /> 				strTemp+=&quot;&nbsp; ;&nbsp; &quot;; </p>
<p> 				str.Format(&quot;%d&quot;,pe32.th32ProcessID); <br /> 				strTemp+=str; <br /> 				strTemp+=&quot;&nbsp; ;&nbsp; &quot;; </p>
<p> 				str.Format(&quot;%d&quot;,pe32.cntThreads); <br /> 				strTemp+=str; <br /> 				strTemp+=&quot;&nbsp; ;&nbsp; &quot;; </p>
<p> 				str.Format(&quot;%s&quot;,me32.szModule); <br /> 				strTemp+=str; <br /> 				strTemp+=&quot;&nbsp; ;&nbsp; &quot;; </p>
<p> 				str.Format(&quot;%s&quot;,me32.szExePath); <br /> 				strTemp+=str; <br /> 				strTemp+=&quot;&nbsp; ;&nbsp; &quot;; </p>
<p> 				pMainView-&gt;m_ProcessList.AddString(strTemp); </p>
<p> 				pMainView-&gt;UpdateData(FALSE); </p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; &nbsp; &nbsp; while (Process32Next(hProcessSnap, &amp;pe32));  <br /> &nbsp; &nbsp; &nbsp; &nbsp; bRet = TRUE;  <br /> &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; else  <br /> &nbsp; &nbsp; &nbsp; &nbsp; bRet = FALSE;&nbsp; &nbsp; // could not walk the list of processes  </p>
<p> &nbsp; &nbsp; // Do not forget to clean up the snapshot object.  </p>
<p> &nbsp; &nbsp; CloseHandle (hProcessSnap);  <br /> &nbsp; &nbsp; return (bRet);  </p>
<p> } </p>
<p> BOOL GetProcessModule (DWORD dwPID, DWORD dwModuleID,  <br /> &nbsp; &nbsp;  LPMODULEENTRY32 lpMe32, DWORD cbMe32)  <br /> {  <br /> &nbsp; &nbsp; BOOL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bRet&nbsp; &nbsp; &nbsp; &nbsp; = FALSE;  <br /> &nbsp; &nbsp; BOOL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bFound&nbsp; &nbsp; &nbsp; = FALSE;  <br /> &nbsp; &nbsp; HANDLE&nbsp; &nbsp; &nbsp; &nbsp; hModuleSnap = NULL;  <br /> &nbsp; &nbsp; MODULEENTRY32 me32&nbsp; &nbsp; &nbsp; &nbsp; = {0};  </p>
<p> &nbsp; &nbsp; // Take a snapshot of all modules in the specified process.  </p>
<p> &nbsp; &nbsp; hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwPID);  <br /> &nbsp; &nbsp; if (hModuleSnap == INVALID_HANDLE_VALUE)  <br /> &nbsp; &nbsp; &nbsp; &nbsp; return (FALSE);  </p>
<p> &nbsp; &nbsp; // Fill the size of the structure before using it.  </p>
<p> &nbsp; &nbsp; me32.dwSize = sizeof(MODULEENTRY32);  </p>
<p> &nbsp; &nbsp; // Walk the module list of the process, and find the module of  <br /> &nbsp; &nbsp; // interest. Then copy the information to the buffer pointed  <br /> &nbsp; &nbsp; // to by lpMe32 so that it can be returned to the caller.  </p>
<p> &nbsp; &nbsp; if (Module32First(hModuleSnap, &amp;me32))  <br /> &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; do  <br /> &nbsp; &nbsp; &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (me32.th32ModuleID == dwModuleID)  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CopyMemory (lpMe32, &amp;me32, cbMe32);  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bFound = TRUE;  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; &nbsp; &nbsp; while (!bFound &amp;&amp; Module32Next(hModuleSnap, &amp;me32));  </p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; bRet = bFound;&nbsp;  // if this sets bRet to FALSE, dwModuleID  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  // no longer exists in specified process  <br /> &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; else  <br /> &nbsp; &nbsp; &nbsp; &nbsp; bRet = FALSE;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  // could not walk module list  </p>
<p> &nbsp; &nbsp; // Do not forget to clean up the snapshot object.  </p>
<p> &nbsp; &nbsp; CloseHandle (hModuleSnap);  </p>
<p> &nbsp; &nbsp; return (bRet);  <br /> }  </p>
<p>编译之后有没有出错啊？？ <br /> 代码怎么可以全部复制呢？？&nbsp; 你得修改下 适合自己的工程啊&nbsp;  你看看里面的 CString&nbsp; 需要的是 mfc支持的&nbsp; &nbsp; printf&nbsp; 是控制台的 你建立工程的时候 选择对了没有？？必须的头文件包含了没有？？</td>
<p><fieldset><legend>引用 2 楼 rollrock1987 的回复:</legend> <br /> 编译之后有没有出错啊？？ <br /> 代码怎么可以全部复制呢？？&#10272;你得修改下 适合自己的工程啊&#10278;nbsp; 你看看里面的 CString&#10272;需要的是 mfc支持的&#10272;&#10272;printf&#10272;是控制台的 你建立工程的时候 选择对了没有？？必须的头文件包含了没有？？ <br /> </fieldset> <br /> 编译是没有问题的，问题也不是出在这里。问题是程序根本没有进入到打印那段语句块里面，也就是说 <br /> if (bGotModule) 中的bGotModule始终是为FALSE的，含CString那一段是我自己加入的</td>
<p>me32.dwSize = sizeof(MODULEENTRY32); </td>
<p><fieldset><legend>引用 4 楼 jacklzw88 的回复:</legend> <br /> me32.dwSize = sizeof(MODULEENTRY32); <br /> </fieldset> <br /> ？？，程序中有这一句呀</td>
<p>单步调试下,看到什么地方运行不下去了?</td>
<p><fieldset><legend>引用 6 楼 yjgx007 的回复:</legend> <br /> 单步调试下,看到什么地方运行不下去了? <br /> </fieldset> <br /> 运行得下去，就是运行GetProcessModule返回FALSE，不知道怎么回事，帮忙调试一下，谢谢</td>
<p>经过试验得出，如果不判断dwModuleID，则可以得到信息，在我的机器上me32.th32ModuleID 一直为1，而传入的dwModuleID为0 <br /> //&nbsp; do  <br /> &nbsp; &nbsp; &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  // if (me32.th32ModuleID == dwModuleID)  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CopyMemory (lpMe32, &amp;me32, cbMe32);  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bFound = TRUE;  <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; &nbsp; &nbsp; }  <br /> &nbsp; &nbsp; &nbsp;  // while (!bFound &amp;&amp; Module32Next(hModuleSnap, &amp;me32)); </td>
<p>//以前写的，模拟任务管理器的 <br /> HANDLE snapshot; <br /> 	snapshot=::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); <br /> 	PROCESSENTRY32 processliststr[50]; <br /> 	for(int j=0;j &lt;50;j++) <br /> 	processliststr[j].dwSize=sizeof(PROCESSENTRY32); <br /> 	BOOL return_value; <br /> 	int i=0; <br /> &nbsp; &nbsp; &nbsp; &nbsp; int m; <br /> 	return_value=::Process32First(snapshot,&amp;processliststr[i]); <br /> 	m_showlist.DeleteAllItems(); </p>
<p> 	CString str; </p>
<p> 	while(return_value)	 <br /> 	{		 <br /> &nbsp; &nbsp; &nbsp; m=m_showlist.InsertItem(i,(LPTSTR)processliststr[i].szExeFile); <br /> 	&nbsp;  <br /> 	&nbsp; str.Format(&quot;%d&quot;,processliststr[i].cntThreads); <br /> 	&nbsp; m_showlist.SetItemText(m,1,str); <br /> &nbsp; &nbsp; &nbsp; &nbsp;  <br /> 	&nbsp; str.Format(&quot;%d&quot;,processliststr[i].th32ProcessID);&nbsp;  <br /> 	&nbsp; m_showlist.SetItemText(m,2,str); <br /> &nbsp; &nbsp; &nbsp;  <br /> 	&nbsp; str.Format(&quot;%d&quot;,processliststr[i].pcPriClassBase); <br /> 	&nbsp; m_showlist.SetItemText(m,3,str); <br /> 		&nbsp; &nbsp; &nbsp;  	&nbsp; &nbsp;  </p>
<p> 	&nbsp; m_ProcessIndex[i]=processliststr[i].th32ProcessID; <br /> 	&nbsp; i++; <br /> 	&nbsp; return_value=::Process32Next(snapshot,&amp;processliststr[i]);	&nbsp;  <br /> &nbsp; &nbsp;  <br /> 	}  </td>
<p><fieldset><legend>引用 7 楼 RedskyDeng 的回复:</legend> <br /> 引用 6 楼 yjgx007 的回复: <br /> 单步调试下,看到什么地方运行不下去了? </p>
<p> 运行得下去，就是运行GetProcessModule返回FALSE，不知道怎么回事，帮忙调试一下，谢谢 <br /> </fieldset> <br /> 你自已调试下,在GetProcessModule里面step into, 看到哪里不执行返回FALSE?</td>
<p><fieldset><legend>引用 8 楼 cwc270 的回复:</legend> <br /> 经过试验得出，如果不判断dwModuleID，则可以得到信息，在我的机器上me32.th32ModuleID 一直为1，而传入的dwModuleID为0 <br /> //&#10272;do <br /> { <br /> // if (me32.th32ModuleID == dwModuleID) <br /> { <br /> CopyMemory (lpMe32, &amp;me32, cbMe32); <br /> bFound = TRUE; <br /> } <br /> } <br /> // while (!bFound &amp;&amp; Module32Next(hModuleSnap, &amp;me32)); <br /> </fieldset> <br /> 的确，请问是怎么回事，我把这个判断去掉就OK了，MSDN中的这个判断是什么意思？</td>
<p>me32.dwSize = sizeof(MODULEENTRY32);  </p>
<p> 你自己再仔细看看。</td>
<p><fieldset><legend>引用 12 楼 jacklzw88 的回复:</legend> <br /> me32.dwSize = sizeof(MODULEENTRY32); </p>
<p> 你自己再仔细看看。 <br /> </fieldset> <br /> 没搞懂，请指点</td>
<p>th32ModuleID  <br /> Module identifier of the process. The contents of this member has meaning only to the tool help functions. It is not a handle, nor is it usable by functions other than the ToolHelp functions.  </p>
<p> th32ModuleID  <br /> Module identifier in the context of the owning process. The contents of this member has meaning only to the tool help functions. It is not a handle, nor is it usable by functions other than the ToolHelp functions.  </p>
<p> 看下这两段英文就明白了&#8230;仅仅是对函数调用产生影响，用于模块比较是错误的&#8230;  </td>
<p><fieldset><legend>引用 14 楼 gavin1203 的回复:</legend> <br /> th32ModuleID <br /> Module identifier of the process. The contents of this member has meaning only to the tool help functions. It is not a handle, nor is it usable by functions other than the ToolHelp functions. </p>
<p> th32ModuleID <br /> Module identifier in the context of the owning process. The contents of this member has meaning only to the tool help functions. It is not a handle, nor is it usable by func… <br /> </fieldset> <br /> 是呀，你的这个英文文档哪里面的，我的代码可是在MSDN中的，不是我自己写的，我搞不大明白了</td>
<p>调整权集，将运行级上调到最高</td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4956.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[顶级][复杂][richedit]顶级复杂的 richedit 乱码问题。。。吐血狂晕~~</title>
		<link>http://www.netinformatique.info/2008/09/4955.html</link>
		<comments>http://www.netinformatique.info/2008/09/4955.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 02:57:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[richedit]]></category>

		<category><![CDATA[复杂]]></category>

		<category><![CDATA[顶级]]></category>

		<guid isPermaLink="false">/wp/?p=4955</guid>
		<description><![CDATA[不知道大家用过Nero 刻录软件没有，我正在改里面的一个终极郁闷的问题，用尽了一切手段和方法也搞不定！  问题如下： 
 编辑菜单的时候 ，输入框采用richedit，创建方法如下： 
  bool cr = RichEditCtrl::Create(0, WS_CHILD &#124;&#160; (m_singleLine ? 0 : (ES_WANTRETURN &#124; ES_MULTILINE)), Rect(-1, -1, -1, -1), parent, 1);  &#160; &#160; if (cr) {  &#160; &#160; &#160; SetEventMask(ENM_CHANGE &#124; ENM_KEYEVENTS &#124; ENM_SELCHANGE);  &#160; &#160; &#160; SetTextMode(TM_PLAINTEXT);  &#160; &#160; &#160; Subclass();  &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>不知道大家用过Nero 刻录软件没有，我正在改里面的一个终极郁闷的问题，用尽了一切手段和方法也搞不定！ <br /> 问题如下： </p>
<p> 编辑菜单的时候 ，输入框采用richedit，创建方法如下： </p>
<p>  bool cr = RichEditCtrl::Create(0, WS_CHILD |&nbsp; (m_singleLine ? 0 : (ES_WANTRETURN | ES_MULTILINE)), Rect(-1, -1, -1, -1), parent, 1); <br /> &nbsp; &nbsp; if (cr) { <br /> &nbsp; &nbsp; &nbsp; SetEventMask(ENM_CHANGE | ENM_KEYEVENTS | ENM_SELCHANGE); <br /> &nbsp; &nbsp; &nbsp; SetTextMode(TM_PLAINTEXT); <br /> &nbsp; &nbsp; &nbsp; Subclass(); <br /> &nbsp; &nbsp; &nbsp; return true; <br /> &nbsp; &nbsp; } <br />  调入微软全拼，输入没有任何乱码问题，但是全拼输入时，输入法输入框跑到了屏幕最顶端。而且不能够使用输入法的选择词语功能。 <br />  我们这边的一位高手，找了一个参数ES_SELFIME解决了这个问题如下， </p>
<p>  bool cr = RichEditCtrl::Create(0, WS_CHILD |<span style="color:#FF0000">ES_SELFIME</span>|&nbsp; (m_singleLine ? 0 : (ES_WANTRETURN | ES_MULTILINE)), Rect(-1, -1, -1, -1), parent, 1); <br /> &nbsp; &nbsp; if (cr) { <br /> &nbsp; &nbsp; &nbsp; SetEventMask(ENM_CHANGE | ENM_KEYEVENTS | ENM_SELCHANGE); <br /> &nbsp; &nbsp; &nbsp; SetTextMode(TM_PLAINTEXT); <br /> &nbsp; &nbsp; &nbsp; Subclass(); <br /> &nbsp; &nbsp; &nbsp; return true; <br /> &nbsp; &nbsp; } <br /> 结果输入法位置一切正常了，但是输入汉字的时候会出现乱码！！！ 然后我就开始了慢慢查找乱码的旅途。 结果发现 <br /> // get required length (use user-specified CR translation setting) <br /> &nbsp; GETTEXTLENGTHEX gtl; <br /> &nbsp; gtl.codepage = 1200; <br /> &nbsp; gtl.flags = GTL_NUMBYTES | ((flags &amp; GT_USECRLF) ? GTL_USECRLF : GTL_DEFAULT); <br /> &nbsp; int size = (int)SendMessage(EM_GETTEXTLENGTHEX, (WPARAM)&amp;gtl, 0); <br /> &nbsp; if (size  &lt;= 0) <br /> &nbsp; &nbsp; return size; </p>
<p> &nbsp; wchar_t* p = new wchar_t[size]; </p>
<p> &nbsp; // get text <br /> &nbsp; GETTEXTEX gt; <br /> &nbsp; gt.cb = size * sizeof(wchar_t); <br /> &nbsp; gt.codepage = 1200; <br /> &nbsp; gt.flags = flags; <br /> &nbsp; gt.lpDefaultChar = 0; <br /> &nbsp; gt.lpUsedDefChar = 0; <br /> &nbsp; int rc = (int)SendMessage(EM_GETTEXTEX, (WPARAM)&amp;gt, (LPARAM)p); <br /> &nbsp; buffer = String(p, rc); <br /> &nbsp; delete[] p; <br /> &nbsp; 获取到的输入就是乱码 <br /> &nbsp; 本系统是 纯英文的vista 操作系统，软件在2005中编译，编译参数加了UNICODE <br /> &nbsp; 也采用了 richedit2.0 unicode版本了 <br /> &nbsp; LoadLibrary(L&quot;RICHED32.DLL&quot;); <br />  // LoadLibrary(L&quot;RICHED20.DLL&quot;); <br />  请问大家能不能帮我分析一下，我真是不尽感激。。 </p>
<p>据说，微软输入法，输出的unicode，而全拼或智能ABC输出都是ANSI，自己转换吧</td>
<p><fieldset><legend>引用 2 楼 w_anthony 的回复:</legend> <br /> 据说，微软输入法，输出的unicode，而全拼或智能ABC输出都是ANSI，自己转换吧 <br /> </fieldset></td>
<p>无视我的话吧，我自己建了一个unicode工程，发现RichEdit2可以用全拼输入。 <br /> 资源里面相关行就是这样简单的一句 <br /> &nbsp; &nbsp; CONTROL&nbsp; &nbsp; &nbsp; &nbsp;  &quot;&quot;,IDC_RICHEDIT21,&quot;RichEdit20A&quot;,ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP,7,7,200,101  </td>
<p>不太明白，加上ES_SELFIME 后，所有输入发都有乱码了，不是所有都是乱码，有些字乱码？有些字不是乱码？</td>
<p>http://msdn2.microsoft.com/en-us/library/bb774250(VS.85).aspx <br /> 具体设置成什么参数？？ IMF_DUALFONT？？  </td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4955.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[应用程序][求救]VC如何呼出应用程序呀求救</title>
		<link>http://www.netinformatique.info/2008/09/4954.html</link>
		<comments>http://www.netinformatique.info/2008/09/4954.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 01:58:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[应用程序]]></category>

		<category><![CDATA[求救]]></category>

		<guid isPermaLink="false">/wp/?p=4954</guid>
		<description><![CDATA[当前运行一个程序，欲呼出的程序为非当前窗口，自己定义一个热键如F11，按F11后使自己的程序在当前窗口显示  请前辈们不吝赐教。。。。。
求教。。
注册系统热键？  RegisterHotKey  然后 映射 ON_MESSAGE(WM_HOTKEY,&#160;  OnHotKey)  在 OnHotKey 函数中激活 自己的程序
装一个钩子,在钩子里判断窗口,然后SetWindowPos()
小弟新手，不知该从何入手，还望给出部分代码，不胜感激
另外，热键已经定义好了，用RegisterHotKey,只是不清楚如何呼出该程序
 头文件定义   afx_msg LRESULT OnHotKey(WPARAM wparam,LPARAM lparam);  在程序初始话中定义 RegisterHotKey (this-&#62;GetSafeHwnd(),1,MOD_CONTROL,&#39;B&#39;);//Ctrl+B 呼出  我是加在 OnInitDialog 里面  消息映射   BEGIN_MESSAGE_MAP(CdlgDlg, CDialog)  	ON_WM_SYSCOMMAND()  	ON_WM_PAINT()  	ON_WM_QUERYDRAGICON()  	//}}AFX_MSG_MAP 
 	ON_MESSAGE(WM_HOTKEY,&#160; OnHotKey)  
 END_MESSAGE_MAP()  函数 [...]]]></description>
			<content:encoded><![CDATA[<p>当前运行一个程序，欲呼出的程序为非当前窗口，自己定义一个热键如F11，按F11后使自己的程序在当前窗口显示 <br /> 请前辈们不吝赐教。。。。。</p>
<p>求教。。</td>
<p>注册系统热键？ <br /> RegisterHotKey <br /> 然后 映射 ON_MESSAGE(WM_HOTKEY,&nbsp;  OnHotKey) <br /> 在 OnHotKey 函数中激活 自己的程序</td>
<p>装一个钩子,在钩子里判断窗口,然后SetWindowPos()</td>
<p>小弟新手，不知该从何入手，还望给出部分代码，不胜感激</td>
<p>另外，热键已经定义好了，用RegisterHotKey,只是不清楚如何呼出该程序</td>
<p> 头文件定义  <br /> afx_msg LRESULT OnHotKey(WPARAM wparam,LPARAM lparam); <br /> 在程序初始话中定义 RegisterHotKey (this-&gt;GetSafeHwnd(),1,MOD_CONTROL,&#39;B&#39;);//Ctrl+B 呼出 <br /> 我是加在 OnInitDialog 里面 <br /> 消息映射  <br /> BEGIN_MESSAGE_MAP(CdlgDlg, CDialog) <br /> 	ON_WM_SYSCOMMAND() <br /> 	ON_WM_PAINT() <br /> 	ON_WM_QUERYDRAGICON() <br /> 	//}}AFX_MSG_MAP </p>
<p> 	ON_MESSAGE(WM_HOTKEY,&nbsp; OnHotKey)  </p>
<p> END_MESSAGE_MAP() <br /> 函数 <br /> LRESULT&nbsp; CdlgDlg::OnHotKey(WPARAM wparam,LPARAM lparam) <br /> { <br /> 	ShowWindow(SW_RESTORE);&nbsp;   <br /> 	SetForegroundWindow();&nbsp;   </p>
<p> 	return 0L; </p>
<p> } <br /> 2005下通过 ，你要是6.0 好像函数返回void的？ </p>
</td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4954.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[DrawText][改变][输出]DrawText如何改变输出的字体</title>
		<link>http://www.netinformatique.info/2008/09/4953.html</link>
		<comments>http://www.netinformatique.info/2008/09/4953.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 00:58:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[DrawText]]></category>

		<category><![CDATA[改变]]></category>

		<category><![CDATA[输出]]></category>

		<guid isPermaLink="false">/wp/?p=4953</guid>
		<description><![CDATA[原码是 
 hdc = BeginPaint(hWnd, &#38;ps);  RECT rt;  GetClientRect(hWnd, &#38;rt); 
 DrawText(hdc, szHello, strlen(szHello), &#38;rt, DT_LEFT);  EndPaint(hWnd, &#38;ps); 
 是输出SZHELLO,想改变这个输出的字体，应该怎么做呢??
搞定,结帖给分!

]]></description>
			<content:encoded><![CDATA[<p>原码是 </p>
<p> hdc = BeginPaint(hWnd, &amp;ps); <br /> RECT rt; <br /> GetClientRect(hWnd, &amp;rt); </p>
<p> DrawText(hdc, szHello, strlen(szHello), &amp;rt, DT_LEFT); <br /> EndPaint(hWnd, &amp;ps); </p>
<p> 是输出SZHELLO,想改变这个输出的字体，应该怎么做呢??</p>
<p>搞定,结帖给分!</td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4953.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[使用][DirectDraw][显示]如何使用DirectDraw 显示图象序列</title>
		<link>http://www.netinformatique.info/2008/09/4952.html</link>
		<comments>http://www.netinformatique.info/2008/09/4952.html#comments</comments>
		<pubDate>Wed, 17 Sep 2008 23:57:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[DirectDraw]]></category>

		<category><![CDATA[使用]]></category>

		<category><![CDATA[显示]]></category>

		<guid isPermaLink="false">/wp/?p=4952</guid>
		<description><![CDATA[我正做一个图象序列显示程序，图象序列是352*288分辨率的，是用directshow捕获的，用StretchDIBits &#160; 定时显示图象序列，但是如果要在上面添加文字什么的，闪烁感比较强，所以想采用DirectDraw来实现，我看了CSDN上老的帖子，http://topic.csdn.net/t/20020522/17/744153.html &#160; 上面xzhangjie（飞天狐狸）发了一个类  #include &#160;  &#160;  &#160;  &#34;DDraw.h &#34; &#160;  &#160;  &#160;  &#160;  &#160;    &#160;  &#160; class &#160;  &#160;  &#160; CDDraw &#160;  &#160;  &#160;  &#160;  &#160;  &#160;  &#160;    &#160;  [...]]]></description>
			<content:encoded><![CDATA[<p>我正做一个图象序列显示程序，图象序列是352*288分辨率的，是用directshow捕获的，用StretchDIBits &nbsp; 定时显示图象序列，但是如果要在上面添加文字什么的，闪烁感比较强，所以想采用DirectDraw来实现，我看了CSDN上老的帖子，http://topic.csdn.net/t/20020522/17/744153.html &nbsp; 上面xzhangjie（飞天狐狸）发了一个类 <br /> #include &nbsp;  &nbsp;  &nbsp;  &quot;DDraw.h &quot; &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; class &nbsp;  &nbsp;  &nbsp; CDDraw &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; public: &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; void &nbsp;  &nbsp;  &nbsp; CleanUp(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; void &nbsp;  &nbsp;  &nbsp; DrawDIB(BITMAPINFOHEADER* &nbsp;  &nbsp;  &nbsp; pBI,char* &nbsp;  &nbsp;  &nbsp; pData,RECT*rt); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; BOOL &nbsp;  &nbsp;  &nbsp; Init(HWND &nbsp;  &nbsp;  &nbsp; hWnd,int &nbsp;  &nbsp;  &nbsp; nWidth,int &nbsp;  &nbsp;  &nbsp; nHeight); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; CDDraw(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; virtual &nbsp;  &nbsp;  &nbsp; ~CDDraw(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; private: &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; HWND &nbsp;  &nbsp;  &nbsp; m_hDrawWnd; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; LPDIRECTDRAW &nbsp;  &nbsp;  &nbsp; lpDD; &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; DirectDraw &nbsp;  &nbsp;  &nbsp; 对象 &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; LPDIRECTDRAWSURFACE &nbsp;  &nbsp;  &nbsp; lpDDSPrimary; &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; DirectDraw &nbsp;  &nbsp;  &nbsp; 主页面 &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; LPDIRECTDRAWSURFACE &nbsp;  &nbsp;  &nbsp; lpBackdds; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; LPDIRECTDRAWCLIPPER &nbsp;  &nbsp;  &nbsp; lpClipperBack; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; }; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; CDDraw::CDDraw() &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDD=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDDSPrimary=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpBackdds=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpClipperBack=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; CDDraw::~CDDraw() &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpDD!=NULL)CleanUp(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; BOOL &nbsp;  &nbsp;  &nbsp; CDDraw::Init(HWND &nbsp;  &nbsp;  &nbsp; hWnd,int &nbsp;  &nbsp;  &nbsp; nWidth,int &nbsp;  &nbsp;  &nbsp; nHeight) &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(hWnd==NULL) &nbsp;  &nbsp;  &nbsp; return &nbsp;  &nbsp;  &nbsp; FALSE; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; m_hDrawWnd=hWnd; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(DirectDrawCreate(NULL,&amp;lpDD,NULL)!=DD_OK)return &nbsp;  &nbsp;  &nbsp; FALSE; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDD-&gt; SetCooperativeLevel(hWnd, &nbsp;  &nbsp;  &nbsp; DDSCL_NORMAL); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; DDSURFACEDESC &nbsp;  &nbsp;  &nbsp; ddsd; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.dwSize &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; sizeof( &nbsp;  &nbsp;  &nbsp; ddsd &nbsp;  &nbsp;  &nbsp; ); &nbsp;  &nbsp;  &nbsp; //结构的大小 &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.dwFlags &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; DDSD_CAPS; &nbsp;  &nbsp;  &nbsp; //指定DDSURFACEDESC结构的ddsCaps成员为可用 &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.ddsCaps.dwCaps &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; DDSCAPS_PRIMARYSURFACE; &nbsp;  &nbsp;  &nbsp; //指定要创建的是主页面 &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; //创建主页面对象 &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if &nbsp;  &nbsp;  &nbsp; ( &nbsp;  &nbsp;  &nbsp; lpDD-&gt; CreateSurface( &nbsp;  &nbsp;  &nbsp; &amp;ddsd, &nbsp;  &nbsp;  &nbsp; &amp;lpDDSPrimary, &nbsp;  &nbsp;  &nbsp; NULL &nbsp;  &nbsp;  &nbsp; ) &nbsp;  &nbsp;  &nbsp; != &nbsp;  &nbsp;  &nbsp; DD_OK) &nbsp;  &nbsp;  &nbsp; return &nbsp;  &nbsp;  &nbsp; FALSE; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpDD-&gt; CreateClipper(NULL,&amp;lpClipperBack,NULL)!=DD_OK) &nbsp;  &nbsp;  &nbsp; return &nbsp;  &nbsp;  &nbsp; FALSE; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpClipperBack-&gt; SetHWnd(0,hWnd); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDDSPrimary-&gt; SetClipper(lpClipperBack); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpClipperBack-&gt; Release(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpClipperBack=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.dwFlags &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; DDSD_CAPS &nbsp;  &nbsp;  &nbsp; | &nbsp;  &nbsp;  &nbsp; DDSD_HEIGHT &nbsp;  &nbsp;  &nbsp; | &nbsp;  &nbsp;  &nbsp; DDSD_WIDTH; &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.ddsCaps.dwCaps &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; DDSCAPS_OFFSCREENPLAIN; &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.dwHeight &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; nHeight; &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ddsd.dwWidth &nbsp;  &nbsp;  &nbsp; = &nbsp;  &nbsp;  &nbsp; nWidth; &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpDD-&gt; CreateSurface(&amp;ddsd, &nbsp;  &nbsp;  &nbsp; &amp;lpBackdds, &nbsp;  &nbsp;  &nbsp; NULL)!=DD_OK) &nbsp;  &nbsp;  &nbsp; return &nbsp;  &nbsp;  &nbsp; FALSE; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; return &nbsp;  &nbsp;  &nbsp; TRUE; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; void &nbsp;  &nbsp;  &nbsp; CDDraw::DrawDIB(BITMAPINFOHEADER &nbsp;  &nbsp;  &nbsp; *pBI, &nbsp;  &nbsp;  &nbsp; char &nbsp;  &nbsp;  &nbsp; *pData, &nbsp;  &nbsp;  &nbsp; RECT &nbsp;  &nbsp;  &nbsp; *rt) &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; RECT &nbsp;  &nbsp;  &nbsp; srt; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; srt.left=0; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; srt.top=0; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; srt.right=pBI-&gt; biWidth; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; srt.bottom=pBI-&gt; biHeight; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; HDC &nbsp;  &nbsp;  &nbsp; hDC; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpBackdds-&gt; GetDC(&amp;hDC); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; SetDIBitsToDevice( &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; hDC, &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; 0, &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; 0, &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; pBI-&gt; biWidth, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; source &nbsp;  &nbsp;  &nbsp; rectangle &nbsp;  &nbsp;  &nbsp; width &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; pBI-&gt; biHeight, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; source &nbsp;  &nbsp;  &nbsp; rectangle &nbsp;  &nbsp;  &nbsp; height &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; 0, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; x-coord &nbsp;  &nbsp;  &nbsp; of &nbsp;  &nbsp;  &nbsp; source &nbsp;  &nbsp;  &nbsp; lower-left &nbsp;  &nbsp;  &nbsp; corner &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; 0, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; y-coord &nbsp;  &nbsp;  &nbsp; of &nbsp;  &nbsp;  &nbsp; source &nbsp;  &nbsp;  &nbsp; lower-left &nbsp;  &nbsp;  &nbsp; corner &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; 0, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; first &nbsp;  &nbsp;  &nbsp; scan &nbsp;  &nbsp;  &nbsp; line &nbsp;  &nbsp;  &nbsp; in &nbsp;  &nbsp;  &nbsp; array &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; pBI-&gt; biHeight, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; number &nbsp;  &nbsp;  &nbsp; of &nbsp;  &nbsp;  &nbsp; scan &nbsp;  &nbsp;  &nbsp; lines &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; pData, &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; array &nbsp;  &nbsp;  &nbsp; of &nbsp;  &nbsp;  &nbsp; DIB &nbsp;  &nbsp;  &nbsp; bits &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; (const &nbsp;  &nbsp;  &nbsp; struct &nbsp;  &nbsp;  &nbsp; tagBITMAPINFO*)pBI, &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; bitmap &nbsp;  &nbsp;  &nbsp; information &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; DIB_RGB_COLORS &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp;  &nbsp; // &nbsp;  &nbsp;  &nbsp; RGB &nbsp;  &nbsp;  &nbsp; or &nbsp;  &nbsp;  &nbsp; palette &nbsp;  &nbsp;  &nbsp; indexes &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; ); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpBackdds-&gt; ReleaseDC(hDC); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDDSPrimary-&gt; Blt(rt,lpBackdds,&amp;srt,0,NULL); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; void &nbsp;  &nbsp;  &nbsp; CDDraw::CleanUp() &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpDD!=NULL) &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpClipperBack!=NULL) &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpClipperBack-&gt; Release(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpClipperBack=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpDDSPrimary!=NULL) &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDDSPrimary-&gt; Release(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDDSPrimary=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; if(lpBackdds!=NULL) &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; { &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpBackdds-&gt; Release(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpBackdds=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDD-&gt; Release(); &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; lpDD=NULL; &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br />  &nbsp;  &nbsp; } &nbsp;  &nbsp;  &nbsp;  <br /> 但是无法显示图象序列，序列已从32位转成24位RGB &nbsp;  &nbsp;  <br />  &nbsp;  <br /> 哪位大哥能告诉我原因啊？谢谢了 &nbsp;  &nbsp;  &nbsp;  </p>
<p> 我的邮箱:jiaqicx@163.com</p>
<p>大家帮帮忙啊 &nbsp; 谢谢了</td>
<p>自己顶  </td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4952.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[强制][结束][进程]如何强制结束一个进程</title>
		<link>http://www.netinformatique.info/2008/09/4951.html</link>
		<comments>http://www.netinformatique.info/2008/09/4951.html#comments</comments>
		<pubDate>Wed, 17 Sep 2008 23:57:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[强制]]></category>

		<category><![CDATA[结束]]></category>

		<category><![CDATA[进程]]></category>

		<guid isPermaLink="false">/wp/?p=4951</guid>
		<description><![CDATA[在多线程调试的时候(XP操作系统下)，经常会出现死机的现象，不得不进行重启才能解决。  后来找到一个名为antifreeze的国外软件，在几乎死机的时候还可以调用该程序，将环境进程结束掉。  另外发现，VC环境下，在设置断点断下的时候，这个时候即使用任务管理器无法将此刻调试的进程结束掉，这是为什么？ 
 我的问题是，在系统几乎死机的时候，如果让自己的程序还能获取CPU分配的时间，将我需要结束的进程结束掉？谢谢 
 普通方法都试了，不行，因为多线程死机的时候，几乎没有程序可以响应了。
有些时候是死在内核模式下，这时候进程管理器通常无法结束。或许有些情况可以利用驱动程序在内核模式下结束进程。
引用 1 楼 jameshooo 的回复:  一个偏方：在你的程序中启动一个console窗口，然后执行调试去，如果出现任何问题，console窗口还是能响应的，直接关闭console窗口就能退出你的进程   
 能具体给出实例吗？谢谢！
LS的方法不错，学习了！
引用 1 楼 jameshooo 的回复:  一个偏方：在你的程序中启动一个console窗口，然后执行调试去，如果出现任何问题，console窗口还是能响应的，直接关闭console窗口就能退出你的进程   
 mark
AllocConsole/FreeConsole即可
多线程调试的时候,确实是会经常假死，但是可以用以下方法解决（本人经验。^^)  打开记事本，写一些东西，别保存，当调试发生假死的时候。可以按ctrl+alt+del选择注销，系统会把VC给结束掉，之后会问时候保存文件，点取消即可恢复正常。从而避免重新启动机器。 
 以前编译过一个GINA（代码不是我的）。就是对付VC调试造成系统假死的。同样有效。 
 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;  我的问题是，在系统几乎死机的时候，如果让自己的程序还能获取CPU分配的时间，将我需要结束的进程结束掉？谢谢  
 普通方法都试了，不行，因为多线程死机的时候，几乎没有程序可以响应了。  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-  你说的这些话是不对的，首先假死的时候，系统还可以快速响应热键！例如ctrl+alt+del，antifreeze也是如此。其次，发生假死的时候CPU空闲接近100%！不信你就按下热键，选择任务管理器。第三，antifreeze接收到热键，会切换到另外一个桌面，并挂起所有的线程，结束进程应该是TerminateProcess，我在调试器里发现它被调用。第四，要结束的进程不是被调试进程，而是VC。
关注 接分

]]></description>
			<content:encoded><![CDATA[<p>在多线程调试的时候(XP操作系统下)，经常会出现死机的现象，不得不进行重启才能解决。 <br /> 后来找到一个名为antifreeze的国外软件，在几乎死机的时候还可以调用该程序，将环境进程结束掉。 <br /> 另外发现，VC环境下，在设置断点断下的时候，这个时候即使用任务管理器无法将此刻调试的进程结束掉，这是为什么？ </p>
<p> 我的问题是，在系统几乎死机的时候，如果让自己的程序还能获取CPU分配的时间，将我需要结束的进程结束掉？谢谢 </p>
<p> 普通方法都试了，不行，因为多线程死机的时候，几乎没有程序可以响应了。</p>
<p>有些时候是死在内核模式下，这时候进程管理器通常无法结束。或许有些情况可以利用驱动程序在内核模式下结束进程。</td>
<p><fieldset><legend>引用 1 楼 jameshooo 的回复:</legend> <br /> 一个偏方：在你的程序中启动一个console窗口，然后执行调试去，如果出现任何问题，console窗口还是能响应的，直接关闭console窗口就能退出你的进程 <br /> </fieldset> </p>
<p> 能具体给出实例吗？谢谢！</td>
<p>LS的方法不错，学习了！</td>
<p><fieldset><legend>引用 1 楼 jameshooo 的回复:</legend> <br /> 一个偏方：在你的程序中启动一个console窗口，然后执行调试去，如果出现任何问题，console窗口还是能响应的，直接关闭console窗口就能退出你的进程 <br /> </fieldset> </p>
<p> mark</td>
<p>AllocConsole/FreeConsole即可</td>
<p>多线程调试的时候,确实是会经常假死，但是可以用以下方法解决（本人经验。^^) <br /> 打开记事本，写一些东西，别保存，当调试发生假死的时候。可以按ctrl+alt+del选择注销，系统会把VC给结束掉，之后会问时候保存文件，点取消即可恢复正常。从而避免重新启动机器。 </p>
<p> 以前编译过一个GINA（代码不是我的）。就是对付VC调试造成系统假死的。同样有效。 </p>
<p> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; <br /> 我的问题是，在系统几乎死机的时候，如果让自己的程序还能获取CPU分配的时间，将我需要结束的进程结束掉？谢谢  </p>
<p> 普通方法都试了，不行，因为多线程死机的时候，几乎没有程序可以响应了。 <br /> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- <br /> 你说的这些话是不对的，首先假死的时候，系统还可以快速响应热键！例如ctrl+alt+del，antifreeze也是如此。其次，发生假死的时候CPU空闲接近100%！不信你就按下热键，选择任务管理器。第三，antifreeze接收到热键，会切换到另外一个桌面，并挂起所有的线程，结束进程应该是TerminateProcess，我在调试器里发现它被调用。第四，要结束的进程不是被调试进程，而是VC。</td>
<p>关注 接分</td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4951.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[动态][创建][ActiveX]动态创建ActiveX的问题</title>
		<link>http://www.netinformatique.info/2008/09/4950.html</link>
		<comments>http://www.netinformatique.info/2008/09/4950.html#comments</comments>
		<pubDate>Wed, 17 Sep 2008 21:57:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[activex]]></category>

		<category><![CDATA[创建]]></category>

		<category><![CDATA[动态]]></category>

		<guid isPermaLink="false">/wp/?p=4950</guid>
		<description><![CDATA[ATL下面想动态创建一个ActiveX，主要代码如下：  HRESULT hr;   	RECT&#160;  rc;&#160;    	GetClientRect(&#38;rc);  
 	LPOLESTR pstrbrowserid;&#160;    	StringFromCLSID(IID_ICortona, &#38;pstrbrowserid);&#160;    	CComBSTR bstrbrowser(pstrbrowserid);&#160;    	CoTaskMemFree(pstrbrowserid);  
 	HWND hwnd; 
 	hwnd = m_axNestedControl.Create(m_hWnd, rc, 0, WS_CHILD &#124; WS_VISIBLE);&#160;    	hr = m_axNestedControl.CreateControlEx((LPCOLESTR)bstrbrowser, NULL, NULL, reinterpret_cast &#60;IUnknown**&#62;(&#38;m_pICortona));&#160;  [...]]]></description>
			<content:encoded><![CDATA[<p>ATL下面想动态创建一个ActiveX，主要代码如下： <br /> HRESULT hr; <br />  	RECT&nbsp;  rc;&nbsp;   <br /> 	GetClientRect(&amp;rc);  </p>
<p> 	LPOLESTR pstrbrowserid;&nbsp;   <br /> 	StringFromCLSID(IID_ICortona, &amp;pstrbrowserid);&nbsp;   <br /> 	CComBSTR bstrbrowser(pstrbrowserid);&nbsp;   <br /> 	CoTaskMemFree(pstrbrowserid);  </p>
<p> 	HWND hwnd; </p>
<p> 	hwnd = m_axNestedControl.Create(m_hWnd, rc, 0, WS_CHILD | WS_VISIBLE);&nbsp;   <br /> 	hr = m_axNestedControl.CreateControlEx((LPCOLESTR)bstrbrowser, NULL, NULL, reinterpret_cast &lt;IUnknown**&gt;(&amp;m_pICortona));&nbsp;   </p>
<p> 调试到这里来时hr显示“没有注册类别”，可我明明已经注册了这个ActiveX啊，GUID也没错，会是什么问题呢？</p>
<p>我把StringFromCLSID换成了StringFromIID，结果还是一样，hr显示“没有注册类别”，还有别的什么问题吗？</td>
<p>已经说了，要用CLSID，不能用IID</td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4950.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[游戏][源码][突破]如何看游戏源码才能更快突破</title>
		<link>http://www.netinformatique.info/2008/09/4949.html</link>
		<comments>http://www.netinformatique.info/2008/09/4949.html#comments</comments>
		<pubDate>Wed, 17 Sep 2008 20:57:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[VC/MFC]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[游戏]]></category>

		<category><![CDATA[源码]]></category>

		<category><![CDATA[突破]]></category>

		<guid isPermaLink="false">/wp/?p=4949</guid>
		<description><![CDATA[公司给了个游戏项目的源码，但感觉好多Global Macrot，Global Variable, Global Function 。我应该怎样突破
一个一个来  神挡杀神佛挡杀佛
看结构先，一般都会有该函数或模块的简要解释  大体结构流程先看，不用细看每个函数，知道是干嘛用的就行(如果条件允许，先让经理或组长把整个流畅串一遍)  结构框架了解了之后，再细看你需要的部分，  当然你也可以直接看相关部分，我个人觉得有个结构性的认识对局部理解有很大帮助 
 全局宏很多是调试用的，而全局变量和函数在成熟的项目上是要尽量避免的，所以应该不多才对，先不用管，  全局意味着多处用到，你刚开始肯定不知道在哪用到，等用到的时候跟踪下就是了  
分模块熟悉，比如说，玩家、怪物、地图场景、网络通讯、数据库
引用 2 楼 hucailai 的回复:  一个一个来   神挡杀神佛挡杀佛  

]]></description>
			<content:encoded><![CDATA[<p>公司给了个游戏项目的源码，但感觉好多Global Macrot，Global Variable, Global Function 。我应该怎样突破</p>
<p>一个一个来 <br /> 神挡杀神佛挡杀佛</td>
<p>看结构先，一般都会有该函数或模块的简要解释 <br /> 大体结构流程先看，不用细看每个函数，知道是干嘛用的就行(如果条件允许，先让经理或组长把整个流畅串一遍) <br /> 结构框架了解了之后，再细看你需要的部分， <br /> 当然你也可以直接看相关部分，我个人觉得有个结构性的认识对局部理解有很大帮助 </p>
<p> 全局宏很多是调试用的，而全局变量和函数在成熟的项目上是要尽量避免的，所以应该不多才对，先不用管， <br /> 全局意味着多处用到，你刚开始肯定不知道在哪用到，等用到的时候跟踪下就是了  </td>
<p>分模块熟悉，比如说，玩家、怪物、地图场景、网络通讯、数据库</td>
<p><fieldset><legend>引用 2 楼 hucailai 的回复:</legend> <br /> 一个一个来  <br /> 神挡杀神佛挡杀佛 <br /> </fieldset></td>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.netinformatique.info/2008/09/4949.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
