.vb引用里面的*.tlb是怎么制作

.vb引用里面的*.tlb是怎么制作,第1张

TLB是一种OLE(或ActiveX)定义文件,它包括常数、接口(Interface)、类等的定义。

可以在VB的集成环境的Project|Reference中将TLB文件加入项目,然后在Object Browser中看到该文件中包括哪些常数、接口、类,而每个类又包括什么方法和属性。

微软提供的各种SDK中通常包括一个或数个TLB文件以方便编程。

也可以自己制作TLB文件,首先编写一个ODL文件(在VC++的帮助中有语法说明),然后使用MKTYPLIB(在VB光盘上有)编译生成TLB文件。

vb要显示透明png,gdi+是最好的办法了,它支持半透明。但是,要下载gdiplus.tlb( http://www.vbaccelerator.com/article.asp?id=4588外国网站)并且引用才行。如果引用了gdiplus.tlb ,那么可以使用下面的代码。Private TOKEN As Long

Private Graphics As Long Private Sub InitGDIPlus()

'初始化GDI+

Dim uInput As GdiplusStartupInput

uInput.GdiplusVersion = 1

If GdiplusStartup(TOKEN, uInput) <>Ok Then

'初始化错误

MsgBox "GDI+ 初始化错误。程序即将关闭。", vbCritical, "InitError"

End

End If

GdipCreateFromHDC Me.hDC, Graphics

GdipSetSmoothingMode Graphics, SmoothingModeAntiAlias

End Sub

Private Sub Form_Load()

InitGDIPlusDim image As LongGdipCreateBitmapFromFile "E:\image1.png", image

GdipDrawImage Graphics, image, 0, 0

GdipDisposeImage image

End Sub

Private Sub TerminateGDIPlus()

GdipDeleteGraphics Graphics '释放graphics占用的内存

GdiplusShutdown TOKEN '关闭GDI+

End Sub

Private Sub Form_Unload(Cancel As Integer)

TerminateGDIPlus

End Sub看看flash控件那种完美的半透明效果,谁说做不了,不过我也不懂。哎,如果实在没招,用个flash也不错。

不错,的确是兼容性引起的。不过好在还有方法可以运行。

找到VB6.exe,打开右键属性。选择以兼容模式运行这程序。可以XPSP3之类的。

然后就可以打开了。至于你要找所谓的VB6TMPL.TLB,那是找不到的。网上似乎也没有。

不过微软知识库中有一个解答,

注意这一段:HKEY_CLASSES_ROOT\TypeLib\{FCFB3D2E-A0FA-1068-A738-08002B3371B5}\6.0\9\win32

The

main

Visual

Basic

type

library

is

either

missing

or

mis-registered

for

the

current

user.

This

message

reflects

the

original

working

name

of

this

file

but

in

released

versions

of

Visual

Basic

this

file

was

renamed

VB6.olb

and

is

located

in

the

same

directory

as

the

Visual

Basic

6.0

executable

(VB6.exe).

The

registry

should

contain

a

path

to

this

file

under

the

following

key:

HKEY_CLASSES_ROOT\TypeLib\{FCFB3D2E-A0FA-1068-A738-08002B3371B5}\6.0\9\win32

If

the

key

is

missing

or

pointing

to

a

location

where

the

file

cannot

be

found,

Visual

Basic

returns

the

preceding

error

message

during

startup.


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11761635.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-18
下一篇 2023-05-18

发表评论

登录后才能评论

评论列表(0条)

保存