分类目录
文章索引模板
20090112 rundll32.exe devmgr.dll DeviceProperties_RunDLL - 八月 18, 2009 by yippee

怎样调用设备管理器中某个硬件的属性对话框 VC/MFC / 硬件/系统 – CSDN社区 community.csdn.net
http://topic.csdn.net/t/20030728/15/2080998.html

CodeProject: Device Property Sheet Dialog. Free source code and programming help
http://www.codeproject.com/KB/system/DevicePropertySheet.aspx?display=Print

如何调用设备属性对话框从应用程序或从命令提示符
http://support.microsoft.com/kb/815320

设备管理器的实现 – ljkong的专栏 – CSDNBlog
http://blog.csdn.net/ljkong/archive/2005/01/17/256742.aspx

关于PDEVICEPROPERTIES的问题 向高手们请教
http://topic.csdn.net/u/20080204/09/3bb0f1fc-5c7f-4af5-b618-778f40b8cd71.html

DeviceProperties_RunDLL Function Prototype
http://msdn.microsoft.com/en-us/library/aa476915.aspx

CodeProject: Device Property Sheet Dialog. Free source code and programming help
http://www.codeproject.com/KB/system/DevicePropertySheet.aspx?fid=83880&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26
#define DeviceProperties_RunDLL "DeviceProperties_RunDLLA" typedef void (_stdcall *PDEVICEPROPERTIES)( HWND hwndStub, HINSTANCE hAppInstance, LPSTR lpCmdLine, int nCmdShow );

Windows XP Control Panel, Shortcuts and Control.exe
http://vlaurie.com/computers2/Articles/control.htm

How to Configure Device Manager to Display Detailed Information
http://www.digitalsupporttech.com/kb/304514/
Click Start, click Run, type cmd.exe, and then press ENTER.
2. Type set DEVMGR_SHOW_DETAILS=1, and then press ENTER.
3. Type start devmgmt.msc, and then press ENTER. In Device Manager the properties for a device should now provide a Details tab that contains additional information about the device.

How to change COM port number – CodeGuru Forums
http://www.codeguru.com/forum/showthread.php?t=375882

How to invoke the device Properties dialog box from the application or from a command prompt
http://www.digitalsupporttech.com/mskb/815/815320_How_to_invoke_the_device_Properties_dialog_box_from_the_application_or_from_a_command_prompt.htm
rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID "PCI\\VEN_8086&DEV_2445 &SUBSYS_010E1028&REV_12\\3&172E68DD&0&FD"

How to change COM port number – technical discussion – developerFusion – the global developer community
http://www.developerfusion.com/forum/thread/34271/

Dx21 – RunDLL32
http://www.dx21.com/coding/libraries/rundll32/Default.aspx?ID=203
You can open the properties dialog of any device attached to your computer and listed in the Device Manager by calling the devmgr.dll, using the DeviceProperties_RunDLL function with the /DeviceID and the registry path of the device.

The registry path of the device starts at HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Enum and is typically the next three folders down (starting with ACPI, Root, HID, etc.).  The target folder will contain the ClassGUID key.

Example calls:

Rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID ACPI\\PNP0000\\4&11876118&0
Rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID Root\\VSO_IOCD\\0000
Rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID HID\\Vid_046d&Pid_c404\\6&1ee4c77f&0&0000
 

    RUNDLL32.EXE devmgr.dll DeviceProperties_RunDLL /DeviceID &leftsign;Key\\Key\\Key&rightsign;

JSI Tip 5680. How can I add a Details tab to the Windows XP Device Manager Properties dialog?
http://windowsitpro.com/articles/index.cfm?articleid=76984

Failure to Navigate to Device Driver under SYSTEM in Contr..
http://forum.soft32.com/windows/Failure-Navigate-Device-Driver-SYSTEM-Control-Panel-ftopict278299.html

JSI Tip 6490. How do I invoke the device Properties dialog box from the command line?
http://windowsitpro.com/article/articleid/77792/jsi-tip-6490-how-do-i-invoke-the-device-properties-dialog-box-from-the-command-line.html
To invoke the device Properties dialog from the command line, see the following examples:

rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID root\\system\\0000

rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID ACPI_HAL\\PNP0C08\\0

rundll32.exe devmgr.dll DeviceProperties_RunDLL /DeviceID "PCI\\VEN_8086&DEV_2445 &SUBSYS_010E1028&REV_12\\3&172E68DD&0&FD"

CodeProject: Changing your Windows audio device programmatically using VC++. Free source code and programming help
http://www.codeproject.com/KB/system/AudioConfigurationManager.aspx

标签:, ,
20080805 firefox dev addon info - 三月 31, 2009 by yippee

20080805 firefox dev addon info
http://www.yippeesoft.com

手工收集

Firefox是一款基于Gecko引擎,开放源代码的浏览器,不仅体积小、速度快,而且完全支持W3C标准,可应用于Windows、Linux和MacOS平台。。由于Firefox的一个最重要的特性就是支持扩展插件,因此通过安装扩展插件就可以最大限度的扩展其功能。

基于 Mozilla 的扩展开发

Firefox扩展开发

Mozilla开发者中心

XUL用来开发界面的,JavaScript用来做事件处理的,CSS用来做样式单的,DOM用来操作节点的

http://xinsync.xju.edu.cn/index.php/archives/2135
在eclipse中动态开发Firefox扩展

http://ted.mielczarek.org/code/mozilla/extensiondev/
The Extension Developer\’s Extension exists to make life easier for Firefox extension developers. Testing JavaScript code, prototyping XUL layouts, and building XPI packages are all made easier by this extension. Install it and try it out!

http://my.donews.com/lerosua/page/2/
Vim keys in firefox

今天找到一个firefox的好功能。就是将页面浏览的快捷键设置为VIM的hjkl方式。
Vim keys in firefox

http://www.kevinfreitas.net/extensions/measureit/
MeasureIt 0.3.8 MeasureIt

Draw a ruler across any webpage to check the width, height, or alignment of page elements in pixels.

http://cybernetnews.com/2008/06/24/myfive-firefox-3-chrome-urls/
MyFive: Firefox 3 Chrome URL’s

http://kb.mozillazine.org/Dev_:_Firefox_Chrome_URLs
Dev : Firefox Chrome URLs

http://www.mail-archive.com/ubuntu-bugs@lists.ubuntu.com/msg924448.html
Navigation buttons greyed out

http://forums.mozillazine.org/viewtopic.php?f=7&p=4023595
Chrome via bookmarklet?

http://www.firefoxfacts.com/2008/06/24/open-bookmark-manager-in-your-browser-window/
Open Bookmark Manager in Your Browser Window

1. 首先需要建立多个 firefox 的配置文件。

开始 – 运行 – firefox -profilemanager

说明:两个firefox 不能使用同一个 profile 文件,否则会提示“firefox 已经在运行…”

2. 修改启动的快捷方式

说明:-P 表示使用 guoshuang 这个profile 配置; -no-remote 打开另外一个实例。

相关资料:

windows 命令脚本

set MOZ_NO_REMOTE=1

“C:Program FilesMozilla Firefoxfirefox.exe” -P guoshuang
http://blog.guoshuang.com/?p=4887同时运行多个Firefox实例的方法是:

\\path\\to\\firefox.exe -P buffy -no-remote
$ export MOZ_NO_REMOTE=1 && /path/to/firefox -P Buffy

set MOZ_NO_REMOTE=1
“C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe” -P blogging

有兴趣可以试一下,同时运行两个完全不一样的Firefox,还能用不同的版本。

据说加上NO_REMOTE之后,就不能接受外部链接了,所以要想继续接受外部来的链接,还是留一个普通的Fx。

另一个有用的是

Firefox.exe -install-global-extension “\\extname.xpi”

也就是在存在多个Profile的时候,可以用这个命令来为它们同时安装某个扩展。

http://www.zeali.net/entry/567
Firefox扩展开发学习杂记

标签:, , , ,

20080229 PL/SQL Developer ActiveX Server - 十一月 25, 2008 by yippee

20080229 PL/SQL Developer ActiveX Server
http://www.yippeesoft.com

PL/SQL Developer v7.1.4中文简介:
集成的Oracle数据库开发环境,专门用于开发、测试、调试和优化Oracle PL/SQL存储程序单元,比如触发器等。PL/SQL Developer功能十分全面,大大缩短了程序员的开发周期。
English Product Description:for cehx.com
PL/SQL Developer is an Integrated Development Environment that is
specifically targeted at the development of stored program units for Oracle
Databases. Over time we have seen more and more business logic and
application logic move into the Oracle Server, so that PL/SQL programming
has become a significant part of the total development process. PL/SQL
Developer focuses on ease of use, code quality and productivity, key
advantages during Oracle application development.

VSPM 虚拟串口软件可以将TCP/IP、UDP广播映射成本机的虚拟COM 口,应用程序通过访问虚拟串口,就可以完成远程控制、数据传输等功能。
通过扩展DLL,可以实现串口互通、协议分析、数据采集等功能,提供例程代码。
此软件可免费用于商业用途,例如串口服务器、无线DTU产品配套等。 
软件QQ群:28173573
Ver2.65(2008-1-17)主要更新:
1.修正Service模式问题
2.增加一些插件
3.文档升级
京金华科技专业研发生产串口服务器、CAN-bus转以太网、开关量及模拟量转以太网产品。

    PL/SQL Developer是一种集成的开发环境,专门用于开发、测试、调试和优化Oracle PL/SQL存储程序单元,比如触发器等。PL/SQL Developer功能十分全面,大大缩短了程序员的开发周期。强大的PL/SQL编辑器,完善的Debugger调试器(需要Oracle 7.3.4或以上版本)询问创建\\SQL视窗\\命令视窗\\报告视窗\\项目\\浏览器\\过程优化\\HTML手册\\Non-PL/SQL目标\\模板目录\\比较用户目标\\输出用户目标\\工具\\lug-In扩展\\Multi-threaded IDE\\简单的安装(本软件由allroundautomations中国区总代理www.softwarecn.com 授权发布。)。

    ActiveX .exe .dll Server都可以设定成多执行绪,但手册上面得大多有看没有
懂,尤其是Project本身可设定多执行绪,而Class又可设定成MultiUSe,搞得不是
很清楚,在经过一些testing後,整理出一些东西,以补足手册上的不清楚,看完它
再去看手册的说明就会比较清楚啦(我想)。如果我的观念有误,也请更正。

MyProject       假设有一个ActiveX Server,其内有一个Class和.bas Module组成
   &line;
   +- Class
   &line;     &line;
   &line;     +— MyClass
   &line;              Public  cp as long
   &line;              Private cv as Long
   &line;              Public Sub cFunc1()
   &line;                   .
   &line;                   .
   &line;              End Function
   &line;              Public Sub cFunc2()
   &line;                   .
   &line;                   .
   &line;              End Sub
   &line;
   +- Module
         &line;
         +— MyBas.Bas
                  Public basVar as long
                  Public Sub Sub1()
                         .
                         .
                  End Sub

一、Myproject为ActiveX .exe Server
   1.MyProject设定成单一执行绪
     a.Myclass 为MultiUse
       表示该Class的每一个Instance都是固定由某一个Thread来执行,
       所谓MultiUse便是单一个执行绪可对多个Instance提供服务
      
       client A 的程式                 client B 的程式
         dim  aa as New MyClass           dim bb as New Myclass
         Call aa.cFunc1                   Call bb.cFunc2

       如上例,ClientA ClientB同时对某一部电脑上的MyProject提出需求,
       此时,第一个呼叫它的程式(假设是Call aa.cFunc1)将该Server叫起来了,
       如果此时ClientB也对之提出要求,那麽的ClinetA aa这个instance和
       Client B的bb Instance共用同一个Thread,也就是说这两个Instance必
       需进入排程,共用一个Thread的情况又有什麽特性呢?此时aa, bb共用
       MyBas.Bas内的资料,如上例中的basVar会共用,不论是改了它都会影响
       另一个人,但是bb, aa这两个Class Instance有自己的变数,即aa 有自己
       cp, cv的变数,bb也有自己的,这就是所谓的公寓模式,在.clx内的东西
       各人有各人的,但共用.bas的资料。以这个例子来说,如果aa.cFunc1已在
       执行,而且它是一个Long Job,而 bb.cFunc2也要来执行时,它便得进入
       Queue中等待,所以会有交通阻塞的情况。

      b.SingleUse
        表示某个Class的instance 只在一个Thread上执行,同样以上面的例子来看
        aa 这个Instance产生了,那它在Thread1 上执行,而同时bb也产生了,那
        它会在另一个Thread2上执行,而Thread1, Thread2本身有自己的区域资料
        ,所以aa, bb就不会用MyBas.Bas内的任何资料,正因aa, bb在不同的thread
        上执行,所以它们两个便以排程的方式来执行,不会有谁先做,另一个人一定
        得等,aa的thread先做,做了一段时间後会Swap变bb的Thread做,所以有可能
        bb.cFunc2先完成。但缺点是浪费Resource。不要被MyProject的单一执行绪给
        骗了,它是设成单一执行绪,但Class设成SingleUse时,仍有可能是
        MultiThread的Server

       另一个例子:
       Myproject中有二个Class,Class1为MultiUse, Class2为SingleUse
       且有一个MyBas.Bas Module
         Dim aa as New Class1
         Dim bb as New Class1
         Dim aa2 as New Class2
         Dim bb2 as New Class2
         aa.method1
         aa2.method2
         bb.func1
         bb2,func2

        则aa, aa2, bb 共用mybas.bas之资料,bb2没有共用,aa, bb同一个thread
        没有问题,aa2呢?那是因为SingleUse对象是Class,方才的thread虽有aa, bb
        於其上,但那是Class1, Class2尚未有Instance於thread上,故选择方才的
        thread来执行,而bb2自然得在另一个Thread上啦。这个前提是只有一个Client
        来执行,如果有两个以上Client时,我们不知执行的前後顺序,所以不易预测
        谁和谁共用资料。而我们可透过App.ThreadId来取得Thread的id,以上例来说
        如果於Class1, Class2中各有引用App.ThreadId时,会发现aa, aa2, bb所取得
        的是相同的,而bb2所取得者不相同。    

   2.MyProject设成多执行绪
        假设我们设定MyProject有4个Thread (T1 to T4)                               

       T1
        &line;
        &line;
  T4 —+—- T2
        &line;
        &line;
       T3                  如果有Client1 to 3 呼叫Server的顺序如下

   ClassA (multiUse)            client1 要求 ClassA –>A1 则於 T1执行
   ClassB (MultiUse)            client2 要求 ClassA –>A2  ..  T2 ..
   ClassC (multiUse)            client1  ..  ClassB –>B1  ..  T3 ..
   Mybas.bas                    client3  ..  ClassC –>C3  ..  T4 ..
                                client2  ..  ClassC –>C2  ..  T1 ..
                                client1  ..  ClassC –>C1  ..  T2 ..

  也就是说,Client 端每产生一个Instance,该Instance便会一在下一个Thread上
  执行,如此的循环,所以这个例子来看,变成A1, C2共用mybas.bas的资料,A2, C1
  是另一组共用者。如此造成谁和共用资料十分不明确,不过定的是每个.clx都有自己
  的资料,符合公寓式模型。
         
  另外,如果Instance A1(Client1所产生的ClassA Instance)於T1中执行,而A1中
  去Create Instance B时,If使用New指令则Instance B也在T1中执行,故和A1共用
  Mybas.Bas但,使用CreateObject则Instabce B会在T2中执行。

  至於三个Class中有一个是SingleUse时会如何,本人已没有再测下去,可以知道的是
  SingleUse的Class会找一个没有执行同一Class的Thread来执行,但如果4个Thread
  都有时,会不会产生第五个Thread来做,可能吧,没有力testing了。

  3.MyProject设成独立执行绪
    同多执行绪,只是没有限制thread个数。

 
二、MyProject  是ActiveX. Dll Server
    因是.Dll 的方式存在,所以Class不可能是SingleUse,因为一个Process
    一不能有相同的两份.dll
   1.MyProject设单一执行绪
 
     客户端多执行绪.exe 有Thread 1 -3
 
       thread1, thread2, thread3同时要求该class时,则後到的要等待
     前面的处理完才能做,因该Server只有单一执行绪。各个Instance
     共用.Bas内的资料。

   2.MyProject设成公寓模型(多执行绪)
      同上的状况来说,Thread1- 3 对该Class的运作,就没有谁等谁的情况。
      因为 多执行绪.exe的各个Thread,都定义了Dll Server中的一问公寓
      ,所有在执行绪中所建之的物件都住在该执行绪定义的公寓中,除非Thread3
      使用Thread2的物件方法,那这呼叫会被排在Thread2本身目前正在处理的
      物件之後(循序化)。
               

标签:, , , ,
20071017 SharpDevelop - 七月 10, 2008 by yippee

20071017 SharpDevelop
http://www.yippeesoft.com

SharpDevelop对VS.Net的模拟算是非常高的了。首先是IntelliSense ,我以前试用过几个.Net的编辑器,如PrimeCode,Visual SlickEdit等,觉得没有一个比得上他。其次是功能布局和VS的IDE极为相似,没有VS的复杂,但在保留VS IDE的大部分主要功能时,还增加了一些体贴的功能。目前只支持WinForm/Component 开发,不支持Asp.Net或WebService,不过这不是主要的,真的太庞大了反而存在各种各样的问题。

 

 

  下面主要介绍SharpDevelop的一些特性。

1.  工程的导入导出。可将VS2002,VS2003的项目和SharpDevelop的Combine Project进行相互转化。不过感觉对多工程项目的转换存在一些缺陷。File à Import Project / Export Project.

2.  程序集分析。执行View à Assembly Analyzer

  

3.  程序集。执行View à Assembly Scout

4.  由于SharpDevelop本身已经集成了NDoc,NUnit等,所在在生成文档和进行单元测试时非常方便。

5.  一些有用的插件

自动代码生成

看到了吧,可以自动生成撤消/重做机制的代码,使用的是栈的方式。还可以去研究研究一些其他的东西哦。

6.  比较体贴的工具栏

右键点击Toolbar à Configure Sidebar ,配置组件

7.  转换代码编写风格

8.  项目选项

编译输出类型比VS提供的多了一个模块输出的选项

更改运行时和编译器

9.  在文件中搜索或替换,Search à Find In Files / Replace In Files

10.  代码计算,Edit à Word Count

11.  SharpDevelop也提供了一个有用的类库,SharpZipLib,是不是觉得比较眼熟?

在实际的做一个项目的时候,往往有很多分开的程序文件和资源文件,在编译的时候使用命令行的编译器参数选项将这些分散的文件组合起来,当文件很多的时候,写编译命令将非常复杂,好在几乎所有的IDE都为我们提供了解决方案,在Visual Studio .Net中是使用一个Project的配置文件,但是在LINUX下,一般编译都是使用一个叫做Makefile的配置文件(给Make命令使用)。那么如何可以将VS.Net的项目方便的在Linux上进行编译呢?这里介绍一个小工具:prj2make#

prj2make#是forge.novell.com上的一个开源项目,完全用C#编写,用途是将Visual Studio .Net或者SharpDevelop的项目文件转换成makefile文件(目前仅支持C#的项目),支持的文件有vs.net的sln,csproj 和ShareDevelop的cmbx,prjx。

SharpDevelop是一个功能完备的免费IDE。本书全面介绍了SharpDevelop开发人员如何利用C#从头到尾实现SharpDevelop的各种界面和功能,从而展示了一个大型C#软件项目的开发过程以及在这个开发过程中所涉及到的具体编程技术、决策思想、问题和解决方案等内容。 本书非常适合那些有一定编程经验并想全面掌握软件项目开发过程以及相关技术的中高级C#开发人员。也可以作为各高等院校和软件学院在软件开发项目方面的参考书目。

 

#develop (short for SharpDevelop) is a free IDE for C#, VB.NET and Boo projects on Microsoft\’s .NET platform. It is open-source, and you can download both sourcecode and executables from this site. In addition, you can find the latest information and changes on #develop, as well as get in touch with the team in the forum.

We are going to add more content (and new releases) over the coming months, so sign up for our announcement list! Also, we want to invite you to participate in the forums, discussing SharpDevelop – its features, feature requests and of course bugs.

 Library to enable user space application programs to communicate with USB devices
Download libusb

SharpDevelop is an open source IDE for the .NET platform. It is entirely written in C#, and supports various project types in multiple programming languages.

标签:,
20070611 .NET Framework Developer’s Guide  how to - 二月 19, 2008 by yippee

20070611 .NET Framework Developer\’s Guide  how to
http://www.yippeesoft.com

.NET Framework Developer\’s Guide
How to: Use Smartphone Menus

To conform to the Smartphone user interface, the .NET Compact Framework enforces the following menu restrictions:

    *

      You can only have two top-level menu items.
    *

      Only the second top-level menu item, on the right side of the form, can have submenus.

Note that the .NET Compact Framework does not enforce these restrictions at design time, but does throw a NotSupportedException at run time if your code does not follow them.

At run time, you cannot delete a top-level menu item. However, you can set Enabled property of a MenuItem to an empty string ("") to make a menu item appear invisible.

Visual Studio automatically adds a MainMenu component to your form when you create Smartphone and Pocket PC applications, but does not add it to child forms. The MainMenu component operates the Smartphone soft keys, but you cannot program their functionality unless you remove the MainMenu component from the form. For more information about programming soft keys, see Using Smartphone Back Key and Soft Keys.

To associate a method with a menu selection, provide code for the Click event for a MenuItem.
Example

This example defines a menu system for a scenario of selecting maps:

    *

      On the left is the Map Help menu item, which has event handling code that displays a message box.
    *

      On the right is the Maps menu item, which has two children: My Maps and Add and Remove. These children have, respectively, five and two children of their own.

Visual Basic

Imports System Imports System.Windows.Forms  Public Class Form1     Inherits System.Windows.Forms.Form     Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu     Private WithEvents mi1 As New MenuItem     Private mi2 As New MenuItem     Private miChildA As New MenuItem     Private miChildB As New MenuItem     Private WithEvents miGrandChildA1 As New MenuItem     Private WithEvents miGrandChildA2 As New MenuItem     Private WithEvents miGrandChildA3 As New MenuItem     Private WithEvents miGrandChildA4 As New MenuItem     Private WithEvents miGrandChildA5 As New MenuItem     Private WithEvents miGrandChildB1 As New MenuItem     Private WithEvents miGrandChildB2 As New MenuItem      Public Sub New()         MyBase.New()          InitializeComponent()          \’Define and add menu items.         MainMenu1.MenuItems.Add(mi1)         MainMenu1.MenuItems.Add(mi2)         mi2.MenuItems.Add(miChildA)         mi2.MenuItems.Add(miChildB)         miChildA.MenuItems.Add(miGrandChildA1)         miChildA.MenuItems.Add(miGrandChildA2)         miChildA.MenuItems.Add(miGrandChildA3)         miChildA.MenuItems.Add(miGrandChildA4)         miChildA.MenuItems.Add(miGrandChildA5)         miChildB.MenuItems.Add(miGrandChildB1)         miChildB.MenuItems.Add(miGrandChildB2)         mi1.Text = "Map Help"         mi2.Text = "Maps"         miChildA.Text = "My Maps"         miChildB.Text = "Add and remove"         miGrandChildA1.Text = "Manhattan"         miGrandChildA2.Text = "Bronx"         miGrandChildA3.Text = "Brooklyn"         miGrandChildA4.Text = "Queens"         miGrandChildA5.Text = "Staten Island"         miGrandChildB1.Text = "Add map"         miGrandChildB2.Text = "Delete map"      End Sub          Public Shared Sub Main()         Application.Run(New Form1)     End Sub      \’Form overrides dispose to clean up the component list.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)         MyBase.Dispose(disposing)     End Sub      Private Sub InitializeComponent()         Me.MainMenu1 = New System.Windows.Forms.MainMenu()         Me.Menu = Me.MainMenu1         Me.Text = "Form1"     End Sub      \’ The following subroutine handles the      \’ Click event for the mi1 MenuItem.     Private Sub mi1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mi1.Click         MessageBox.Show("This is just a test.")     End Sub  End Class

C#

using System; using System.Windows.Forms;  namespace SmartphoneMenus &leftsign;     public class Form1 : System.Windows.Forms.Form     &leftsign;         private System.Windows.Forms.MainMenu mainMenu1;          private MenuItem mi1 = new MenuItem();         private MenuItem mi2 = new MenuItem();         private MenuItem miChildA = new MenuItem();         private MenuItem miChildB = new MenuItem();         private MenuItem miGrandChildA1 = new MenuItem();         private MenuItem miGrandChildA2 = new MenuItem();         private MenuItem miGrandChildA3 = new MenuItem();         private MenuItem miGrandChildA4 = new MenuItem();         private MenuItem miGrandChildA5 = new MenuItem();         private MenuItem miGrandChildB1 = new MenuItem();         private MenuItem miGrandChildB2 = new MenuItem();          public Form1()         &leftsign;             InitializeComponent();               mainMenu1.MenuItems.Add(mi1);             mainMenu1.MenuItems.Add(mi2);             mi2.MenuItems.Add(miChildA);             mi2.MenuItems.Add(miChildB);             miChildA.MenuItems.Add(miGrandChildA1);             miChildA.MenuItems.Add(miGrandChildA2);             miChildA.MenuItems.Add(miGrandChildA3);             miChildA.MenuItems.Add(miGrandChildA4);             miChildA.MenuItems.Add(miGrandChildA5);             miChildB.MenuItems.Add(miGrandChildB1);             miChildB.MenuItems.Add(miGrandChildB2);              // Event handler for the top left menu.             mi1.Click +=new EventHandler(mi1_Click);             // Event handlers for grandchild menu items. This code is commented out            // because this example does not define their event handling methods.             // miGrandChildA1.Click +=new EventHandler(miGrandChildA1_Click);             // miGrandChildB1.Click +=new EventHandler(miGrandChildB1_Click);             // miGrandChildB2.Click +=new EventHandler(miGrandChildB2_Click);             mi1.Text = "Map Help";             mi2.Text = "Maps";             miChildA.Text = "My Maps";             miChildB.Text = "Add and remove";             miGrandChildA1.Text = "Manhattan";             miGrandChildA2.Text = "Bronx";             miGrandChildA3.Text = "Brooklyn";             miGrandChildA4.Text = "Queens";             miGrandChildA5.Text = "Staten Island";             miGrandChildB1.Text = "Add map";             miGrandChildB2.Text = "Remove map";          &rightsign;         protected override void Dispose( bool disposing )         &leftsign;             base.Dispose( disposing );         &rightsign;          private void InitializeComponent()         &leftsign;             this.mainMenu1 = new System.Windows.Forms.MainMenu();             this.Menu = this.mainMenu1;             this.Text = "Form1";          &rightsign;          static void Main()         &leftsign;             Application.Run(new Form1());         &rightsign;          // The following method handles the         // Click event for the mi1 MenuItem.         private void mi1_Click(object sender, EventArgs e)         &leftsign;             MessageBox.Show("This is just a test.");         &rightsign;     &rightsign; &rightsign;

Compiling the Code

This example requires references to the following namespaces:

    *

      System
    *

      System.Windows.Forms

How to: Set Smartphone Input Modes

You can set the input mode for a TextBox in a Smartphone application to ABC, T9, and numeric input modes as defined by the InputMode enumeration. The InputModeEditor class provides access to Smartphone input methods for entering text.

The AlphaCurrent mode is the preferred input mode value for text boxes used for alpha characters. This mode matches the mode selected by holding down the star (*) key on the Smartphone.

You cannot use InputModeEditor to explicitly change casing settings for alpha input modes. However, the alpha input mode used (T9 or ABC) are retained by the AlphaCurrent input mode when set with the star key.

You can only use InputModeEditor on a Smartphone, and only with a TextBox control.
Example

The following code example shows setting the input mode on three text boxes: Name, Phone, and City. The Name and City text boxes are set with the AlphaCurrent input mode and the Phone text box is set with the Numeric input mode.

To observe how AlphaCurrent works, perform the following procedure:

   1.

      With the Name text box selected, hold down the star key and enter text using either the T9 or ABC input modes.
   2.

      Enter text in the City text box. Note that the input mode is the same as the Name text box.

Visual Basic

Imports System Imports System.Windows.Forms Imports Microsoft.WindowsCE.Forms    Public Class Form1    Inherits System.Windows.Forms.Form    Private mainMenu1 As System.Windows.Forms.MainMenu    Private mi1 As System.Windows.Forms.MenuItem        \’ Text box for name.    Private textBox1 As System.Windows.Forms.TextBox    \’ Text box for phone number.    Private textBox2 As System.Windows.Forms.TextBox    \’ Text box for city.    Private textBox3 As System.Windows.Forms.TextBox        \’ Labels for name, phone, and city    Private label1 As System.Windows.Forms.Label    Private label2 As System.Windows.Forms.Label    Private label3 As System.Windows.Forms.Label            Public Sub New()              InitializeComponent()              \’ Add a menu to close the application.       mi1 = New MenuItem()       mainMenu1.MenuItems.Add(mi1)       AddHandler mi1.Click, AddressOf mi1_Click       mi1.Text = "Done"              \’ Set input mode for name text box to AlphaCurrent.       InputModeEditor.SetInputMode(textBox1, InputMode.AlphaCurrent)              \’ Set input mode for phone number text box to Numeric.       InputModeEditor.SetInputMode(textBox2, InputMode.Numeric)       \’ Set input mode for city text box to AlphaCurrent.       InputModeEditor.SetInputMode(textBox3, InputMode.AlphaCurrent)    End Sub                 Protected Overrides Sub Dispose(disposing As Boolean)       MyBase.Dispose(disposing)    End Sub            Private Sub InitializeComponent()       Me.mainMenu1 = New System.Windows.Forms.MainMenu()              Me.mainMenu1 = New System.Windows.Forms.MainMenu()       Me.textBox1 = New System.Windows.Forms.TextBox()       Me.textBox2 = New System.Windows.Forms.TextBox()       Me.textBox3 = New System.Windows.Forms.TextBox()              Me.label1 = New System.Windows.Forms.Label()       Me.label2 = New System.Windows.Forms.Label()       Me.label3 = New System.Windows.Forms.Label()       \’       \’ textBox1       \’       Me.textBox1.Location = New System.Drawing.Point(64, 8)       Me.textBox1.Size = New System.Drawing.Size(104, 25)       Me.textBox1.Text = ""       \’       \’ textBox2       \’       Me.textBox2.Location = New System.Drawing.Point(64, 40)       Me.textBox2.Size = New System.Drawing.Size(104, 25)       Me.textBox2.Text = ""       \’       \’ textBox3       \’       Me.textBox3.Location = New System.Drawing.Point(64, 72)       Me.textBox3.Size = New System.Drawing.Size(104, 25)       Me.textBox3.Text = ""       \’       \’ label1       \’       Me.label1.Location = New System.Drawing.Point(8, 8)       Me.label1.Size = New System.Drawing.Size(56, 22)       Me.label1.Text = "Name"       \’       \’ label2       \’       Me.label2.Location = New System.Drawing.Point(8, 40)       Me.label2.Size = New System.Drawing.Size(56, 22)       Me.label2.Text = "Phone"       \’       \’ label3       \’       Me.label3.Location = New System.Drawing.Point(8, 72)       Me.label3.Size = New System.Drawing.Size(56, 22)       Me.label3.Text = "City"       \’       \’ Form1       \’       Me.Controls.Add(textBox1)       Me.Controls.Add(textBox2)       Me.Controls.Add(textBox3)       Me.Controls.Add(label1)       Me.Controls.Add(label2)       Me.Controls.Add(label3)       Me.Menu = Me.mainMenu1       Me.Text = "Input Mode Demo"    End Sub             Shared Sub Main()       Application.Run(New Form1())    End Sub            Private Sub mi1_Click(sender As Object, e As EventArgs)       Me.Close()    End Sub End Class

C#

using System; using System.Drawing; using System.Collections; using System.Windows.Forms; using Microsoft.WindowsCE.Forms;  public class Form1 : System.Windows.Forms.Form &leftsign;  private System.Windows.Forms.MainMenu mainMenu1;  private System.Windows.Forms.MenuItem mi1;   // Text box for name.  private System.Windows.Forms.TextBox textBox1;  // Text box for phone number.  private System.Windows.Forms.TextBox textBox2;  // Text box for city.  private System.Windows.Forms.TextBox textBox3;   // Labels for name, phone, and city  private System.Windows.Forms.Label label1;  private System.Windows.Forms.Label label2;  private System.Windows.Forms.Label label3;   public Form1()  &leftsign;    InitializeComponent();    // Add a menu to close the application.   mi1 = new MenuItem();   mainMenu1.MenuItems.Add(mi1);   mi1.Click +=new EventHandler(mi1_Click);   mi1.Text = "Done";    // Set input mode for name text box to AlphaCurrent.   InputModeEditor.SetInputMode(textBox1, InputMode.AlphaCurrent);    // Set input mode for phone number text box to Numeric.   InputModeEditor.SetInputMode(textBox2, InputMode.Numeric);    // Set input mode for city text box to AlphaCurrent.   InputModeEditor.SetInputMode(textBox3, InputMode.AlphaCurrent);    &rightsign;   protected override void Dispose( bool disposing )  &leftsign;   base.Dispose( disposing );  &rightsign;   private void InitializeComponent()  &leftsign;   this.mainMenu1 = new System.Windows.Forms.MainMenu();    this.mainMenu1 = new System.Windows.Forms.MainMenu();   this.textBox1 = new System.Windows.Forms.TextBox();   this.textBox2 = new System.Windows.Forms.TextBox();   this.textBox3 = new System.Windows.Forms.TextBox();    this.label1 = new System.Windows.Forms.Label();   this.label2 = new System.Windows.Forms.Label();   this.label3 = new System.Windows.Forms.Label();   //   // textBox1   //   this.textBox1.Location = new System.Drawing.Point(64, 8);   this.textBox1.Size = new System.Drawing.Size(104, 25);   this.textBox1.Text = "";   //   // textBox2   //   this.textBox2.Location = new System.Drawing.Point(64, 40);   this.textBox2.Size = new System.Drawing.Size(104, 25);   this.textBox2.Text = "";   //   // textBox3   //   this.textBox3.Location = new System.Drawing.Point(64, 72);   this.textBox3.Size = new System.Drawing.Size(104, 25);   this.textBox3.Text = "";   //   // label1   //   this.label1.Location = new System.Drawing.Point(8, 8);   this.label1.Size = new System.Drawing.Size(56, 22);   this.label1.Text = "Name";   //   // label2   //   this.label2.Location = new System.Drawing.Point(8, 40);   this.label2.Size = new System.Drawing.Size(56, 22);   this.label2.Text = "Phone";   //   // label3   //   this.label3.Location = new System.Drawing.Point(8, 72);   this.label3.Size = new System.Drawing.Size(56, 22);   this.label3.Text = "City";   //   // Form1   //   this.Controls.Add(this.textBox1);   this.Controls.Add(this.textBox2);   this.Controls.Add(this.textBox3);   this.Controls.Add(this.label1);   this.Controls.Add(this.label2);   this.Controls.Add(this.label3);   this.Menu = this.mainMenu1;   this.Text = "Input Mode Demo";   &rightsign;   static void Main()  &leftsign;   Application.Run(new Form1());  &rightsign;   private void mi1_Click(object sender, EventArgs e)  &leftsign;   this.Close();  &rightsign; &rightsign;

Compiling the Code

This example requires references to the following namespaces:

    *

      System
    *

      System.Windows.Forms

How to: Scroll a Form of Labels

Because a Label control does not receive the focus and does not support tabbing, a Smartphone application of only Label controls does not allow the user to navigate to labels beyond the visible client area of the form. The user of a Pocket PC application can tap the scroll bars to navigate, but this capability is not available on the Smartphone.

You can implement navigation by providing code in the event handler for the KeyDown event that adjusts the AutoScrollPosition property.
To scroll a form of Label controls

   1.

      Add several Label controls to the form so that some are below the visible client area. Use arrow keys in the Microsoft Visual Studio 2005 designer or write initialization code to position them.
   2.

      In the form\’s constructor, set the KeyPreview and AutoScroll properties to true. C# users must attach a delegate for the KeyDown event handler.
      Visual Basic

      Me.KeyPreview = True Me.AutoScroll = True

      C#

      this.KeyPreview = true;             this.KeyDown += new KeyEventHandler(Form1_KeyDown);             this.AutoScroll = true;

   3.

      Set the AutoScrollPosition property to move vertically by a set number of pixels for the y point coordinate. The following code example uses 16. Note that the code is complex because AutoScrollPosition is offset by negative values, but the provided point values must be expressed as positive.
      Visual Basic

      Private Sub Form1_KeyDown(ByVal Sender As System.Object, _     ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown     If e.KeyCode = System.Windows.Forms.Keys.Up Then         Me.AutoScrollPosition = New Point(0, -Me.AutoScrollPosition.Y – 16)     End If     If e.KeyCode = System.Windows.Forms.Keys.Down Then         Me.AutoScrollPosition = New Point(0, -Me.AutoScrollPosition.Y + 16)     End If End Sub

      C#

      private void Form1_KeyDown(object sender, KeyEventArgs e) &leftsign;     if ((e.KeyCode == System.Windows.Forms.Keys.Up))     &leftsign;         this.AutoScrollPosition = new Point(0, -this.AutoScrollPosition.Y – 16);     &rightsign;     if ((e.KeyCode == System.Windows.Forms.Keys.Down))     &leftsign;         this.AutoScrollPosition = new Point(0, -this.AutoScrollPosition.Y + 16);     &rightsign;

Compiling the Code

This example requires references to the following namespaces:

    *

      System
    *

      System.Windows.Forms

How to: Override the Smartphone Back Key

NoteNote

Note that back key functionality is critical for navigating between Smartphone applications. In most cases, it is contrary to Smartphone user interface guidelines to alter the default navigation behavior of the back key. Use discretion in determining when to override this functionality.

You can customize the back key in Smartphone applications, such as for a game. It operates according depending on the context of the key press, as described in the following table.
Back Key Operation  Context

Cancels modal dialog boxes.
 

Always.

Cancels shortcut menus.
 

Always.

Performs a backspace operation.
 

When the focus is on an editable control, such as a text box, or on an editable custom control.

Navigates to the next window in the z-order.

Note that when the focus is on a form or custom control, the back key raises a KeyPress event that you can handle to provide your own functionality, as demonstrated in the example.

If you do not handle the event, the focus navigates to the next window in the z-order.
 

When the focus is on a form, non-editable control (such as a radio button), or non-editable custom control.

The back key operates the same way regardless of whether there is a menu bar. A menu bar exists if the form contains a MainMenu component.
Example

The following code example shows how to implement custom back key functionality. When the back key is pressed on a form or custom control, it raises the KeyPress event with the KeyChar value equal to the ESC key (27). In the event handling code, determine whether the ESC key value was raised. If it was, cancel the default back key operation by setting the Handled property to true. If the event arguments are not handled, the back key navigates to the next window in the z-order.

Visual C# users need to define an event hander for the KeyPress event in the form\’s constructor.
C#

// Connect an event handler to the KeyPress event this.KeyPress += new KeyPressEventHandler(OnKeyPress);

Visual Basic

Private Sub keypressed(ByVal o As [Object], _     ByVal e As KeyPressEventArgs) Handles MyBase.KeyPress     \’ Determine if ESC key value is raised.     If e.KeyChar = ChrW(Keys.Escape) Then         \’ Handle the event to provide your own functionality.         e.Handled = True          \’ Add  your event handling code here.         MsgBox("Custom back key functionality.")     End If End Sub

C#

private void OnKeyPress(object sender, KeyPressEventArgs ke) &leftsign;     // Determine if ESC key value is pressed.     if (ke.KeyChar == (Char)Keys.Escape)     &leftsign;         // Handle the event to provide functionality.         ke.Handled = true;          // Add your event handling code here.         MessageBox.Show("Back key was pressed.");     &rightsign; &rightsign;

Compiling the Code

This example requires references to the following namespaces:

    *

      System
    *

      System.Windows.Forms

标签:, , , , ,

20070709 vmware Bridged networking on /dev/vmnet0    [FAILED] - 二月 17, 2008 by yippee

20070709vmware Bridged networking on /dev/vmnet0    [FAILED]
http://www.yippeesoft.com

The module smp-2.4.20-8.i686-RH9.0 loads perfectly in the running kernel.

Starting VMware services:
   Virtual machine monitor                                 [  确定  ]
   Virtual ethernet                                        [  确定  ]
   Bridged networking on /dev/vmnet0                       [失败]
   Host-only networking on /dev/vmnet8 (background)        [  确定  ]
   NAT service on /dev/vmnet8                              [失败]

The configuration of VMware Workstation 5.5.1 build-19175 for Linux for this
running kernel completed successfully.

(1)Bridged方式

用这种方式,虚拟系统的IP可设置成与本机系统在同一网段,虚拟系统相当于网络内的一台独立的机器,与本机共同插在一个Hub上,网络内其他机器可访问虚拟系统,虚拟系统也可访问网络内其他机器,当然与本机系统的双向访问也不成问题。

(2)NAT方式
这种方式也可以实现本机系统与虚拟系统的双向访问。但网络内其他机器不能访问虚拟系统,虚拟系统可通过本机系统用NAT协议访问网络内其他机器。
NAT方式的IP地址配置方法:虚拟系统先用DHCP自动获得IP地址,本机系统里的VMware services会为虚拟系统分配一个IP,之后如果想每次启动都用固定IP的话,在虚拟系统里直接设定这个IP即可。

(3)host-only方式
顾名思义这种方式只能进行虚拟机和主机之间的网络通信,既网络内其他机器不能访问虚拟系统,虚拟系统也不能访问其他机器。

(4)not use方式
既是不使用网络,虚拟系统为一个单机。

The following bridged networks have been defined:

. vmnet0 is bridged to eth0

All your ethernet interfaces are already bridged.

 vmware-config.pl gives: Bridged networking on /dev/vmnet0 [FAILED]

When running vmware-config.pl at the end is:

Starting VMware services:
   Virtual machine monitor                                      [  OK  ]
   Virtual ethernet                                             [  OK  ]
   Bridged networking on /dev/vmnet0                            [FAILED]
   Host-only networking on /dev/vmnet1 (background)             [  OK  ]
   Host-only networking on /dev/vmnet8 (background)             [  OK  ]
   NAT service on /dev/vmnet8                                   [  OK  ]

And then /usr/bin/vmware gives:

vmware is installed, but it has not been (correctly) configured
for this system. To (re-)configure it, invoke the following command:
/usr/bin/vmware-config.pl.

Solution

rm /etc/vmware/not_configured

    * I can\’t reproduce my success.. see the below issues. This problem remains unsolved!

[edit]
/etc/init.d/vmware restart — virtual ethernet failed

/etc/init.d/vmware restart

Stopping VMware services:
   Virtual machine monitor                                      [  OK  ]
   Bridged networking on /dev/vmnet0                            [  OK  ]
   DHCP server on /dev/vmnet1                                   [  OK  ]
   Host-only networking on /dev/vmnet1                          [  OK  ]
   DHCP server on /dev/vmnet8                                   [  OK  ]
   NAT service on /dev/vmnet8                                   [  OK  ]
   Host-only networking on /dev/vmnet8                          [  OK  ]
   Virtual ethernet                                             [FAILED]

Solution unknown

    * Try VMware 5.5?

[edit]
the network bridge … is not running

The network bridge on device /dev/vmnet0 is not running.  The virtual machine will not be able to communicate with the host or with other machines on your network.
Virtual device Ethernet0 will start disconnected.

Solution

/etc/init.d/vmware restart

(Reported anonymously. I have not tested this yet)

标签:, , ,
1014 WM_DEVICECHANGE GUID OK 2 - 三月 25, 2007 by yippee

1014 WM_DEVICECHANGE GUID OK 2

终于搞定了USB PHONE的热插拔检测。原来是GUID的问题

Pay extra attention to line 8. the NotificationFilter.dbcc_classguid. From Doron Holan\’s blog

A PnP device is typically associated with two different GUIDs, a device interface GUID and a device class GUID.

A device class GUID defines a broad category of devices. If you open up device manager, the default view is "by type." Each type is a device class, where each class is uniquely ID\’s by the device class GUID. A device class GUID defines the icon for the class, default security settings, install properties (like a user cannot manually install an instance of this class, it must be enumerated by PNP), and other settings. The device class GUID does not define an I/O interface (see Glossary), rather think of it as a grouping of devices. I think a good clarifying example is the Ports class. Both COM and LPT devices are a part of the Ports class, yet each has its own distinct I/O interface which are not compatible with each other. A device can only belong to one device class. The device class GUID is the GUID you see at the top of an INF file.

A device interface GUID defines a particular I/O interface contract. It is expected that every instanceof the interface GUID will support the same basic set of I/Os. The device interface GUID is what the driver will register and enable/disable based on PnP state. A device can register many device interfaces for itself, it is not limited to one interface GUID. If need be, the device can even register multiple instances of the same GUID (assuming each have their own ReferenceString), although I have never seen a real world need for this. A simple I/O interface contract is the keyboard device interface to the raw input thread. Here is the keyboard device contract that each instance of the keyboard device interface GUID must support.

You can see the current list of device classes and device interface classes at the following registries

\\\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class

\\\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\DeviceClasses

A list of common device interface class GUIDs are listed as follows:

Device Interface Name GUID
USB Raw Device &leftsign;a5dcbf10-6530-11d2-901f-00c04fb951ed&rightsign;
Disk Device &leftsign;53f56307-b6bf-11d0-94f2-00a0c91efb8b&rightsign;
Network Card &leftsign;ad498944-762f-11d0-8dcb-00c04fc3358c&rightsign;
Human Interface Device (HID) &leftsign;4d1e55b2-f16f-11cf-88cb-001111000030&rightsign;
Palm &leftsign;784126bf-4190-11d4-b5c2-00c04f687a67&rightsign;

It seems by using the dbcc_name, we can know what device has been plugged into the system. Sadly, the answer is NO, dbcc_name is for OS internal use and is an identity, it is not human readable. A sample of dbcc_name is as follows:

\\\\?\\USB#Vid_04e8&Pid_503b#0002F9A9828E0F06#&leftsign;a5dcbf10-6530-11d2-901f-00c04fb951ed&rightsign;

\\\\?\\USB: USB means this is a USB device class
Vid_04e8&Pid_053b: Vid/Pid is VendorID and ProductID (but this is device class specific, USB use Vid/Pid, different device classes use different naming conventions)
002F9A9828E0F06: seems to be a unique ID (not sure about how this got generated)
&leftsign;a5dcbf10-6530-11d2-901f-00c04fb951ed&rightsign;: the device interface class GUID
Now, by using these decoded information, we can get the device description or device friendly name by two methods:

Read the registry directly: for our example dbcc_name, it will be, \\\\HKLM\\SYSTEM\\CurrentControlSet\\Enum\\USB\\Vid_04e8&Pid_503b\\0002F9A9828E0F06 
Use SetupDiXxx

所以最终的代码:
static const GUID GUID_DEVINTERFACE_LIST[] =
&leftsign;
 // GUID_DEVINTERFACE_USB_DEVICE
 // &leftsign; 0xA5DCBF10, 0×6530, 0×11D2, &leftsign; 0×90, 0×1F, 0×00, 0xC0, 0×4F, 0xB9, 0×51, 0xED &rightsign; &rightsign;,

 // GUID_DEVINTERFACE_DISK
 // &leftsign; 0×53f56307, 0xb6bf, 0×11d0, &leftsign; 0×94, 0xf2, 0×00, 0xa0, 0xc9, 0×1e, 0xfb, 0×8b &rightsign; &rightsign;,

 // GUID_DEVINTERFACE_HID,
 &leftsign; 0×4D1E55B2, 0xF16F, 0×11CF, &leftsign; 0×88, 0xCB, 0×00, 0×11, 0×11, 0×00, 0×00, 0×30 &rightsign; &rightsign;,
   
 // GUID_NDIS_LAN_CLASS
 // &leftsign; 0xad498944, 0×762f, 0×11d0, &leftsign; 0×8d, 0xcb, 0×00, 0xc0, 0×4f, 0xc3, 0×35, 0×8c &rightsign; &rightsign;

 //// GUID_DEVINTERFACE_COMPORT
 //&leftsign; 0×86e0d1e0, 0×8089, 0×11d0, &leftsign; 0×9c, 0xe4, 0×08, 0×00, 0×3e, 0×30, 0×1f, 0×73 &rightsign; &rightsign;,

 //// GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
 //&leftsign; 0×4D36E978, 0xE325, 0×11CE, &leftsign; 0xBF, 0xC1, 0×08, 0×00, 0×2B, 0xE1, 0×03, 0×18 &rightsign; &rightsign;,

 //// GUID_DEVINTERFACE_PARALLEL
 //&leftsign; 0×97F76EF0, 0xF883, 0×11D0, &leftsign; 0xAF, 0×1F, 0×00, 0×00, 0xF8, 0×00, 0×84, 0×5C &rightsign; &rightsign;,

 //// GUID_DEVINTERFACE_PARCLASS
 //&leftsign; 0×811FC6A5, 0xF728, 0×11D0, &leftsign; 0xA5, 0×37, 0×00, 0×00, 0xF8, 0×75, 0×3E, 0xD1 &rightsign; &rightsign;
&rightsign;;
void RegisterForDevChange(HWND hDlg, PVOID *hNotifyDevNode)
&leftsign;
 // HDEVNOTIFY hDevNotify;
 //    DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
 //    ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
 //    NotificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
 //    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
 // for(int i=0; i<sizeof(GUID_DEVINTERFACE_LIST)/sizeof(GUID); i++) &leftsign;
 //  NotificationFilter.dbcc_classguid = GUID_DEVINTERFACE_LIST[i];
 //  hDevNotify = RegisterDeviceNotification(hDlg, &NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);
 //  if( !hDevNotify ) &leftsign;
 //   AfxMessageBox(CString("Can\’t register device notification: ") );
 //   return ;
 //  &rightsign;
 // &rightsign;

[hide] www.yippeesoft.com [/hide]

标签:, , ,
1013 WM_DEVICECHANGE GUID OK 1 - 三月 24, 2007 by yippee

1013 WM_DEVICECHANGE GUID OK 1

终于搞定了USB PHONE的热插拔检测。原来是GUID的问题

原来的代码是:

DEV_BROADCAST_DEVICEINTERFACE *pFilterData =
  (DEV_BROADCAST_DEVICEINTERFACE*)
  _alloca(sizeof(DEV_BROADCAST_DEVICEINTERFACE));
    ASSERT (pFilterData);
 
 UUID GUID_CLASS_INPUT;        
 UuidFromString((unsigned char*)"4D1E55B2-F16F-11CF-88cb-001111000030", &GUID_CLASS_INPUT);
  
    ZeroMemory(pFilterData, sizeof(DEV_BROADCAST_DEVICEINTERFACE));
 
    pFilterData->dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    pFilterData->dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    pFilterData->dbcc_classguid  = GUID_CLASS_INPUT;
 /*
 USB dbcc_classguid  :&leftsign;36FC9E60-C465-11CF-8056-444553540000&rightsign;
 可以在注册表中查询 HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Enum\\USB\\ROOT_HUB
 此键值下面有你的设备列表你可以查到的,只能用那个*/
 
    *hNotifyDevNode = RegisterDeviceNotification(hDlg, pFilterData, DEVICE_NOTIFY_WINDOW_HANDLE);

从注册表来看也是如此:
[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Enum\\USB\\Vid_6993&Pid_b001\\5&248b3ac&0&1]
"DeviceDesc"="USB Composite Device"
"LocationInformation"="VOIP USB Phone           "
"Capabilities"=dword:00000084
"UINumber"=dword:00000000
"ClassGUID"="&leftsign;36FC9E60-C465-11CF-8056-444553540000&rightsign;"
"Class"="USB"
"Driver"="&leftsign;36FC9E60-C465-11CF-8056-444553540000&rightsign;\\\\0023"
"Mfg"="(标准 USB 主控制器)"
"Service"="usbccgp"
"ConfigFlags"=dword:00000000
"ParentIdPrefix"="6&354c7d77&0"

[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Enum\\USB\\Vid_6993&Pid_b001&MI_00\\6&354c7d77&0&0000]
"DeviceDesc"="USB Audio Device"
"Capabilities"=dword:000000a4
"UINumber"=dword:00000000
"ClassGUID"="&leftsign;4D36E96C-E325-11CE-BFC1-08002BE10318&rightsign;"
"Class"="MEDIA"
"Driver"="&leftsign;4D36E96C-E325-11CE-BFC1-08002BE10318&rightsign;\\\\0029"
"Mfg"="(通用 USB 音频)"
"Service"="usbaudio"
"ConfigFlags"=dword:00000000

[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Enum\\USB\\Vid_6993&Pid_b001&MI_03\\6&354c7d77&0&0003]
"DeviceDesc"="USB 人体学输入设备"
"LocationInformation"="VOIP USB Phone 䐀ȅఅ慆硴⮀歶耀"
"Capabilities"=dword:00000084
"UINumber"=dword:00000000
"ClassGUID"="&leftsign;745A17A0-74D3-11D0-B6FE-00A0C90F57DA&rightsign;"
"Class"="HIDClass"
"Driver"="&leftsign;745A17A0-74D3-11D0-B6FE-00A0C90F57DA&rightsign;\\\\0000"
"Mfg"="(标准系统设备)"
"Service"="HidUsb"
"ConfigFlags"=dword:00000000
"ParentIdPrefix"="7&32b06744&2"

[hide] www.yippeesoft.com [/hide]

标签:, , ,
1012 WM_DEVICECHANGE DBT_DEVNODES_CHANGED - 三月 23, 2007 by yippee

1012 WM_DEVICECHANGE DBT_DEVNODES_CHANGED

这个问题终究没有搞定,估计是设备问题呢
注册了信息仍然不行

Devices on the Bus
How can my application detect when my device is attached or removed?

To find out when a device has been attached or removed, catch the WM_DEVICECHANGE messege with the parameter DBT_DEVNODES_CHANGED. Then use SetupDi_ functions to find out what device was attached or removed. A good Usenet post on the subject: USB Device Insertion/Removal Event Notification. Also see my example code.

很奇怪的是当USB设备接通和连接时message.wParam不为DBT_DEVICEREMOVECOMPLETE和DBT_DEVICEARRIVAL,   而是等于7,   而且该消息会重复发送20次左右,   不知道是什么原因.  

There is no additional information about which device has been added to or removed from the system. Applications that require more information should register for device notification.

某些设备变更,触发的事件类型为DBT_DEVNODES_CHANGED,这时候是无法区分的。

you can register for device interface arrival and removal notification events for members of the GUID_DEVINTERFACE_USB_DEVICE device interface class.
specify a NotificationFilter type of DBT_DEVTYP_DEVICEINTERFACE (use a DEV_BROADCAST_DEVICEINTERFACE structure) and specify GUID_DEVINTERFACE_USB_DEVICE in the dbcc_classguid field as the device interface class.
(note that the GUID_DEVINTERFACE_USB_DEVICE GUID is also defined as GUID_CLASS_USB_DEVICE in the windows 2000 DDK).

when notified of a device interface DBT_DEVICEARRIVAL or DBT_DEVICEREMOVECOMPLETE removal event (dbch_devicetype is DBT_DEVTYP_DEVICEINTERFACE), the corresponding DEV_BROADCAST_DEVICEINTERFACE structure will contain a path you can use to access the device in the dbcc_name field.

if you open a handle to the device, you can register to receive removal-related events about that specific device (DBT_DEVICEQUERYREMOVE,
DBT_DEVICEQUERYREMOVEFAILED, DBT_DEVICEREMOVEPENDING, DBT_DEVICEREMOVECOMPLETE) by calling RegisterDeviceNotification with
a DBT_DEVTYP_HANDLE type NotificationFilter (DEV_BROADCAST_HANDLE structure).

see the toaster "notify" sample in the windows XP DDK for an example of registering for the various types of device notification events.

Registering for Device Notification
Applications can use the RegisterDeviceNotification function to register to receive notification messages from the system. The following example function demonstrates how to register for notification of events for the device interfaces which are members of the interface class whose GUID is passed to the function.

#include <windows.h>
#include <dbt.h>

HWND hWnd;

BOOL DoRegisterDeviceInterface(
    GUID InterfaceClassGuid,
    HDEVNOTIFY *hDevNotify
)
/*
Routine Description:
    Registers for notification of changes in the device interfaces for
    the specified interface class GUID.

Parameters:
    InterfaceClassGuid – The interface class GUID for the device
        interfaces.

    hDevNotify – Receives the device notification handle. On failure,
        this value is NULL.

Return Value:
    If the function succeeds, the return value is TRUE.
    If the function fails, the return value is FALSE.
*/

&leftsign;
    DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
    char szMsg[80];

    ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
    NotificationFilter.dbcc_size =
        sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    NotificationFilter.dbcc_classguid = InterfaceClassGuid;

    *hDevNotify = RegisterDeviceNotification( hWnd,
        &NotificationFilter,
        DEVICE_NOTIFY_WINDOW_HANDLE
    );

    if(!*hDevNotify)
    &leftsign;
        wsprintf(szMsg, "RegisterDeviceNotification failed: %d\\n",
                GetLastError());
        MessageBox(hWnd, szMsg, "Registration", MB_OK);       
        return FALSE;
    &rightsign;

    return TRUE;
&rightsign;

The application will receive the WM_DEVICECHANGE message whenever a device interface event notification is sent. Currently, the only events that will be received for device interfaces are DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE.

The system broadcasts a set of default device change events to all applications and services. You do not need to register to receive these default events. See the Remarks section in RegisterDeviceNotification for details.

标签:, ,
0909 防火墙 Ewido devmgr_show_nonpresent_devices - 二月 18, 2007 by yippee

0909 防火墙 Ewido

最近程序老是被天网防火墙整,索性找找几个知名的试一试。
ZoneAlarm Pro v6.5.737.000
ZoneAlarm 就会自动启动,帮你执行任务。你可以自由设置所有程序是否允许连接Internet,利用此种方法来防治一些来路不明的软件偷偷上网。最好的方法是锁住(Lock)网络不让任何程序通过,只有你核准的软件才可以通行无阻。你还可利用它来看看你开机后已经使用多少网络资源,也可以设定锁定网络的时间,这么好用的软件你一定要亲自使用才能感觉到它的威力。

BlackICE PC Server v3.6 cpn
该软件在九九年获得了PC Magazine 的技术卓越大奖,专家对它的评语是:“对于没有防火墙的家庭用户来说,BlackICE是一道不可缺少的防线;而对于企业网络,它又增加了一层保护措施–它并不是要取代防火墙,而是阻止企图穿过防火墙的入侵者。BlackICE集成有非常强大的检测和分析引擎,可以识别 200 多种入侵技巧,给你全面的网络检测以及系统防护,它还能即时监测网络端口和协议,拦截所有可疑的网络入侵,无论黑客如何费尽心机也无法危害到你的系统。而且它还可以将查明那些试图入侵的黑客的NetBIOS(WINS)名、DNS名或是他目前所使用的IP地址记录下来,以便你采取进一步行动。封言用过后感觉,该软件的灵敏度和准确率非常高,稳定性也相当出色,系统资源占用率极少,是每一位上网朋友的最佳选择。

Ewido V4.0.0.172c┊病毒库升级程序V3.3 Final
许多的反木马程序中,Ewido 是最好的。国内的木马x星等和它比简直是小儿科了。最近在http://www .anti-trojan-software-reviews .com/上的测试里表明,它可以有效地检测出多形态和进程注入式木马,这些甚至完全不能被像诺顿和AVG等杀毒软件所查杀。不过它没有TDS-3 或Trojan Hunter有效.但TDS-3目前还没推出支持中文操作系统的版本,Trojan Hunter是英文的没汉化版。但对于个人而言Ewido足够强大了,和kaspersky结合使用加上ZoneAlarm防火墙,可以使得系统坚若磐石。推荐所有没有安装反木马扫描器的个人计算机用户下载这个软件,并每周定期扫描。我猜你可能在你会为所得到的结果感到惊讶,
用这个扫描了一下硬盘,基本正常,就发现一个CNSmIN 和 CoolWebSearch的注册表残留
CNSmIN 就一个残留的3721键值、 CoolWebSearch 却是在VISUALSTATUIO 里面,真是奇怪。

更古怪的是,可能下载的是别人用过的,里面显示感染 NEWDOTNET
都是指向C盘,不过我C盘没有东西,只是引导

反间谍软件公司WebrootSoftware周二称,CoolWebSearch工具可以自行安装恶意HTML应用软件并利用IE上的安全漏洞。
  Webroot的常务董事NickLewis说:“对消费者而言,CoolWebSearch可能是最下流也最恶毒的程序之一。它完全劫持了IE浏览器,害你什么事都做不成。”  CoolWebSearch是Webroot评选的最新十大最下流间谍软件和广告软件列表中威胁最大的一个。Webroot的十大最坏的列表中还包括:
  PurityScan,一个显示弹出广告,声称可以发现并删除个人电脑上的色情内容的程序。
  Transponder (vx2),一个IE“浏览器助手”,它能够监控网络浏览并发送相关广告。
  KeenValue是一个广告程序,它收集个人信息并向计算机用户发送广告。
  Perfect Keylogger一个记录所访问过的站点、击键的记录和鼠标的移动的工具。它记录下用户的口令和账户等信息。
  “为了能躲避监测和清除,这些软件的编写者的编写技巧也在不断提高。”Webroot威胁研究的副主席Stiennon说,“这十个间谍软件是根据他们的影响和流行程度来选出的。”
  Webroot建议大家安装微软的安全补丁,避免使用免费软件并关闭通过IE中的ActiveX下载功能。

昨天晚上用上网助手扫描电脑时发现有提示危险的插件(间谍软件),其安装位置是c:\\program files\\NewDotNet,用上网助手没法删除,也不能直接删除,就用偶的另一套系统把NewDotNet目录删除了,可是这个开始了偶一夜的恶梦--我的系统不能上网了!!系统获得的是169段的IP,偶用了指定IP,DNS已经重新安装网卡驱动的等方法,都不能正常上网。最后只能求助于网络,几经折腾,总算弄懂了些:NewDotNet是介于正常插件与间谍软件之间的一种软件。又去了此软件的官方网站http://www .newd otnet.com/removal.html才知道了怎么删除它--一定要用软件本身的反安装程序NNuninstall.exe才行啊!
重要提示:NewDotNet不是一般的间谍软件,它没那么危险,但它却又改动了系统的网络设置,所以千万不要直接删除它,而要用其自身的反安装程序才行

[绝对新鲜出炉的原创]newdotnet恶梦

今天下午照例在网上瞎转悠,忽然速度变得奇慢。当时的第一反映就是中招。
一看进程,似乎没有问题。但是速度奇慢的事实证明了,中招是难免的。
于是打开了从黑基淘来的procexp,一看进程所调用的DLL,顿时傻了。
所有跟上网有关的进程里全都与NEWDOTNET里的两个神奇的DLL文件有瓜葛。
删除与之有关的EXE之后,恶梦从此开始。那newdotnet6_38.dll 死活删不掉。并且被一大堆
的系统进程调用。最要命的是,与网络有关的任何程序都连接不上网络。
用流氓软件杀手,杀手同志可以认出来。但是依然束手无册。
没辙,全自动删除吧(全部都要自己动手的删除方式……)。

停止进程(如果有)
ndnuninstall6_38.exe
programfilesdir+\\newdotnet\\uninstall6_38.exe
download.exe

撤消 DLL 的注册:
使用 Regsvr32 撤销以下 DLLs 的注册,然后重启:
programfilesdir+\\newdotnet\\newdotnet6_38.dll

最痛苦的就是注册表
HKEY_CLASSES_ROOT\\clsid\\&leftsign;4a2aacf3-adf6-11d5-98a9-00e018981b9e&rightsign;
HKEY_CLASSES_ROOT\\clsid\\&leftsign;dd521a1d-1f98-11d4-9676-00e018981b9e&rightsign;
HKEY_CLASSES_ROOT\\interface\\&leftsign;4a2aacf1-adf6-11d5-98a9-00e018981b9e&rightsign;
HKEY_CLASSES_ROOT\\interface\\&leftsign;dd521a1c-1f98-11d4-9676-00e018981b9e&rightsign;
HKEY_CLASSES_ROOT\\tldctl2.tldctl2c
HKEY_CLASSES_ROOT\\tldctl2.tldctl2c.1
HKEY_CLASSES_ROOT\\tldctl2.urllink
HKEY_CLASSES_ROOT\\tldctl2.urllink.1
HKEY_CLASSES_ROOT\\typelib\\&leftsign;dd521a10-1f98-11d4-9676-00e018981b9e&rightsign;
HKEY_LOCAL_MACHINE\\software\\microsoft\\code store database\\distribution units\\&leftsign;dd521a1d-1f98-11d4-9676-00e018981b9e&rightsign;
HKEY_LOCAL_MACHINE\\software\\microsoft\\code store database\\distribution units\\&leftsign;dd521a1d-1f98-11d4-9676-00e018981b9e&rightsign;\\contains\\files c:\\windows\\downloaded program files\\tldctl2.ocx
HKEY_LOCAL_MACHINE\\software\\microsoft\\code store database\\distribution units\\&leftsign;dd521a1d-1f98-11d4-9676-00e018981b9e&rightsign;\\installedversion
HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentversion\\moduleusage\\c:/windows/downloaded program files/tldctl2.ocx .owner
HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentversion\\moduleusage\\c:/windows/downloaded program files/tldctl2.ocx &leftsign;dd521a1d-1f98-11d4-9676-00e018981b9e&rightsign;
HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentversion\\run new.net startup
HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentversion\\uninstall\\new.net
HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentversion\\uninstall\\new.net publisher
HKEY_LOCAL_MACHINE\\software\\new.net
HKEY_LOCAL_MACHINE\\software\\new.net discardtag
HKEY_LOCAL_MACHINE\\software\\new.net firsttime
HKEY_LOCAL_MACHINE\\software\\new.net source
HKEY_LOCAL_MACHINE\\software\\microsoft\\windows\\currentversion\\run new.net startup

2000/XP下删除隐藏旧网卡方法
在windows2000中,利用”控制面板”中的添加/删除硬件”选项删除原有的网卡。启动”添加/删除硬件向导”,依次选择”卸载/拔插硬件-卸载设备”,钩选”显示隐藏设备”,可以找到原来的网卡,卸载即可。
在windows xp中,没有”卸载/拔插设备管理器”,而且”设备管理器”中的”查看”选项中虽有”显示隐藏设备”选项,但并不会显示己经拔除的旧网卡。
方法一:”命令提示符下”显示隐藏设备打开在windows xp的命令提示符,输入”set devmgr_show_nonpresent_devices=1”后回车,接着输入”start devmgmt.msc”,打开设备管理器,选择”查看”菜单中的”显示隐藏设备”,展开”网络适配器”,我们就会看到原有的网卡,卸载即可,从而释放原来与它捆绑在一起的IP地址。
方法二:修改”环境变量” 打开系统属性窗口,选择”高级”选项,点击下方的”环境变量”。在当前用户变量或“系统变量”中,点击“新建”按钮,在“变量名”一栏中输入“Devmgr_show_Nonpresent_Devices”,“变量值”一栏中输入“1”。最后,点击“确 定”按钮,关闭桌面窗口,重新打开“系统属性”中的“设备管理器”,选中“显示隐藏设备”,就可以随时查看真正隐藏的设备了。这种方法也可以通过修改注册表来实现。打开注册表编辑窗口,依次展开“HKEY-LOCAL-MACHINE\\\\System\\\\ControlSet001\\\\coontrol\\\\session manage”,在Environment键下新建”字符串值”,命名为”Devmgr_Show_Nonpresent_Devices”,双击此键,将”数据数值”高定为”1”。关闭注册表,重新启动windows xp或重新登录,就能看到真正隐藏的设备了。

标签:,
0903 WM_DEVICECHANGE SHFileOperation - 二月 12, 2007 by yippee

0903 WM_DEVICECHANGE SHFileOperation

The WM_DEVICECHANGE device message notifies an application or device driver of a change to the hardware configuration of a device or the computer.

protected:
afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD dwData); 

//&leftsign;&leftsign;AFX_MSG_MAP(CTest6Dlg)
 …
//&rightsign;&rightsign;AFX_MSG_MAP
ON_WM_DEVICECHANGE() 
END_MESSAGE_MAP()

BOOL CTest6Dlg::OnDeviceChange(UINT nEventType, DWORD dwData)
&leftsign;
switch(nEventType)
 &leftsign;
 case DBT_DEVICEARRIVAL:
  TRACE("DBT_DEVICEARRIVAL \\r\\n");
  break;
 case DBT_DEVICEREMOVECOMPLETE:
  TRACE("DBT_DEVICEREMOVECOMPLETE \\r\\n");
  break;
 default:
  break;
 &rightsign;
&rightsign;

接收到WM_DEVICECHANGE时,怎样才能判断是否为自己要关心的设备?
DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
    DWORD Err;

    ZeroMemory( &NotificationFilter, sizeof(NotificationFilter) );
    NotificationFilter.dbcc_size =
        sizeof(DEV_BROADCAST_DEVICEINTERFACE);
    NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
    NotificationFilter.dbcc_classguid = InterfaceClassGuid; // 这个是你关心的interface GUID

    *hDevNotify = RegisterDeviceNotification( hWnd,
        &NotificationFilter,
        DEVICE_NOTIFY_WINDOW_HANDLE
    );

然后在WM_DEVICECHANGE的消息处理函数里的参数就会指向一个结构,如果不调用上面的函数,那么参数都是0.

SHFILEOPSTRUCT fo;

char strSrc[] = "f:\\\\1\\0";

char strDst[] = "f:\\\\3\\0";

memset(&fo, 0, sizeof(fo));

fo.wFunc = FO_COPY;

fo.pFrom = strSrc;

fo.pTo = strDst;

fo.fFlags = FOF_SIMPLEPROGRESS;

SHFileOperation(&fo);

哈哈,你的From和To有问题,这两个字符串都应该是两个0结尾,中间以一个0分割,不是标准的字符串。
你用过文件对话框的filter没有?跟他的道理是一样的。api有很多使使用这些字符串,
应该这样,在结束的时候,应该多增加一个0:
fileop.pFrom    = "d:\\\\temp\\\\*.tmp\\0";
  fileop.pTo      = "c:\\\\temp\\\\\\0"; 

我想在自己的程序里删除文件夹
CString szPath = "C:\\\\1";
if(::GetFileAttributes(szPath) != 0xFFFFFFFF)//文件存在
&leftsign;
 SHFILEOPSTRUCT sf = &leftsign;0&rightsign;;
 sf.hwnd = this->GetSafeHwnd();
 sf.wFunc = FO_DELETE;
 sf.pFrom = "C:\\\\1";
 sf.fFlags =  FOF_NOCONFIRMATION;

 SHFileOperation(&sf);
&rightsign;
以上能通过!
但是我把 sf.pFrom = "C:\\\\1";换成sf.pFrom=szPath;就出错!
强制转换sf.pFrom = (LPSTR)(LPCTSTR)szPath;也不行!
如何是好,请高手执教!
———————————————————————————
CString szPath = _T("C:\\\\1");
szPath.GetBufferSetLength (strlen(szPath)+2);
szPath.SetAt(strlen(szPath)+1,0);
if(::GetFileAttributes(szPath) != 0xFFFFFFFF)//文件存在
&leftsign;
 SHFILEOPSTRUCT sf = &leftsign;0&rightsign;;
 sf.hwnd = this->GetSafeHwnd();
 sf.wFunc = FO_DELETE;
 
 sf.pFrom = szPath.GetBuffer(0);
 sf.fFlags = FOF_NOCONFIRMATION;
 SHFileOperation(&sf);
 szPath.ReleaseBuffer();
&rightsign;
sf.pFrom的字符串要求末尾有两个0才行!

标签:, ,

0208 sip rtcsample IRTCPresenceDevice2 - 四月 21, 2006 by yippee

0208 sip rtcsample IRTCPresenceDevice2

使用RTC SDK 1.3 知道的VC例子;VB例子可以直接PC2PC OK

O:\\ms\\xpsdk\\Include 带的 O:\\ms\\xpsdk\\Include
/* this ALWAYS GENERATED file contains the definitions for the interfaces */

 /* File created by MIDL compiler version 6.00.0347 */
/* Compiler settings for rtccore.idl:
    Oicf, W1, Zp8, env=Win32 (32b run)
    protocol : dce , ms_ext, c_ext, robust
    error checks: allocation ref bounds_check enum stub_data
    VC __declspec() decoration level:
         __declspec(uuid()), __declspec(selectany), __declspec(novtable)
         DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING(  )

/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475

采用 MIDL 生成的
/* this ALWAYS GENERATED file contains the definitions for the interfaces */

 /* File created by MIDL compiler version 6.00.0361 */
/* Compiler settings for rtccore.idl:
    Oicf, W1, Zp8, env=Win32 (32b run)
    protocol : dce , ms_ext, c_ext, robust
    error checks: allocation ref bounds_check enum stub_data
    VC __declspec() decoration level:
         __declspec(uuid()), __declspec(selectany), __declspec(novtable)
         DECLSPEC_UUID(), MIDL_INTERFACE()
*/
//@@MIDL_FILE_HEADING(  )

#pragma warning( disable: 4049 )  /* more than 64k source lines */

/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475

感觉版本一样,但是MIDL生成的有
EXTERN_C const IID IID_IRTCPresenceDevice2;

#if defined(__cplusplus) && !defined(CINTERFACE)
   
    MIDL_INTERFACE("00DE7891-77A8-4123-A9A4-4E5728BD8AC3")
    IRTCPresenceDevice2 : public IRTCPresenceDevice

编译出现:
rtcdialogs.cpp(1242) : error C2065: \’IRTCPresenceDevice2\’ : undeclared identifier
看了看代码,这个部分好像也没有什么用处:
//        IRTCPresenceDevice2 *pDevice2 = NULL;

干脆统统注释掉~~~~~
-out:WIN2000_DEBUG\\RTCSample.exe

rtcsample.exe – 0 error(s), 0 warning(s)

标签:, , ,
1221  unknow device Memory Stick - 十二月 29, 2005 by yippee

1221 unknow unknown device Memory Stick

昨天不知道怎么回事,将Memory Stick 卡插入读取器后,WINXP 一点反应都没有,我过去看了看,发现设备管理器中根本没有认到该设备。
显示 UNKNOWN DEVICE。

但是我的情况是

安装为  unknown device ,正常的不能再正常了,无论我怎么安装 INTEL INF,重新指定驱动程序,都告诉我 找不到更加匹配的驱动程序

重启系统;删除设备;重新 GHOST 回来系统,也是一样的效果;无论是插入 16M 还是 128M 的卡,都是一样

正常设备:
位置 0 (USB Memory Stick Slot) 通用串行总线控制器 兼容 USB 存储设备 USB MASS STORAGE DEVICE

最后的解决办法:我在读卡器上面按了几下~~~然后重新刷新硬件~~ 晕倒~~~~~~~

按照正常情况下,如果出现问题,WINDOWS应该提示:

系统发现新硬件,并表示正在安装,系统提示:跟这台计算机连接的一个usb设备运行不正常,windows无法识别。

或者

操作系统是Windows 2000简体中文专业版,正常是不需要驱动的,系统可以自动识别,但是现在在插上移动硬盘后,系统显示发现新硬件,并开始安装驱动,但是在驱动安装过程结束后,系统提示安装驱动过程中,出现了有一个错误,而后我在“设备管理器”里查看,发现在“通用串行总线控制器”下,有一项为“USB DEVICE”的,前面还有黄色叹号。很明显,这个移动硬盘虽然被系统发现,但是却不能被正确的识别,所以这个移动硬盘无法使用。在驱动安装过程中,根本没有人为的干预,却出现安装驱动错误

比较典型的一些资料
今天买了一个摄像头.首先安装光盘带的驱动,重启后.将摄像头连接到usb口(该usb口平时插u盘正常使用)。系统发现新硬件,并表示正在安装,但过一会儿系统提示:跟这台计算机连接的一个usb设备运行不正常,windows无法识别。打开设备管理器发现新增unknown.device但在属性里发现没有为该设备安装的驱动程序,让windows搜索驱动也没找到。
最简单的理由,摄像头坏了 ;重装

我将线插在USB插口处,电脑显示“发现新硬件”,接着我按照说明书的步骤一步一步安装,但是最后确出现“向导无法为您的硬件找到比现在安装的软件更匹配的软件”。烧录卡的灯也一直是红色的,启动烧录程序,但是无法使用““““`
这个是情况是你第一次安装时没有安装没成功,你把原来的驱动卸载掉。( 然后重新安装!!!记住第一次安装完以后驱动以后显示“驱动程序安装成功”,这时还没完!!!!!等一会儿,系统会提示发现新的硬件,重复刚才的新硬件安装过程!!这样才是安装成功!!

[楼主][每日必看]
添加硬件试验过了,被提示设备运转正常,下面是贴图,请高手指教
很明显从c,d,e,f是我本地硬盘,在资源管理器和磁盘管理器里找不到任何关于移动硬盘的图标,唯一可以看到的就是在设备管理器里面的unknowndevice,我尝试过用别人的hpnc7000可以马上找到,别人的台式的也可以,为什么我找不到呢,奇怪的是我可以找到另外一个紫光的移动硬盘,真是出鬼了 修改于:2004-3-23 22:2:56
在计算机管理/磁盘管理,也找不到,但是每当插上,计算机都会有提示,发现新硬件,并且最后说可以正常使用,但是就在资源管理器里找不到。。。。见下图

Memory Stick

  Memory Stick,即内存棒,是一种专利技术,它是由Sony公司1997年7月与Casio、Fujitsu、 Olympus、 Sanyo和 Sharp共同开发出的一种超微体积(口香糖大小)集成化电路的数字存储介质。它是一种相当于AA电池大小的闪存卡,采用10针连接器,专门用于一系列不同的音频、视频及电脑设备之间的信息传递。
Memory Stick被很多人称为香口胶存贮卡,因为其尺寸确实像一条香口胶:50mm x 21.5mm x 0.28mm,重4克。采用精致醒目的蓝色外壳(新的MG为白色),并具有写保护开关。 Memory Stick由Sony在日本的工厂生产,但存贮单元模块却并不是由Sony自己生产的,而是由第三方厂商提供,不过Sony拒绝透露是哪一家(也许就是签了Memory Stick授权协议的TI)。
和很多Flash Memory存贮卡不同,Memory Stick规范是非公开的,没有什么标准化组织(Sony认为没有必要进行行业标准化)。这个香口胶采用了Sony自己的外型、协议、物理格式和版权保护技术,要使用它的规范就必须和Sony谈判签定许可。目前所知道的是Memory Stick也包括了控制器在内,采用10针接口,数据总线为串行,最高频率可达20MHz,电压为2.7伏到3.6伏,电流平均为45mA。可以看出这个规格和差不多同一时间出现的MMC颇为相似。

记忆棒 MSA-4A  MSA-8A  MSA-16A  MSA-32A  MSA-64A 
记忆容量 4MB  8MB  16MB  32MB  64MB 
外壳尺寸
(长x阔x厚)  50×21.5×2.8毫米
净重 4克
记忆类型 快闪记忆(Flash Memory) 
连接器 10 针
介面 串行接口
传送率 最高 20 MHz
存取速度 写存速度;最高 1.5 MB/秒
读取速度:最高 2.45MB/秒
电压 2.7 伏特- 3.6伏特
电能消耗 平均:45mA ;备用:最高130mA
配件 记忆棒套及标签

标签:, ,
SmartDevice pocket pc 2003 VS.NET 1 - 九月 21, 2005 by yippee

制作第一个智能设备项目,硬件是 HP IPAD,平台是 POCKET PC2003 ,开发环境WINXP+VS.NET2003,感觉还是比较简单,和WINDOWS上面基本差不多~

—— 已启动生成: 项目: SmartDeviceApplication1, 配置: Debug Pocket PC ——

正在准备资源…
正在更新引用…
正在执行主编译…

生成完成 — 0 个错误,0 个警告
正在生成附属程序集…
Visual Studio 已准备好部署SmartDeviceApplication1

—— 已启动部署: 项目: SmartDeviceApplication1, 配置: Debug Pocket PC ——

正在部署到 Pocket PC 设备正在使用 TCP 连接传输

错误: 无法连接到设备,因为未安装 ActiveSync。请退出 Visual Studio,然后安装 ActiveSync 以完成连接。

欢迎使用 Microsoft ActiveSync
Microsoft ActiveSync 允许您使用电缆、底座或红外线在移动设备和桌面计算机之间建立合作关系。建立合作关系后,如果您的设备支持调制解调器或网(以太网)卡,就可以使用它们同步数据。通过 ActiveSync 还可以使用现有计算机连接其他资源。
可以使用 ActiveSync 保持两台计算机上拥有最新信息。如果在其中一台计算机上进行了更改,则下次同步时,另一台计算机上的相应信息就会自动进行更改。无论您从哪台计算机查看该信息,它都会保持最新状态。
如果您是 ActiveSync 的新用户,可以使用五分钟 ActiveSync 教程来熟悉一下 Microsoft ActiveSync 的功能。

ActiveSync 3.8
Microsoft ActiveSync 3.8 是基于 Windows Mobile 的 Pocket PC 和 Smartphones 的最新同步软件。ActiveSync 3.8 包含一组安全增强功能,可以提供与 Windows PC 更安全的同步体验,尤其表现在以下两方面:

首次连接 Windows Mobile 设备时出现的 Windows XP SP2 安全弹出警告已经被取消。
远程 PC 同步(通过 Wifi 或 LAN)被默认关闭。但是,用户可以通过定位到“文件”>“连接设置”,选中“允许网络 (Ethernet)…”来启用该功能。
建议所有 Windows Mobile 用户都要安装 ActiveSync 3.8,以便获得尽可能最安全的桌面同步体验。

ActiveSync 3.8 包含 ActiveSync 3.5、3.6、3.7 和 3.7.1. 中所有重要的改进功能。请参见新增功能列表。

安装的最后可能在扫描设备,所以比较慢,需要耐心等待~

Visual Studio .NET 2003 包含新的工具、.NET Framework 的精简版本及附加的类,使用户能够为 Pocket PC 和 Windows CE .NET 平台开发应用程序。
可以使用已获得的 Visual Studio .NET 技能创建 Pocket PC 2000、Pocket PC 2002 或任何基于 Windows CE .NET 的设备所使用的应用程序。
即使尚未拥有 Pocket PC,您仍然可以使用 Pocket PC 模拟技术创建和测试您的第一个智能设备应用程序。
Visual Studio .NET 2003 支持使用 Visual Basic .NET 和 Visual C# 语言进行智能设备开发。

开始新设备项目的方式与开始 Visual Studio 中的任何其他项目完全一样:打开“新建项目”对话框,然后选择项目类型和模板。
设备项目的唯一特殊之处在于,必须选定项目的平台,才能选择模板(例如,Windows 应用程序或类库)。
智能设备项目的平台是为一组相关设备设计的 .NET Framework 精简版编程功能集。Visual Studio .NET 2003 支持两种平台:Windows CE .NET 和 Pocket PC。Windows CE .NET 平台可以为常规 Windows CE .NET 项目提供所需功能。Pocket PC 平台则为专用于 Pocket PC 上的项目提供所需功能。
每个平台都支持特定的模板。例如,Pocket PC 平台提供开发 Windows 应用程序、类库、非图形应用程序或空项目的模板。
为帮助您进行选择,Visual Studio 提供“智能设备应用程序向导”。您可以通过以下方式从“新建项目”对话框启动此向导:首先指定项目类型(Visual Basic 或 Visual C#),然后单击“模板”下的“智能设备应用程序”图标。有关使用此向导的详细信息,请单击向导中的“帮助”按钮。

private void button1_Click(object sender, System.EventArgs e)
  &leftsign;
   System.Windows.Forms.MessageBox.Show(textBox1.Text,"123");
  &rightsign;

安装完ACTIVESYNC后,直接运行,选择 部署到 POCKET PC 上面~~

Visual Studio .NET 2003 包含新的工具、.NET Framework 的精简版本及附加的类,使用户能够为 Pocket PC 和 Windows CE .NET 平台开发应用程序。

可以使用已获得的 Visual Studio .NET 技能创建 Pocket PC 2000、Pocket PC 2002 或任何基于 Windows CE .NET 的设备所使用的应用程序。

即使尚未拥有 Pocket PC,您仍然可以使用 Pocket PC 模拟技术创建和测试您的第一个智能设备应用程序。

Visual Studio .NET 2003 支持使用 Visual Basic .NET 和 Visual C# 语言进行智能设备开发。

标签:, ,
CVSTRACMAIL SQLITE DEV 总结 - 二月 9, 2005 by yippee

从网上下载了一个SQLITEBROWSER,据说是可以对SQLITE数据库进行可视化数据库操作的。但是不知道为什么,我从CVSTRAC里面拷贝出来的DB文件,无论是使用SQLITE3还是使用BROWSER还是不能正常打开,报告不是正常的数据库。

根据奇怪的是如果我使用SQLITE3新建一个数据库,0K的文件,然后使用SQLITEBROWSE进行打开,然后关闭,再打开CVSROOT.DB,那么就很正常,而我使用代码则不能正常操作。

打开DB文件一看,SQLITE2.1,难道是这个原因,使用SQLITE2.8就可以正常打开了。这也是我不喜欢开源软件的一个原因,变动有时候太大了。有时候大家责难微软的WINDOWS不够先进什么的,但是人家从商业角度出发,增加系统的延续性,有时不得不损失一些东西YippeeSoft开心软件

于是改用2.*版本的CppSQLiteDBYippeeSoft开心软件

同样以下代码中将CPPLITE3*改为CPPLITE*就可以了。

这样根据原代码中的SQL语句就能取得任务单相应的信息了。再加上SMTP部分代码以及SSL动态连接库,基本上就能完成了。YippeeSoft开心软件

虽然我已经基本了解,但是现在不能继续作了,也不想继续作了。

1、我现在在家里,因为MONEY的原因,不敢申请一个月99元的宽带包月,只能通过MODEM上网,不方便,同样的,调试EMAIL部分也不方便。YippeeSoft开心软件

2、再则现在我也没有办法调试SSL部分,而且我也不喜欢带着一个SQLITE DLL,而我上网下载资料也不方便

3、最重要的是:我发现我CVS提交等的EMAIL通知软件CVSMAIL不是开源的,即使是开源的,我也还得再加上一个SSL,如果这样的话,我还不如开一个SSL STUNNEL软件算了。

所以,这个就算告一个段落了

// TODO: Add extra validation here
 const char* gszFile = "C:\\\\cvsroot.db";
     
    CppSQLite3DB db;

 //    cout << "SQLite VersiYippeeSoft开心软件on: " << db.SQLiteVersion() << endl;
 TRACE((char *)db.SQLiteVersion);
 //    remove(gszFile);
    db.open(gszFile);
 CString STicketSQL = "SELECT type, status, origtime, changetime, derivedfrom, ";
 STicketSQL+="version, assignedto, severity, priority, subsystem, owner, ";
 STicketSQL+="title, description, remarks, contact FROM ticket WHERE tn=%d";

 CString strtick;
 strtick.Format(STicketSQL,103);
 CppSQLite3Query q = db.execQuery(strtick.GetBuffer(0));
 strtick.ReleaseBuffer();
 for (int i=0;i<15;i++)
 &leftsign;
  TRACE(q.getStringField(i));
 &rightsign;

 //    cout << endl << "emp table exists=" << (db.tableExists("emp") ? "TRUE":"FALSE") << endl;
 CDialog::OnOK();

标签:, , , , ,