| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 521 人关注过本帖
标题:vb怎么调用c++生成的动态链接库,就是vb开发sdk
只看楼主 加入收藏
大先生
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-4-13
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
vb怎么调用c++生成的动态链接库,就是vb开发sdk
#ifndef __COM_TYPE_H__
#define __COM_TYPE_H__
#ifdef COM_OS_LINUX
    #define AVDSDK_API __attribute ((visibility("default")))
    #define AVDSDK_APICALL
#elif defined COM_OS_ANDROID
    #define AVDSDK_API
    #define AVDSDK_APICALL
#elif defined AVDLIB_LIB
    #define AVDSDK_API
    #define AVDSDK_APICALL
#else
    #define AVDSDK_API    __declspec(dllexport)
    #define AVDSDK_APICALL  __stdcall
    #endif  

#ifdef __cplusplus
    #if __cplusplus
        extern "C"{
    #endif
#endif /* __cplusplus */
    typedef unsigned char          COM_U8;
    typedef unsigned char          COM_UCHAR;
    typedef unsigned short         COM_U16;
    typedef unsigned int           COM_U32;
    typedef signed char            COM_S8;
    typedef short                  COM_S16;
    typedef int                    COM_S32;
#ifndef _M_IX86
    typedef unsigned long long     COM_U64;
    typedef long long              COM_S64;
#else
    typedef __int64                COM_U64;
    typedef __int64                COM_S64;
#endif
    typedef char                   COM_CHAR;
    typedef char*                  COM_PCHAR;
    typedef float                  COM_FLOAT;
    typedef double                 COM_DOUBLE;
    typedef void                   COM_VOID;
    typedef unsigned long          COM_SIZE_T;
    typedef unsigned long          COM_LENGTH_T;
    typedef unsigned long          COM_ULONG;
    typedef long                   COM_LONG;
    typedef enum {
        COM_FALSE    = 0,
        COM_TRUE     = 1,
    }COM_BOOL;
#ifndef NULL
    #define NULL                    0L
#endif
    #define COM_NULL                  0L
#define COM_NULL_PTR              0L
#define COM_SUCCESS              1
#define COM_FAILURE              0
#define COM_NOIMPLEMENT              0
#ifdef __cplusplus
    #if __cplusplus
        }
    #endif
#endif /* __cplusplus */
#endif /* __COM_TYPE_H__ */
这是头文件

#ifndef _COM_AVD_DEV_SDK_H_
#define _COM_AVD_DEV_SDK_H_

#include "com_type.h"
#include <vector>
using std::vector;

#ifdef __cplusplus
extern "C"
{
#endif
    /**************************************    IMPELEMENTED     ***********************************************/
    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_Init();

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_DeInit();

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_OpenCamera(COM_LONG* plDeviceHandle,
                                                             const COM_CHAR* psSturnIp, COM_S32 iSturnPort,
                                                             const COM_CHAR* psTurnIp, COM_S32 iTurnPort,
                                                             const COM_CHAR* psRelayIp, COM_S32 iRelayPort,
                                                             const COM_CHAR* psUsername, const COM_CHAR* psPassword,
                                                             const COM_CHAR* psDeviceIp, COM_S32 iDevicePort,
                                                             COM_S32 iMode, COM_U32 u32_connectype, COM_U32 u32ChannelID);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_OpenCameraByDDNS(COM_LONG* plDeviceHandle,
                                                                   const COM_CHAR* pzDDNSServer,
                                                                   const COM_CHAR* pzDDNSName,
                                                                   COM_S32 iDisplayMode, COM_U32 u32_channelid = 1);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_OpenCameraByDDNSV2(COM_LONG* plDeviceHandle,
                                                                     const COM_CHAR* pzDDNSServer,
                                                                     const COM_CHAR* pzDDNSName,
                                                                     const COM_CHAR* pzUserName,
                                                                     const COM_CHAR* pzPassword,
                                                                     COM_S32 iDisplayMode,
                                                                     COM_U32 u32_channelid = 1);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_OpenCameraByDistribute(COM_LONG* plDeviceHandle,
                                                                         const COM_CHAR* pzDDNSServer,
                                                                         const COM_CHAR* pzDDNSName,
                                                                         const COM_CHAR* pzUserName,
                                                                         const COM_CHAR* pzPassword,
                                                                         int iCameraID,
                                                                         int iMode = 1);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_CloseCamera(COM_LONG lDeviceHandle);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_StartListen(COM_LONG lDeviceHandle);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_StopListen(COM_LONG lDeviceHandle);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_StartVoice(COM_LONG lDeviceHandle);

    AVDSDK_API COM_S32 AVDSDK_APICALL COM_AVD_DEV_StopVoice(COM_LONG lDeviceHandle);
这也是
Private Declare Sub COM_AVD_DEV_Init Lib "RayNetSdk.dll" Alias "_COM_AVD_DEV_Init@0" ()这是我的声明,看看我的申明哪有问题啊
搜索更多相关主题的帖子: 开发 动态 default 
2015-04-13 08:52
renxiaoyao36
Rank: 9Rank: 9Rank: 9
来 自:七宝中学
等 级:贵宾
威 望:31
帖 子:347
专家分:1077
注 册:2014-9-18
收藏
得分:20 
首先,DLL注册过么?
其次,VB中引用过么?
检查一下。

编程蛋疼的不是枯燥,而是辛辛苦苦编完几百行的代码,运行,“Runtime Error “xxx””。
2015-04-18 12:06
快速回复:vb怎么调用c++生成的动态链接库,就是vb开发sdk
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033673 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved