|
|
|
[求助]能够不能够实现只让一台机器上运行10个实例
进程之间是相互隔离的,如果不共享的话,每个进程都会有它们自已的Mutex1~Mutex10,所以这种方法也是不行的, |
|
[求助]程序中的debug,不懂判断文件是否存在,即使不存在,也显示出来
可以试试这样的: 当点打开按钮时就会得到含有路径和文件名信息的字符串,然后用CreateFile函数并传递OPEN_EXISTING作为参数,如果成功则返回文件句柄,如失败请去参考MSDN中的说明, 最后不用时别忘了关闭。 |
|
[求助]能够不能够实现只让一台机器上运行10个实例
哇哈哈,如果是程序的单实例运行,采用命名内核对象的方法是很有效的,但现在的问题是运行10份实例,所以对于21楼的代码我的理解是: 当它第一次运行时就会产生一个Mutex Name的内核对象, 当它第二次运行就会失败,因为已经存在同名的了。 所以结论是21楼的代码不符合要求。 |
|
[求助]能够不能够实现只让一台机器上运行10个实例
为什么建议用内核对象?在程序非正常结束的情况,内核对象也得不到释放,而这些都是系统资源,因此用这种方法的损失会更大。 另外一个郁闷的问题是,用内核对象的代码我不知该怎么写,testttt能否发一份代码学习下?? |
|
|
|
[求助]能够不能够实现只让一台机器上运行10个实例
用9楼住户的方法实现了一个: #include <windows.h> #include "resource.h" #include <stdio.h> #pragma data_seg(".thinkSJ")/////添加一个新节并共享 DWORD gs_dCount = 0; #pragma data_seg() #pragma comment(linker,"/section:.thinkSJ,RWS") LRESULT CALLBACK DlgProc(HWND,UINT,WPARAM,LPARAM); int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR,int) { ::DialogBoxParam (hInstance,(LPCTSTR)IDD_MAIN,NULL,(DLGPROC)DlgProc,NULL); return 1; } LRESULT CALLBACK DlgProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: gs_dCount += 1; //////在初使化消息中对全局标志位加1 if(gs_dCount > 5)/////该程序只能运行5份实例 { ::SendMessage (hWnd,WM_CLOSE,0,0); } return true; case WM_CLOSE: gs_dCount -= 1;//////在关闭消息中对全局标志位减1 ::EndDialog (hWnd,0); return true; } return false; } 将5改成10就符合要求了 |
|
|
|
[求助]怎样使用native API啊?
先安装DDK,用ntddk.h,ntdll中的函数在这之中有声明, 另外好像Native程序是以NtProcessStartup为入口以NtTerminateProcess结束的 |
|
|
|
[求助]怎样用VC编写WDM驱动程序(本人是菜鸟,恳请高手指教)
有MAKEFILE和SOURCE文件就可以用BUILD了 |
|
|
|
关于WINDOWS的进程查看器。 大家来看看。
PsSetCreateProcessNotifyRoutine 、PsSetCreateThreadNotifyRoutine设置一个回调函数 |
|
关于MASM里addr的问题
可以用offset 试下 |
|
[已解决]C语言问题求助[求助]
按位 与 操作 |
|
[下载]我有 driverstudio3.2
发个网址,DS3.2:http://www.fixdown.com/soft/11956.asp?full=cqoltel-downs2 |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值