使用vc ++进行智能卡编程 [英] smart card programming with vc++

查看:85
本文介绍了使用vc ++进行智能卡编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用智能卡技术,在C/C ++中,我们有用于智能卡的winscard.h.在vc ++控制台应用程序中,我已经使用过它,但是现在我想制作一个窗口应用程序.
为了安全起见,我希望将所有代码保存在库中,并在需要时单击按钮时调用它.
对于窗口应用程序,在VC ++中,我们有 WIn 32应用程序 窗口表单应用程序 MFC应用程序,这对我来说很容易.以及我应该使用哪个选项来制作库.

当我选择Win 32控制台应用程序时,接下来他有一些复选框要求使用静态库或dll库,在这里我可以选择任何人来制作我的库?或者我需要使用其他项目类型来制作我的库.

同样在vc ++中,我们有一个项目类型- 类库,如果我选择它,我可以在Windows窗体应用程序中使用它吗?我已经在控制台中使用了静态,动态概念{隐式/显式链接},但是当我尝试在窗口形式的应用程序中使用该库时,这里显示出了问题,有人告诉我使用 c ++/cli 或有人说问题是由于 托管和非托管代码引起的.我现在真的很困惑, 请告诉我什么项目我应该为应用程序和库使用的类型您的任何单词对我来说都意味着很多.

Hi all,
I am working with smart card technology and In C/C++ we have winscard.h for smart card. In vc++ console application i have used it but now i want to make a window application.
For security i want to keep my all code in library and call it on button click when require.
for window application , In VC++ we have , WIn 32 app, window form application and MFC application,here which option would be easy to me. also which option i should use for making library.

when i choose win 32 console application , next he has some checkbox asking for static or dll library, here i can choose anyone here for making my library? or i need to use other project type to make my library.

also in vc++ we have a project type - Class Library , if i will choose it, i can use it in windows form application? I already used static , dynamic concept { Implicit/explicit linking} in console but when i am trying to use that library in window form application, here it is showing problem, some people are telling me to use c++/cli or some are saying problem is because of managed and unmanaged code. I am really confused now, please tell me what project type i should use for application and library Your any word means a lot for me.

推荐答案

您应该做的第一件事是确定所需的框架要用于您的应用程序:Win32,MFC或C ++/CLI.做出决定后,便可以使用该技术进行所有开发.除非将其与其他应用程序共享,否则没有理由创建DLL或静态库.将代码移到库中并不能提高应用程序的安全性.
The first thing you should do is decide which framework you want to use for your application: Win32, MFC or C++/CLI. Once you have made that decision then you can do all your development using that technology. There is no reason to create a DLL or static library unless it will be shared with other applications. Moving code into a library does not improve the security of the application; it is quite possible it will make it less secure.


在vc ++ Windows窗体中创建窗体并不是一件困难的事.更好的方法是,使用COM ATL/MFC在Vc ++中创建DLL.使用c#轻松创建Windows窗体,并链接您的DLL,您可以动态调用该函数...尝试通过这种方式使其变得简单...
In vc++ windows form creation is little difficult one..better you can create DLL in Vc++ using COM ATL/MFC..then you can create windows form easily using c# and by link your DLL ,you can call the function dynamically...try to do this way to makes it easy...


< pre lang ="css>制作Dll非常容易..
像这样创建:
步骤1:vc ++项目---& gt; ATL ptoject
步骤2:应用程序设置将出现在该选择的服务器类型中,作为动态

链接libraray(DLL).然后单击完成按钮...如果您
,请不要选择属性选项
在其中.
第3步:在类视图中-右键单击-& gt;添加类.
步骤4:在添加类中,选择ATL简单对象,然后双击
将显示ATL简单对象向导.在其中键入您希望的任何名称
并在选项中选择连接点.然后单击完成按钮

step5:在类视图中单击以将其展开..现在可以看到一个界面图标,就像

小圆圈和某种程度的扩展.在那儿,右键单击-& gt;添加方法

step6:添加方法-& gt;选择参数,键入参数名称
然后您可以在该方法中键入代码.现在,您可以添加DLL.DLL名称将以与您自己指定的vc ++项目名称相同的名称创建..

有关更多详细信息:访问
http://msdn.microsoft.com/zh-CN/library/jj154138.aspx

我希望它对您非常有用..</pre>
< b>< pre lang ="text"></pre></b>
<pre lang="css">Making Dll is very easier one..
create like this:
step 1: vc++ project ---&gt;ATL ptoject
step 2: application setting will be appear in that select server type as Dynamic

linking libraray(DLL) .then click finish button ...dont select attributed option if you

have in that.
step 3:In class view --&gt;right click --&gt;add class .
step 4:Iin add class choose ATL simple object and double click that
ATL simple object wizard will appear .In that type any name as your wishes
and in options select connection points.then click finish button

step5:In class view click to expand it ..Now can see an interface icon will be like

small circle and some extention.In that right click --&gt;add method

step6:add method--&gt; select parameter,type parameter name
and you can type your code inside that method.and bulid it now you can add DLL .The dll name will be create in the same name as vc++ projcet name given by youself..

For more details:visit
http://msdn.microsoft.com/en-us/library/jj154138.aspx

i hope it very useful for you..</pre>
<b><pre lang="text"></pre></b>


这篇关于使用vc ++进行智能卡编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆