第一次在DELPHI下使用第三方控件,请高手指教:delphi如何使用C写的sdk???最好说下思路和经验,有相关资料介绍最好。我这两天在恶补C知识,因为第一次接触SDK,不知道如何开始,多谢指教~!!!
我QQ:270274971  E-MAIL:[email protected]   希望能帮忙的朋友交个朋友,有机会多交流下,我武汉的,来武汉的朋友我请吃热干面和鸭脖子~~~~

解决方案 »

  1.   

    用写写好并测试确定正确后给delphi调用就行了。需要编译出obj
    可以上老陈的网站www.138soft.com上看demo。比较简单的。
    不要在delphi里面写C的代码。
      

  2.   

    不然用别的工具把C代码封装成dll给delphi用不是也很方便吗
      

  3.   

    不然用别的工具把C代码封装成dll给delphi用不是也很方便吗
    -----------
    哎,我是菜鸟啊,还不知道怎么封装C代码成DLL的        努力学习了
      

  4.   

    用vc或是bcb ,不是都有向导吗,其他代码基本上一样,就是要写输出函数而已。网上找个dll的写发就知道了,不过采用不能语言有一点点区别。
      

  5.   

    我用过的很多SDK都是提供DLL库的,但用的是C++的头文件,如果要在Delphi中用的话,不单是要重新定义DLL函数引入,还要重定义各种数据结构。
    不知LZ是不是这样的情况,这不是用C封装DLL能解决的,除非提供的SDK是CPP源文件。
      

  6.   

    constantine(飘遥的安吉儿)
    -------------------
    我现在知道怎么编写DLL和调用DLL了,可是情况和 bomdy(昏昏欲睡的虫子)  说的样,现在我不知道怎么样调用*.H这样的头文件,是要把*.H重新编译成*.PAS吗?
      

  7.   

    是要把*.H重新编译成*.PAS吗?恐怕你得把.H文件按Pascal语法重写一遍
      

  8.   

    我现在知道怎么编写DLL和调用DLL了,可是情况和 bomdy(昏昏欲睡的虫子)  说的样,现在我不知道怎么样调用*.H这样的头文件,是要把*.H重新编译成*.PAS吗?============================================================Delphi中的申明需要自己根据C中的头文件进行改写。
      

  9.   

    jadeluo(秀峰) ( ) 信誉:100    Blog   加为好友  2007-05-22 08:14:08  得分: 0  
     
     
       我现在知道怎么编写DLL和调用DLL了,可是情况和 bomdy(昏昏欲睡的虫子)  说的样,现在我不知道怎么样调用*.H这样的头文件,是要把*.H重新编译成*.PAS吗?============================================================Delphi中的申明需要自己根据C中的头文件进行改写。
      
     ----------------------------
    哦,那就是说现在需要把.H文件写成.PAS重新编译下了,,,昏,语句不少的啊 
      怎么能把.H文件加到程序中而不去修改.H头文件为.PAS
      

  10.   

    用个delphi to C的软件处理一下,我记得有这样的工具,只是估计部分需要自己做个简单的修改
      

  11.   

    你可以用headconv试试,http://www.ebob42.com/ftp/headconv.zip,不过转完后自己还是要检查一下,可能要做些校正,不过毕竟省了不少功夫了,聊胜于无吧。
      

  12.   

    /*************************************************
    Copyright (C), 2002-2005, Power Infomation Tech. Co., Ltd.
    File name:      tpkRtd.h
    Author:Jian Jun       Version: 1.0       Date: 2004-12-20 
    Description:    This header File declares all the SDK display interfaces.
    And this file must be included when tpkRtd.dll or 
    tpkRtd.lib invoked. 
    Function List:  
    1.Initialization function: tpkInitSystem
    2.Deconstructor: tpkFreeSystem   *************************************************/
    #ifndef _3YX_TOPACK_RTD_H_
    #define _3YX_TOPACK_RTD_H_#include <Windows.h>
    #include "tpkRtdType.h"/************************************************/
    #define TPKRTDAPI __stdcall/************************************************/
    /***********General Functiions*******************/
    /************************************************/
    short TPKRTDAPI tpkInitSystem(short nMode);//Only BACKGROUND_MODE supported by this release
    short TPKRTDAPI tpkFreeSystem();
    short TPKRTDAPI tpkInitBoard (short nBoardNum, short nVideoMode, unsigned short unFuncMode);
    short TPKRTDAPI tpkFreeBoard (short nBoardNum);BOOL TPKRTDAPI tpkInitialEvent(short nBoardNum, int iEventType,char* strEvent); 
    BOOL TPKRTDAPI tpkCloseEvent(short nBoardNum, char* strEvent);short TPKRTDAPI tpkDiagnoses(short nBoardNum, char *szFileName);
    short TPKRTDAPI tpkPrintErr (LPSTR lpszErrMsg, DWORD dwMaxLen);short TPKRTDAPI tpkGetParams (short nBoardNum, unsigned int uiParamNum, LPLONG pParamVal);
    short TPKRTDAPI tpkSetParams (short nBoardNum, unsigned int uiParamNum, unsigned int uiParamVal);short TPKRTDAPI tpkGetVideoPos(short nBoardNum,LPRECT lpRect);
    short TPKRTDAPI tpkSetVideoPos(short nBoardNum,LPRECT lpRect);short TPKRTDAPI tpkGetVideoRect(short nBoardNum,LPRECT lpRect);
    short TPKRTDAPI tpkSetVideoRect(short nBoardNum,LPRECT lpRect);
    /************************************************/
    /***********General Functiions End***************/
    /************************************************//************************************************/
    /***********File Oriented Functiions*************/
    /************************************************/
    short TPKRTDAPI tpkOpen (short nBoardNum,LPCCH strFileName,unsigned int uiOffsetHigh,unsigned int uiOffsetLow);
    short TPKRTDAPI tpkOpen2Frame (short nBoardNum,LPCCH strFileName,int iMarkIn);
    short TPKRTDAPI tpkOpen2Time (short nBoardNum,LPCCH strFileName,unsigned int *pMarkInTime);
    short TPKRTDAPI tpkOpenIFO2Frame (short nBoardNum,LPCCH strFileName,int iChapter,unsigned int *pMarkIn);
    short TPKRTDAPI tpkOpenIFO2Time (short nBoardNum,LPCCH strFileName,int iChapter,unsigned int *pMarkInTime);
    short TPKRTDAPI tpkClose (short nBoardNum);
    /************************************************/
    /***********File Oriented Functiions End*********/
    /************************************************//************************************************/
    /***********Rediffusion Functions****************/
    /************************************************/
    short TPKRTDAPI tpkRediffusion(short nBoardNum);/************************************************/
    /***********Playback Functions*******************/
    /************************************************/
    short TPKRTDAPI tpkPlay (short nBoardNum, long lPlayFrom, long lPlayTo, short nSpeed);
    short TPKRTDAPI tpkStop (short nBoardNum);
    short TPKRTDAPI tpkPause (short nBoardNum);
    short TPKRTDAPI tpkContinue (short nBoardNum);
    short TPKRTDAPI tpkSingle (short nBoardNum);
    short TPKRTDAPI tpkScan (short nBoardNum);
    short TPKRTDAPI tpkSeek(short nBoardNum, long lPlayFrom);
    /************************************************/
    /***********Playback Functions End***************/
    /************************************************//************************************************/
    /***********Buffer function**********************/
    /************************************************/
    short TPKRTDAPI tpkBaSetAllocSize(short nBoardNum, DWORD dwAllocBufSize);/************************************************/
    /***********OSD Functions****************/
    /************************************************/
    BOOL TPKRTDAPI tpkGetMemAddress( short nBoardNum,unsigned long &pMemAddr);
    void TPKRTDAPI tpkMemcpy(LPDWORD lpdwDes, LPDWORD lpdwSrc, DWORD dwSize);
    void TPKRTDAPI tpkMemset(LPDWORD lpdwDes,DWORD dwColor,DWORD dwSize);// Card Status Functions
    BOOL TPKRTDAPI tpkGetFieldNo(short nBoardNum,unsigned long &ulFieldNo );BOOL TPKRTDAPI tpkGetVideoBase(short nBoardNum,unsigned long &ulAddress);
    BOOL TPKRTDAPI tpkSetVideoBase(short nBoardNum,unsigned long ulAddress);// Data Functions
    BOOL TPKRTDAPI tpkGetPoint(short nBoardNum,int x, int y, unsigned long& ulValue);
    BOOL TPKRTDAPI tpkSetPoint(short nBoardNum,int x, int y, unsigned long ulValue);
    BOOL TPKRTDAPI tpkGetRow(short nBoardNum,int y, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkSetRow(short nBoardNum,int y, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkGetPartRow(short nBoardNum,int x, int y, int iWidth, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkSetPartRow(short nBoardNum,int x, int y, int iWidth, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkGetColumn(short nBoardNum,int x, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkSetColumn(short nBoardNum,int x, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkGetPartColumn(short nBoardNum,int x, int y, int iHeight, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkSetPartColumn(short nBoardNum,int x, int y, int iHeight, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkGetScreen(short nBoardNum,unsigned long* lpulValue, int number);
    BOOL TPKRTDAPI tpkSetScreen(short nBoardNum,unsigned long* lpulValue, int number);
    BOOL TPKRTDAPI tpkClearCurrentScreen(short nBoardNum);
    BOOL TPKRTDAPI tpkGetRectangle(short nBoardNum,int x, int y, int iWidth, int iHeight, unsigned long* lpulValue);
    BOOL TPKRTDAPI tpkSetRectangle(short nBoardNum,int x, int y, int iWidth, int iHeight, unsigned long* lpulValue);// Background Functions
    BOOL TPKRTDAPI tpkGetBkgAddress( short nBoardNum,unsigned long &pMemAddr);
    BOOL TPKRTDAPI tpkUpdateBkg(short nBoardNum);
    /************************************************/
    /***********OSD Functions End************/
    /************************************************/#endif
    -------------------------------
    看来是要把上面的这些东东重新用PAS写一遍了,,,然后调用DLL,,,有朋友HELP更好啊
      

  13.   

    大多数SDK提供的是dll
    对于头文件需要使用Delphi重写一遍标准C/C++中的大部分数据类型在Delphi中都有对应的
    重写头文件时,可以参考下面的帖子
    http://www.drbob42.com/delphi/headconv.htm
      

  14.   

    用VC写成DLL,Delphi 再调用
      

  15.   

    呵呵,用headconv转的,没校验过unit 3YX_TOPACK_RTD;
    {**************************************************************************}
    {                                                                          }
    {    This C DLL header file first (automatic) conversion generated by:     }
    {    HeadConv 4.0 (c) 2000 by Bob Swart (aka Dr.Bob - www.drbob42.com)     }
    {      Final Delphi-Jedi (Darth) command-line units edition                }
    {                                                                          }
    {    Generated Date: 2007/05/24                                            }
    {    Generated Time:  9:43:28                                              }
    {                                                                          }
    {**************************************************************************}interface
    uses
    {$IFDEF WIN32}
      Windows;
    {$ELSE}
      Wintypes, WinProcs;
    {$ENDIF}{+//************************************************ }
    {-Copyright (C), 2002-2005, Power Infomation Tech. Co., Ltd. }
    {-File name: tpkRtd.h }
    {-Author:Jian Jun Version: 1.0 Date: 2004-12-20 }
    {-Description: This header File declares all the SDK display interfaces. }
    {-And this file must be included when tpkRtd.dll or }
    {-tpkRtd.lib invoked. }
    {-Function List: }
    {-1.Initialization function: tpkInitSystem }
    {-2.Deconstructor: tpkFreeSystem }{=************************************************ }
    {$IFNDEF _3YX_TOPACK_RTD_H_}
    {$DEFINE _3YX_TOPACK_RTD_H_}{$INCLUDE <Windows.h>}
    {$INCLUDE "tpkRtdType.h"}{+//***********************************************/ }
    const
      TPKRTDAPI = __stdcall;{+//***********************************************/ }
    {+//**********General Functiions*******************/ }
    {+//***********************************************/ }function tpkInitSystem(nMode: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkFreeSystem: SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkInitBoard(nBoardNum: SmallInt; 
                          nVideoMode: SmallInt; 
                          unFuncMode: Word): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkFreeBoard(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    function tpkInitialEvent(nBoardNum: SmallInt; 
                             iEventType: Integer; 
                             strEvent: PChar): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkCloseEvent(nBoardNum: SmallInt; 
                           strEvent: PChar): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    function tpkDiagnoses(nBoardNum: SmallInt; 
                          szFileName: PChar): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkPrintErr(lpszErrMsg: PChar; 
                         dwMaxLen: LongInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    function tpkGetParams(nBoardNum: SmallInt; 
                          uiParamNum: DWord; 
                          var pParamVal: LongInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetParams(nBoardNum: SmallInt; 
                          uiParamNum: DWord; 
                          uiParamVal: DWord): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    function tpkGetVideoPos(nBoardNum: SmallInt; 
                            var lpRect: RECT): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetVideoPos(nBoardNum: SmallInt; 
                            var lpRect: RECT): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    function tpkGetVideoRect(nBoardNum: SmallInt; 
                             var lpRect: RECT): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetVideoRect(nBoardNum: SmallInt; 
                             var lpRect: RECT): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    {+//***********************************************/ }
    {+//**********General Functiions End***************/ }
    {+//***********************************************/ }{+//***********************************************/ }
    {+//**********File Oriented Functiions*************/ }
    {+//***********************************************/ }function tpkOpen(nBoardNum: SmallInt; 
                     var strFileName: CCH; 
                     uiOffsetHigh: DWord; 
                     uiOffsetLow: DWord): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkOpen2Frame(nBoardNum: SmallInt; 
                           var strFileName: CCH; 
                           iMarkIn: Integer): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkOpen2Time(nBoardNum: SmallInt; 
                          var strFileName: CCH; 
                          var pMarkInTime: DWord): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkOpenIFO2Frame(nBoardNum: SmallInt; 
                              var strFileName: CCH; 
                              iChapter: Integer; 
                              var pMarkIn: DWord): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkOpenIFO2Time(nBoardNum: SmallInt; 
                             var strFileName: CCH; 
                             iChapter: Integer; 
                             var pMarkInTime: DWord): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkClose(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    {+//***********************************************/ }
    {+//**********File Oriented Functiions End*********/ }
    {+//***********************************************/ }{+//***********************************************/ }
    {+//**********Rediffusion Functions****************/ }
    {+//***********************************************/ }function tpkRediffusion(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
      

  16.   


    {+//***********************************************/ }
    {+//**********Playback Functions*******************/ }
    {+//***********************************************/ }function tpkPlay(nBoardNum: SmallInt; 
                     lPlayFrom: LongInt; 
                     lPlayTo: LongInt; 
                     nSpeed: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkStop(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkPause(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkContinue(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSingle(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkScan(nBoardNum: SmallInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSeek(nBoardNum: SmallInt; 
                     lPlayFrom: LongInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    {+//***********************************************/ }
    {+//**********Playback Functions End***************/ }
    {+//***********************************************/ }{+//***********************************************/ }
    {+//**********Buffer function**********************/ }
    {+//***********************************************/ }function tpkBaSetAllocSize(nBoardNum: SmallInt; 
                               dwAllocBufSize: LongInt): SmallInt cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; {+//***********************************************/ }
    {+//**********OSD Functions****************/ }
    {+//***********************************************/ }function tpkGetMemAddress(nBoardNum: SmallInt; 
                              var pMemAddr: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; procedure tpkMemcpy(var lpdwDes: LongInt; 
                        var lpdwSrc: LongInt; 
                        dwSize: LongInt) cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; procedure tpkMemset(var lpdwDes: LongInt; 
                        dwColor: LongInt; 
                        dwSize: LongInt) cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; {/// Card Status Functions }function tpkGetFieldNo(nBoardNum: SmallInt; 
                           var ulFieldNo: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    function tpkGetVideoBase(nBoardNum: SmallInt; 
                             var ulAddress: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetVideoBase(nBoardNum: SmallInt; 
                             ulAddress: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; {/// Data Functions }function tpkGetPoint(nBoardNum: SmallInt; 
                         x: Integer; 
                         y: Integer; 
                         var ulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetPoint(nBoardNum: SmallInt; 
                         x: Integer; 
                         y: Integer; 
                         ulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkGetRow(nBoardNum: SmallInt; 
                       y: Integer; 
                       var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetRow(nBoardNum: SmallInt; 
                       y: Integer; 
                       var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkGetPartRow(nBoardNum: SmallInt; 
                           x: Integer; 
                           y: Integer; 
                           iWidth: Integer; 
                           var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetPartRow(nBoardNum: SmallInt; 
                           x: Integer; 
                           y: Integer; 
                           iWidth: Integer; 
                           var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkGetColumn(nBoardNum: SmallInt; 
                          x: Integer; 
                          var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetColumn(nBoardNum: SmallInt; 
                          x: Integer; 
                          var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkGetPartColumn(nBoardNum: SmallInt; 
                              x: Integer; 
                              y: Integer; 
                              iHeight: Integer; 
                              var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetPartColumn(nBoardNum: SmallInt; 
                              x: Integer; 
                              y: Integer; 
                              iHeight: Integer; 
                              var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
      

  17.   


    function tpkGetScreen(nBoardNum: SmallInt; 
                          var lpulValue: LongInt; 
                          number: Integer): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetScreen(nBoardNum: SmallInt; 
                          var lpulValue: LongInt; 
                          number: Integer): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkClearCurrentScreen(nBoardNum: SmallInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkGetRectangle(nBoardNum: SmallInt; 
                             x: Integer; 
                             y: Integer; 
                             iWidth: Integer; 
                             iHeight: Integer; 
                             var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkSetRectangle(nBoardNum: SmallInt; 
                             x: Integer; 
                             y: Integer; 
                             iWidth: Integer; 
                             iHeight: Integer; 
                             var lpulValue: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; {/// Background Functions }function tpkGetBkgAddress(nBoardNum: SmallInt; 
                              var pMemAddr: LongInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; function tpkUpdateBkg(nBoardNum: SmallInt): Bool cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; 
    {+//***********************************************/ }
    {+//**********OSD Functions End************/ }
    {+//***********************************************/ }{$ENDIF}implementationfunction tpkInitSystem; external '3YX_TOPACK_RTD.DLL';
    function tpkFreeSystem; external '3YX_TOPACK_RTD.DLL';
    function tpkInitBoard; external '3YX_TOPACK_RTD.DLL';
    function tpkFreeBoard; external '3YX_TOPACK_RTD.DLL';
    function tpkInitialEvent; external '3YX_TOPACK_RTD.DLL';
    function tpkCloseEvent; external '3YX_TOPACK_RTD.DLL';
    function tpkDiagnoses; external '3YX_TOPACK_RTD.DLL';
    function tpkPrintErr; external '3YX_TOPACK_RTD.DLL';
    function tpkGetParams; external '3YX_TOPACK_RTD.DLL';
    function tpkSetParams; external '3YX_TOPACK_RTD.DLL';
    function tpkGetVideoPos; external '3YX_TOPACK_RTD.DLL';
    function tpkSetVideoPos; external '3YX_TOPACK_RTD.DLL';
    function tpkGetVideoRect; external '3YX_TOPACK_RTD.DLL';
    function tpkSetVideoRect; external '3YX_TOPACK_RTD.DLL';
    function tpkOpen; external '3YX_TOPACK_RTD.DLL';
    function tpkOpen2Frame; external '3YX_TOPACK_RTD.DLL';
    function tpkOpen2Time; external '3YX_TOPACK_RTD.DLL';
    function tpkOpenIFO2Frame; external '3YX_TOPACK_RTD.DLL';
    function tpkOpenIFO2Time; external '3YX_TOPACK_RTD.DLL';
    function tpkClose; external '3YX_TOPACK_RTD.DLL';
    function tpkRediffusion; external '3YX_TOPACK_RTD.DLL';
    function tpkPlay; external '3YX_TOPACK_RTD.DLL';
    function tpkStop; external '3YX_TOPACK_RTD.DLL';
    function tpkPause; external '3YX_TOPACK_RTD.DLL';
    function tpkContinue; external '3YX_TOPACK_RTD.DLL';
    function tpkSingle; external '3YX_TOPACK_RTD.DLL';
    function tpkScan; external '3YX_TOPACK_RTD.DLL';
    function tpkSeek; external '3YX_TOPACK_RTD.DLL';
    function tpkBaSetAllocSize; external '3YX_TOPACK_RTD.DLL';
    function tpkGetMemAddress; external '3YX_TOPACK_RTD.DLL';
    procedure tpkMemcpy; external '3YX_TOPACK_RTD.DLL';
    procedure tpkMemset; external '3YX_TOPACK_RTD.DLL';
    function tpkGetFieldNo; external '3YX_TOPACK_RTD.DLL';
    function tpkGetVideoBase; external '3YX_TOPACK_RTD.DLL';
    function tpkSetVideoBase; external '3YX_TOPACK_RTD.DLL';
    function tpkGetPoint; external '3YX_TOPACK_RTD.DLL';
    function tpkSetPoint; external '3YX_TOPACK_RTD.DLL';
    function tpkGetRow; external '3YX_TOPACK_RTD.DLL';
    function tpkSetRow; external '3YX_TOPACK_RTD.DLL';
    function tpkGetPartRow; external '3YX_TOPACK_RTD.DLL';
    function tpkSetPartRow; external '3YX_TOPACK_RTD.DLL';
    function tpkGetColumn; external '3YX_TOPACK_RTD.DLL';
    function tpkSetColumn; external '3YX_TOPACK_RTD.DLL';
    function tpkGetPartColumn; external '3YX_TOPACK_RTD.DLL';
    function tpkSetPartColumn; external '3YX_TOPACK_RTD.DLL';
    function tpkGetScreen; external '3YX_TOPACK_RTD.DLL';
    function tpkSetScreen; external '3YX_TOPACK_RTD.DLL';
    function tpkClearCurrentScreen; external '3YX_TOPACK_RTD.DLL';
    function tpkGetRectangle; external '3YX_TOPACK_RTD.DLL';
    function tpkSetRectangle; external '3YX_TOPACK_RTD.DLL';
    function tpkGetBkgAddress; external '3YX_TOPACK_RTD.DLL';
    function tpkUpdateBkg; external '3YX_TOPACK_RTD.DLL';end.
      

  18.   

    已经了解的差不多了,不过没有硬件,还没检验结果,再问个问题:::
    1、
        const
        TW8VDLL='TW8VID32.dll';         {1.初始化函数}
        function TV_Installed:integer ; STDCALL; external TW8VDLL;
    2、
      var
      TV_Installed: function: Integer cdecl  {$IFDEF WIN32} stdcall {$ENDIF}; procedure LoadDLL;
    begin
      if DLLLoaded then Exit;
    {$IFNDEF MSDOS}
      ErrorMode := SetErrorMode($8000{SEM_NoOpenFileErrorBox});
    {$ENDIF}
      DLLHandle := LoadLibrary('TW8VID.DLL');
      if DLLHandle >= 32 then
      begin
        DLLLoaded := True;
        SaveExit := ExitProc;
        ExitProc := @NewExit;
        @TV_Installed := GetProcAddress(DLLHandle,'TV_Installed');
      {$IFDEF WIN32}
        Assert(@TV_Installed <> nil);
      {$ENDIF}
    1和2表示的是一个意思吗?
      

  19.   

    谢谢大家的帮忙!!!
    ////////////*********************************//////////////////////
    又研究了下,问题快解决了,再问个问题:
    /*--MAIN_VIDEO_INFO--*/
    typedef struct tagMAIN_VIDEO_INFO
    {
    unsigned short unVPID;
    unsigned char ucStreamID;
    unsigned char fGetInfo:3; 
    unsigned char fSecondField:1;
    unsigned char fGetPTS:3; 
    unsigned char   fTimecode:1;//时码是否正常
    VIDEO_TYPE VideoType;
    SEQ_INFO SeqInfo;
    __int64 qwFirstVPTS;
    __int64 qwLastVPTS;
    TIME_CODE FirstTimeCode;
    TIME_CODE LastTimeCode;
    unsigned char ucReserved[8];
    struct tagMAIN_VIDEO_INFO *pNext;
    }MAIN_VIDEO_INFO, far *LP_MAIN_VIDEO_INFO;上面unsigned char fGetInfo:3;那个:3好象是什么位段,怎么转换DELPHI???__int64应该就是INT64类型吧,谢谢高手帮忙把这个记录转换下~~
      

  20.   

    这个应该做不到,delphi没有这个,他表示的是位数,
    unsigned char fGetInfo:3; 
    unsigned char fSecondField:1;
    unsigned char fGetPTS:3; 
    unsigned char   fTimecode:1;//时码是否正常
    这几个是强行限制大小,再这里4个加起来才1byte大小,fGetInfo用了3bit,fSecondField用了1bit,....
    你可能需要定义成一个变量然后进行位操作赋值或者读取了。这种东西不少通信中会定义这样的协议。
      

  21.   

    constantine(飘遥的安吉儿) 
    ------------------
    我还准备当赋初值处理的,看来是不能了,再想办法了,怎么网上没有这方面的说明的
      

  22.   

    用一个byte的字段表示,然后进行位操作就行了,也不是很难,没什么。
    这个东西估计再网上很难差,毕竟用的人少。找个C/C++的群问就知道了,比如C区的饼子堂之类的。你这里还就3个需要处理而已已经简单了。我现在接触的每个WORD的16个位表示都不一样那才麻烦呢。
      

  23.   

    关于C位域操作可参见:
    http://community.csdn.net/Expert/topic/5599/5599850.xml?temp=2.987307E-02