VB6 needs to implement some special functions, such as to implement image format conversion, etc., to download third-party components or write complex algorithms and call APIs.
But now you have a better choice to write the library you need in a third-party programming language and then call it.
Easy Language is a very simple and close to VB language. Judging from its variable statement, it is more like a Siemens PLC programming tool MicroWin.
Let me implement it simply in Yi language:
1. Open Easy Language and create a standard Windows DLL project.
2. Create a function.
3. Write code:
.Version 2 .Support library eImgConverter .Assembly Assembly1 .Subprogram _启动Subprogram, Integer type, , 请在本Subprogram中放置动态链接库初始化代码 _临时Subprogram () ' Call the test code after the initialization code is executed return (0) ' The return value is ignored. .Subprogram_Temporary Subprogram ' 本名称Subprogram用作测试程序用,Only valid in development and debugging environments,The program will be automatically cleared by the system before compiling and publishing,请将所有用作测试的临时代码放在本Subprogram中。 ***注意不要修改本Subprogram的名称、parameter及return值类型。 .Subprogram ToJPG, Logical, public, Convert pictures toJPEG .parameter SOU, Text type .parameter DES, Text type Convert toJPG (SOU, DES, Fake, 75, real, 0)
4. Now you only need static compilation to output a DLL with function output, the function name is ToJPG. For example, if I output it now in E:\, then the usage method in Basic is:
Private Declare Function ToJPG lib "E:\" (byval SOU as string,byval DES as string) as integer
Call TOJPG("C:\","C:\")
Of course, Yi Language provides more powerful and simple class libraries. If you have tried to use .net to extend vb6 or have always coveted the powerful functions of .net, then using Yi Language to extend basic is a good choice.