work hard work smart

专注于Java后端开发。 不断总结,举一反三。
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年9月24日

摘要: 1、条件中断 for (int i = 0; i < 100; i++ ) { if(i == 50) { Console.WriteLine("here is 50"); } }第一种方法:代码执行输出要i等于50,当开始执行for循环时,直接将i的值改为49,然后在执行。第二种方法:对if(i == 50)断点执行进行条件设置为:i == 50, 然后按F5直接到条件i为50,则进入输出语句;或者设... 阅读全文

posted @ 2011-09-24 22:42 work hard work smart 阅读(717) 评论(0) 推荐(0) 编辑

摘要: 一、在.Net中使用COM组件分以下三步走:1、首先创建COM组件,这里只做简单介绍(1)创建ATL项目。(2)添加ATL对象类。(3)为ATL对象类添加方法。可以采用在接口中添加方法,也可手动添加代码。这样一个简单的COM组件创建完毕。2、为COM生成互操作程序集采用TlbImp.exe类型库导入程序。F:\...\Debug>tlbimp samplecomsimpletest.tlb /out:SampleCOMSimpleTest.Interop.dll /namespace:SampleCOMSimpleTest.Interop其中samplecomsimpletest.tlb 阅读全文

posted @ 2011-09-24 18:57 work hard work smart 阅读(5858) 评论(0) 推荐(2) 编辑

摘要: 1、一般通用的FACILITY_NULL HRESULT如下S_OK:一般操作,成功执行S_FALSE:成功地返回逻辑错误E_FAIL:一般性失败E_NOTIMPL:方法没有实现E_UNEXPECTED:在不准确的时间调用了方法2、HRESULT Method2([in] short arg1, [out, retval] short *parg2);retval属性的含义是,相关联的物理方法参数实际上是操作的逻辑结果,在支持retval的环境中,该参数应该被映射为操作的结果。3、[ local, object, uuid(00000000-0000-0000-c000-00000000032 阅读全文

posted @ 2011-09-24 16:46 work hard work smart 阅读(725) 评论(0) 推荐(0) 编辑

摘要: 1、使用微软的C运行库msvcrt.dll提供的方法和Win32 API提供的函数进行平台调用代码如下: class Program { //微软的C运行库msvcrt.dll提供的puts方法 [DllImport("msvcrt.dll")] static extern int puts(string msg); [DllImport("msvcrt.dll")] static extern int _flushall(); //Win32 API提供的函数进行平台调用 [DllI... 阅读全文

posted @ 2011-09-24 13:50 work hard work smart 阅读(499) 评论(0) 推荐(0) 编辑

摘要: C++创建的是Win32 DLL程序,代码如下:#include "stdafx.h"#include "CustomerInfo.h"#include <stdio.h>#include <malloc.h>typedef struct{ char name[32]; int age;}Customer;CustomerInfo* customerInfo;extern "C" __declspec(dllexport) Customer* Create(char* name, int age){ Custo 阅读全文

posted @ 2011-09-24 12:24 work hard work smart 阅读(522) 评论(0) 推荐(0) 编辑