用的是vs2005 2440A wince6.0
按照步骤加驱动后发现好像没有成功,
应该是先调用的DllEntry,串口DLL_PROCESS_ATTACH: 打印了 RETAILMSG(1,(TEXT("strINGS: DLL_PROCESS_ATTACH\n")));
之后就str_Init初始化 RETAILMSG(1,(TEXT("strINGS: str_Init\n"))); 接下问题来了,没有DLL_THREAD_ATTACH:这个部
分,一直显示DLL_THREAD_DETACH: 我就奇怪了,没有加载线程,为什么会一直卸载线程
没代码谁也不知道怎么回事,详细分析一下你的代码吧。
楼主还是 贴出 完整的串口打印信息,
另外附带一些相关代码,
这样大家才好给你分析。
MARK.
strINGS: DLL_PROCESS_ATTACH
strINGS: str_Init
strINGS: DLL_THREAD_DETACH
strINGS: DLL_THREAD_DETACH
strINGS: DLL_THREAD_DETACH
strINGS: DLL_THREAD_DETACH
strINGS: DLL_THREAD_DETACH
strINGS: DLL_THREAD_DETACH
strINGS: DLL_THREAD_DETACH
一直就显示这个了
str.CPP主要就是下面的东西,没有什么具体操作
DllEntry(HANDLE hinstDLL,
DWORD dwReason,
LPVOID lpvReserved )
{
//EdbgOutputDebugstring("str DLLENTRY HAS BEEN IN \n");
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
g_hInstance = hinstDLL;
RETAILMSG(1,(TEXT("strINGS: DLL_PROCESS_ATTACH\n")));
return TRUE;
case DLL_THREAD_ATTACH:
RETAILMSG(1,(TEXT("strINGS: DLL_THREAD_ATTACH\n")));
break;
case DLL_THREAD_DETACH:
RETAILMSG(1,(TEXT("strINGS: DLL_THREAD_DETACH\n")));
break;
case DLL_PROCESS_DETACH:
RETAILMSG(1,(TEXT("strINGS: DLL_PROCESS_DETACH\n")));
break;
case DLL_PROCESS_EXITING:
RETAILMSG(1,(TEXT("strINGS: DLL_PROCESS_EXITING\n")));
break;
case DLL_SYSTEM_STARTED:
RETAILMSG(1,(TEXT("strINGS: DLL_SYSTEM_STARTED\n")));
break;
}
// EdbgOutputDebugstring("str DLLENTRY HAS BEEN IN \n");
return TRUE;
}
DWORD str_Init(DWORD dwContext)
{
DWORD dwRet=0 ;
RETAILMSG(1,(TEXT("strINGS: str_Init\n")));
// Initialize buffer to zero.
memset (achBuffer, 0, BUFSIZE * sizeof(WCHAR));
// Set return value to non-zero.
dwRet = 1;
return dwRet;
}
[url=http://download.eeworld.net/source/1985540][/url]
WinCE下流驱动的示例代码,楼主可以下载来看看,参考一下。
呵呵,我一般找个驱动模板,修改。从头到尾我真没有做过。