免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1632 | 回复: 3
打印 上一主题 下一主题

[其他] Memo: null device in windows [复制链接]

论坛徽章:
59
2015年亚洲杯之约旦
日期:2015-01-27 21:27:392015年亚洲杯之日本
日期:2015-02-06 22:09:41拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015元宵节徽章
日期:2015-03-06 15:50:392015年亚洲杯之阿联酋
日期:2015-03-19 17:39:302015年亚洲杯之中国
日期:2015-03-23 18:52:23巳蛇
日期:2014-12-14 22:44:03双子座
日期:2014-12-10 21:39:16处女座
日期:2014-12-02 08:03:17天蝎座
日期:2014-07-21 19:08:47
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-11-24 08:58 |只看该作者 |倒序浏览
  1. #include <stdio.h>
  2. #ifdef __NULDEV
  3. #error "Macro <__NULDEV> is allready defined by other module. die.\n"
  4. #endif
  5. #ifdef _WINDOWS_
  6. #define __NULDEV "NUL"
  7. #else
  8. #define __NULDEV "/dev/null"
  9. #endif
  10. int main(){
  11.         FILE *fpnul=fopen(__NULDEV,"r+");
  12.         if(fpnul!=NULL){
  13.                 printf("successful\n");
  14.                 int n=fprintf(fpnul,"it is a test %d\n",1234);
  15.                 fprintf(stdout,"it is a test %d\n",1234);
  16.                 printf("%d",n);
  17.         }
  18.         return 0;
  19. }
复制代码

论坛徽章:
59
2015年亚洲杯之约旦
日期:2015-01-27 21:27:392015年亚洲杯之日本
日期:2015-02-06 22:09:41拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015元宵节徽章
日期:2015-03-06 15:50:392015年亚洲杯之阿联酋
日期:2015-03-19 17:39:302015年亚洲杯之中国
日期:2015-03-23 18:52:23巳蛇
日期:2014-12-14 22:44:03双子座
日期:2014-12-10 21:39:16处女座
日期:2014-12-02 08:03:17天蝎座
日期:2014-07-21 19:08:47
2 [报告]
发表于 2012-12-20 11:11 |只看该作者
LoadLibrary in c#
  1.         public static bool DllSpawnHelper(char[] args)
  2.         {
  3.             //System.Diagnostics.Debug.WriteLine(Application.StartupPath);
  4.             IntPtr handle = LoadLibrary(Path.Combine(Application.StartupPath, "DllName.dll"));
  5.             IntPtr funcPtr = GetProcAddress(handle, "FunctionName");

  6.             Delegate_Dll _API fun= (Delegate_Dll _API)System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(funcPtr, typeof(Delegate_Dll _API));
  7.             bool rs = fun(args);

  8.             FreeLibrary(handle);

  9.             return rs;
  10.         }
复制代码

论坛徽章:
59
2015年亚洲杯之约旦
日期:2015-01-27 21:27:392015年亚洲杯之日本
日期:2015-02-06 22:09:41拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015元宵节徽章
日期:2015-03-06 15:50:392015年亚洲杯之阿联酋
日期:2015-03-19 17:39:302015年亚洲杯之中国
日期:2015-03-23 18:52:23巳蛇
日期:2014-12-14 22:44:03双子座
日期:2014-12-10 21:39:16处女座
日期:2014-12-02 08:03:17天蝎座
日期:2014-07-21 19:08:47
3 [报告]
发表于 2012-12-21 13:32 |只看该作者
  1. using namespace System::Runtime::InteropServices;   
  2. void foo([Out] Bar^% x);
复制代码
out keyword in managed c++

论坛徽章:
59
2015年亚洲杯之约旦
日期:2015-01-27 21:27:392015年亚洲杯之日本
日期:2015-02-06 22:09:41拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015元宵节徽章
日期:2015-03-06 15:50:392015年亚洲杯之阿联酋
日期:2015-03-19 17:39:302015年亚洲杯之中国
日期:2015-03-23 18:52:23巳蛇
日期:2014-12-14 22:44:03双子座
日期:2014-12-10 21:39:16处女座
日期:2014-12-02 08:03:17天蝎座
日期:2014-07-21 19:08:47
4 [报告]
发表于 2012-12-21 14:38 |只看该作者
  1.                 property String^ KeyText{
  2.                         String^ get(){
  3.                                 return gcnew String(this->m_pInnerNode->GetKeyText().c_str());
  4.                         }
  5.                 }
复制代码
managed C++ propery
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP