新建一个ActivexDll的工程,添加一个Form,在Class内添加使其Show的代码例如 public sub ShowConfigForm() Form1.Show end sub然后在Form1作保存到注册表,最后在Class再定义读取注册表, 关于注册表的操作,参见: http://www.sqreg.com/file/vb/reg_01.htm
你客户端要使用哪些配制信息 就放那些信息啊 譬如 我需要设置客户端的标题 然后可以在 ini文件里这样放: [SETTINGS] TITLE="工程1"然后在客户端读取TITLE 然后me.caption=strTitle另外使用ini的api: Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As Any, ByVal lpFileName As String) As Long
//什么样的中间层?假如是你自己制作!做个配置界面,把配置信息存到注册表或者INI文件中!然后在中间层读取这些信息再工作!
public sub ShowConfigForm()
Form1.Show
end sub然后在Form1作保存到注册表,最后在Class再定义读取注册表,
关于注册表的操作,参见:
http://www.sqreg.com/file/vb/reg_01.htm
vbr文件注册方法:clireg32.exe xxx.vbr -t xxx.tlb -d -s 服务器名 -q -nologo
注销用:regsvr32.exe xxx.vbr –u
譬如 我需要设置客户端的标题
然后可以在 ini文件里这样放:
[SETTINGS]
TITLE="工程1"然后在客户端读取TITLE
然后me.caption=strTitle另外使用ini的api:
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As Any, ByVal lpFileName As String) As Long