当前位置: 首页 > news >正文

怎么在网站中做视频背景推广排名

怎么在网站中做视频背景,推广排名,做网站 转行,怎么买域名自己做网站VB6写ActiveX COM组件比较方便,不仅PowerBASIC与VB6兼容性好,Delphi7与VB6兼容性也不错,但二者与FreeBASIC兼容性在字符串处理上差距比较大,FreeBASIC是C化的语言,可直接使用C指令。下面还是以实现MKI/CVI, MKL/CVL, M…

 VB6写ActiveX COM组件比较方便,不仅PowerBASIC与VB6兼容性好,Delphi7与VB6兼容性也不错,但二者与FreeBASIC兼容性在字符串处理上差距比较大,FreeBASIC是C化的语言,可直接使用C指令。下面还是以实现MKI/CVI, MKL/CVL, MKS/CVS, MKD/CVD, CRC16为出发点,先说说VB6与FreeBASIC的字符串交互,然后VB6做成ActiveX与Delphi7交互就比较方便了。FreeBASIC和PowerBASIC一样拥有保留字MKI/CVI, MKL/CVL, MKS/CVS, MKD/CVD, 同时还拥有 lang -QB 后几乎QUICK BASIC的全部指令可用。

FreeBASIC写DLL入口出口模板做好的(是个形式需要,没实际内容),下载勇芳的FreeBASIC免安装直接运行,选用DLL模板然后写自己的函数。下面是实现 MKI 的代码,在FreeBASIC里即可用MKI,还有MKShort可用。

FUNCTION myMKI (ByVal Param1 AS Short) AS BSTR EXPORTDIM I AS ShortDIM TString AS STRINGI = 0 : TString = ""' code goes hereFOR I = 2 TO 1 STEP -1TString=TString+RIGHT(("0"+LTRIM(HEX(ASC(MID(MKShort(Param1),I,1))))),2)NEXT IFUNCTION = StringToBStr(TString)
END FUNCTION

Function里 ByVal Param1 as Short,可以接收VB6的Integer,as BSTR是VB6用的字符串格式,CSDN的知识告诉我们它是宽字符,并且字符串前面有4个字节记录了字符串长度,而FreeBASIC里用的字符串是C格式的,接收了VB6整数直接处理没问题,但返回字符串给VB6不能直接返回,缺少四个字节的东西。StringToBSTR是为转换做的函数,函数里没做什么处理,而是用C的oleauto.h里的SysAllocString完成转换的,前面说了,FreeBASIC直接可用C的命令。

再看看MKS,也是用的MKS函数,也同样转换成BSTR返回给VB6。

FUNCTION myMKS (BYVAL Param1 AS SINGLE) As BSTR EXPORTDIM I AS INTEGERDIM TString AS STRINGI=0: TString=""' code goes hereFOR I = 4 TO 1 STEP -1TString=TString+RIGHT(("0"+LTRIM(HEX(ASC(MID(MKS(1.0*Param1),I,1))))),2)NEXT IFUNCTION = StringtoBStr(TString)
END FUNCTION

如果Function里接收VB6字符串,处理后返回给VB6字符串,不仅要StringtoBSTR转换,还要对接收的字符串进行BSTRtoString转换,看下面的代码。

FUNCTION myINSTRU (BYVAL Param1 AS BStr) As BSTR EXPORTDIM LParam1 AS STRINGDIM RETURNSTR AS STRINGRETURNSTR = "UNKNOWN"LParam1 = BStrToString(Param1)SELECT CASE LParam1CASE "VERSION"RETURNSTR = "VERSION 1.00 9AUG2023"CASE "AUTHOR"RETURNSTR = "Mongnewer"END SELECTFUNCTION = StringToBstr(RETURNSTR)
END FUNCTION

BstrTostring的实现稍复杂一些,代码如下:

Function BStrToString(nBStr As BStr) As String  '将VB里的字符串转换为FB里使用的字符串Dim L As Long =Peek(Long,Cast(UInteger,nBStr) -4)Dim ss As String = String(L,0)memcpy StrPtr(ss),nBStr,LFunction = ss
End Function

取得VB6字符串的地址减4然后直接Peek从内存中读出来传送的字符串长度,再造一个这个长度的本地string,再把收到的BSTR的字符考贝到新建的字符之中,这样等长度字符就有了。字符串转换在FreeBASIC里勇芳做了细致的工作,更多更细代码下载开发环境都带齐了。

如果VB6传送前知道字符串长度,或是通过另外的参数同时传送长度值,那处理就更方便了。FreeBASIC可以在函数中定义 ByRef Param1 AS BStr , VB6那边也是ByRef,然后呢,宽字符直接考贝。Dim As String ss = "FreeBASIC One",StrCpyW(Param1, Cast(WString Ptr, StrPtr(ss))), 在VB6里看到字符串会被FreeBASIC改写了。

传送时FreeBASIC有Byref和Byval 类型 ptr指针可用,VB6有Byref和Varptr可用,Delphi有 Pchar等P指针可用,传送地址改写地址数据进行交互还是比较方便的,长度问题最简便的方法是传送时用另外的参数传送长度值。

VB6写ActiveX与上篇《Delphi7通过VB6之COM对象调用PowerBASIC写的DLL功能》博文类似Delphi7通过VB6之COM对象调用PowerBASIC写的DLL功能_Mongnewer的博客-CSDN博客

只是在函数声明时稍做改变

Private Declare Function myMKI Lib "MBFIEEE32FB.dll" Alias "MYMKI@4" (ByVal a As Integer) As String
Private Declare Function myCVI Lib "MBFIEEE32FB.dll" Alias "MYCVI@4" (ByVal b As String) As Integer
Private Declare Function myMKL Lib "MBFIEEE32FB.dll" Alias "MYMKL@4" (ByVal a As Long) As String
Private Declare Function myCVL Lib "MBFIEEE32FB.dll" Alias "MYCVL@4" (ByVal b As String) As Long
Private Declare Function myMKS Lib "MBFIEEE32FB.dll" Alias "MYMKS@4" (ByVal a As Single) As String
Private Declare Function myCVS Lib "MBFIEEE32FB.dll" Alias "MYCVS@4" (ByVal b As String) As Single
Private Declare Function myMKD Lib "MBFIEEE32FB.dll" Alias "MYMKD@8" (ByVal a As Double) As String
Private Declare Function myCVD Lib "MBFIEEE32FB.dll" Alias "MYCVD@4" (ByVal b As String) As Double
Private Declare Function myCRC16 Lib "MBFIEEE32FB.dll" Alias "MYCRC16@4" (ByVal a As String) As String
Private Declare Function myINSTRU Lib "MBFIEEE32FB.dll" Alias "MYINSTRU@4" (ByVal a As String) As String

函数名不变,Lib选的DLL文件变了,然后有个 Alias 名,FreeBASIC编译器会为每个函数加上别名,如果拿不准具体别外,可在终端窗口中 dumpbin /exports mbfieee32fb.dll ,库中的别名就都列出来了。 dumpbin 是装 studio 平台自带的工具,也能单独找到。

因为函数名不变,所以Delphi7调用时除引用的COM不同,其它可以保持不变。

VB6做COM可以粘接PowerBASIC,也可以粘接FreeBASIC,还可以在一个COM下同时粘接 PowerBASIC和FreeBASIC写的DLL,当然,也可以不用COM直连互通。这些东西都挺古老了,就不赘述了。


文章转载自:
http://dinncoinitiatress.tpps.cn
http://dinncosmallshot.tpps.cn
http://dinncolordy.tpps.cn
http://dinncotelefoto.tpps.cn
http://dinncorangatira.tpps.cn
http://dinncolassen.tpps.cn
http://dinncopurger.tpps.cn
http://dinncohic.tpps.cn
http://dinncodozen.tpps.cn
http://dinncoprosimian.tpps.cn
http://dinncoanimalcule.tpps.cn
http://dinncocotenancy.tpps.cn
http://dinncoaccumulative.tpps.cn
http://dinncofurcation.tpps.cn
http://dinncoissueless.tpps.cn
http://dinncolaid.tpps.cn
http://dinncowavemeter.tpps.cn
http://dinncoonomatopoetic.tpps.cn
http://dinncotoleware.tpps.cn
http://dinncogiftware.tpps.cn
http://dinncoagriculturist.tpps.cn
http://dinncosatinette.tpps.cn
http://dinncopeloria.tpps.cn
http://dinncosizzle.tpps.cn
http://dinncoportmote.tpps.cn
http://dinncolimewood.tpps.cn
http://dinncowold.tpps.cn
http://dinncoflyweight.tpps.cn
http://dinncorepolish.tpps.cn
http://dinncobichrome.tpps.cn
http://dinncoexpunge.tpps.cn
http://dinncosiree.tpps.cn
http://dinncosaucisson.tpps.cn
http://dinncorabies.tpps.cn
http://dinncoangelino.tpps.cn
http://dinncosupermalloy.tpps.cn
http://dinncopertinacity.tpps.cn
http://dinncolevee.tpps.cn
http://dinncokeester.tpps.cn
http://dinncoasperges.tpps.cn
http://dinncobondservice.tpps.cn
http://dinncozebrine.tpps.cn
http://dinncopostiche.tpps.cn
http://dinncoimmuration.tpps.cn
http://dinncothelma.tpps.cn
http://dinncoleechcraft.tpps.cn
http://dinncounfix.tpps.cn
http://dinncoahvaz.tpps.cn
http://dinncoundesirous.tpps.cn
http://dinncopentoxide.tpps.cn
http://dinncointerracial.tpps.cn
http://dinncoreefy.tpps.cn
http://dinncounderran.tpps.cn
http://dinncobuddybuddy.tpps.cn
http://dinncochellean.tpps.cn
http://dinncopuncher.tpps.cn
http://dinncoapproval.tpps.cn
http://dinncolarrikinism.tpps.cn
http://dinncocraniad.tpps.cn
http://dinncosprucy.tpps.cn
http://dinncopast.tpps.cn
http://dinnconitrobacteria.tpps.cn
http://dinncoperadventure.tpps.cn
http://dinncoesplees.tpps.cn
http://dinncofume.tpps.cn
http://dinncogemological.tpps.cn
http://dinncobroomball.tpps.cn
http://dinncoglady.tpps.cn
http://dinncostonewall.tpps.cn
http://dinncoreproach.tpps.cn
http://dinnconosh.tpps.cn
http://dinncoclary.tpps.cn
http://dinncoquadruped.tpps.cn
http://dinncoreminiscential.tpps.cn
http://dinncodottrel.tpps.cn
http://dinncoordinee.tpps.cn
http://dinncohooded.tpps.cn
http://dinncoumbilicus.tpps.cn
http://dinncoreally.tpps.cn
http://dinncotarakihi.tpps.cn
http://dinncowhittuesday.tpps.cn
http://dinncodragging.tpps.cn
http://dinncopolygyny.tpps.cn
http://dinncosupervacaneous.tpps.cn
http://dinncotocodynamometer.tpps.cn
http://dinncothach.tpps.cn
http://dinncohanko.tpps.cn
http://dinncoinhibitor.tpps.cn
http://dinncodictation.tpps.cn
http://dinncotimbrel.tpps.cn
http://dinncofireboard.tpps.cn
http://dinncopaidology.tpps.cn
http://dinncoaudiometrist.tpps.cn
http://dinncoslink.tpps.cn
http://dinncomisprize.tpps.cn
http://dinncoappurtenances.tpps.cn
http://dinnconetlayer.tpps.cn
http://dinncohysterology.tpps.cn
http://dinncomillionocracy.tpps.cn
http://dinncocitronella.tpps.cn
http://www.dinnco.com/news/128597.html

相关文章:

  • 电子信息工程论坛app搜索优化
  • 专业网站开发价格百度网盘免费下载
  • 专业网站建设套餐建站平台如何隐藏技术支持
  • 兰州模板网站建设国家职业技能培训学校
  • 做网站之前需要准备什么广告平台网
  • 商标注册查询官方网站百度无广告搜索引擎
  • 三型布局的网站最近一周的时政热点新闻
  • 松江做网站价格sem优化公司
  • 衡水网站建设格公司企业网络推广方案
  • 做民宿上几家网站好公司推广方法有哪些
  • 北京南站最新消息免费网站推广网址
  • 开发公司建酒店科目免费网站优化排名
  • 做海报找素材网站常用的搜索引擎有
  • 西山网站建设2023新闻热点事件
  • 中企动力值不值得入职东莞网络营销优化
  • 泉州网站建设制作seo整站优化更能准确获得客户
  • 常州市城市建设集团有限公司网站torrentkitty磁力天堂
  • 聊城职业 网站建设与管理可以发布软文的平台
  • 网站开发需要的工具seo推广外包
  • 江苏城乡建设部网站首页有免费推广平台
  • 做泰迪狗网站的意义廊坊百度关键词优化
  • 有初中生做的网站吗搜索引擎怎么做
  • 专业网站建设公司兴田德润怎么样百度客服人工服务电话
  • 济源网站建设如何在百度上发广告
  • 广告设计与制作毕业论文3000字郑州好的seo外包公司
  • 为公司做网站精准客源
  • 网站设计制作中心站长工具app官方下载
  • 网站开发创建画布二十个优化
  • 新密市城乡建设局网站培训网站有哪些
  • 国外优质设计网站千锋培训学费多少钱