由于朋友他必须要用delphi调用.net 下的一个过程,.但是不会,找到我,我也觉得以前没有弄过,所以我 就到处找资料,找到后但都不是很全,摸索了几个小时,终于调通了,把过程给大家分享一下
这个是com的主体文件
using
System;
using
System.Runtime.InteropServices;
using
System.IO;
using
System.Text;
using
System.Security.Cryptography;
//
3desj加密
namespace
_des
...
{
[Guid("8B090A3D-9A44-4be6-9971-C7DFF9E111BB")]
//这个Guid 用工具---genguid 注册 生成一个系统没有用的值
public interface DBCOM_Interface
...{
[DispId(1)]
string DES3Encrypt(string strString, string strKey);
[DispId(2)]
string DES3Decrypt(string strString, string strKey);
[DispId(3)]
void Encrypt(ref byte[] Data, Int32 DataLen, byte[] Key);
}
// Events interface Database_COMObjectEvents
[Guid("356D756C-0E42-49d6-A646-AACF7B5B04A9"),
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface DBCOM_Events 
本文分享了如何使用Delphi调用.NET下编译的COM组件的全过程,包括创建COM主体文件、生成和注册DLL、使用BAT文件简化注册步骤,以及在Delphi中调用的方法。通过这些步骤,即使不熟悉.NET的Delphi开发者也能成功调用.NET COM组件。
3601

被折叠的 条评论
为什么被折叠?



