×

Loading...
Ad by
  • 技多不压身,工到自然成:安省技工证书特训班,点击咨询报名!
Ad by
  • 技多不压身,工到自然成:安省技工证书特训班,点击咨询报名!

Sorry, post wrong text, again.

VB:
---------------------------
Public Declare Function MAPISendMail Lib "MAPI32.DLL" ( _
ByVal Session As Long, _
ByVal UIParam As Long, _
ByRef Message As MAPIMessage, _
ByRef Recipient() As MapiRecip, _
ByRef File() As MapiFile, _
ByVal Flags As MAPISendMailFlags, _
ByVal Reserved As Long _
) As MapiErrors

VC:
------------------------------
typedef ULONG (FAR PASCAL MAPISENDMAIL)(
LHANDLE lhSession,
ULONG ulUIParam,
lpMapiMessage lpMessage,
FLAGS flFlags,
ULONG ulReserved
);
typedef MAPISENDMAIL FAR *LPMAPISENDMAIL;
MAPISENDMAIL MAPISendMail;
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 问个问题,不知那位DX有空,‘为什么关于MAPI 函数的声明在VB中和VC中不一样??’
    • up
    • 这个问题有意思,VB和VC的要求不同么,所以函数申明的形式也不同。
      • 总算有人回答了,我是指函数声明时连型参个数都不一样,奇怪,明明是同一个文件呀,MAPI32.DLL.
      • 如果按VC方式在VB中声明,调用时就出错.!!!怎莫也想不通.
        • 编译器不一样啊。
          • can you give me a call at 416-496-8031? this is very strange.
            • sorry,俺never露面。
              • did you see the posted declaration listed as below, can you give me more hints?
      • Want to see the different declarations? come in.....
        VC:
        -------------
        typedef ULONG (FAR PASCAL MAPISENDDOCUMENTS)(
        ULONG ulUIParam,
        LPSTR lpszDelimChar,
        LPSTR lpszFilePaths,
        LPSTR lpszFileNames,
        ULONG ulReserved
        );
        typedef MAPISENDDOCUMENTS FAR *LPMAPISENDDOCUMENTS;
        MAPISENDDOCUMENTS MAPISendDocuments;

        VB:
        ---------------------------
        Public Declare Function BMAPISendMail Lib "MAPI32.DLL" ( _
        ByVal Session As Long, _
        ByVal UIParam As Long, _
        ByRef Message As MAPIMessage, _
        ByRef Recipient() As MapiRecip, _
        ByRef File() As MapiFile, _
        ByVal Flags As MAPISendMailFlags, _
        ByVal Reserved As Long _
        ) As MapiErrors
        • Sorry, post wrong text, again.
          VB:
          ---------------------------
          Public Declare Function MAPISendMail Lib "MAPI32.DLL" ( _
          ByVal Session As Long, _
          ByVal UIParam As Long, _
          ByRef Message As MAPIMessage, _
          ByRef Recipient() As MapiRecip, _
          ByRef File() As MapiFile, _
          ByVal Flags As MAPISendMailFlags, _
          ByVal Reserved As Long _
          ) As MapiErrors

          VC:
          ------------------------------
          typedef ULONG (FAR PASCAL MAPISENDMAIL)(
          LHANDLE lhSession,
          ULONG ulUIParam,
          lpMapiMessage lpMessage,
          FLAGS flFlags,
          ULONG ulReserved
          );
          typedef MAPISENDMAIL FAR *LPMAPISENDMAIL;
          MAPISENDMAIL MAPISendMail;
        • They are different function
          The VC one link to MapiSendMail, and the VB one link to BMapiSendMail. The VB one is introduced just because MapiSendMail has some problem dealing with the way VB transfer string parameter. ( I guess). I am not a VB guy though. Do a search on google and include both function name.
    • my wild guess
      if u want to bring value back, by ref, and initial the varible.

      long long time ago....
      • all that about ByVal, ByRef, .Long, Lp.. I understand, and make proper changes, but the para NUMBER is different?! you see that.
        • sorry, u can post it to some VB group, or even search google for some sample code
          • can't wait until they answer, I hope i can meet somebody here. Rolia is a good place to find experts.
        • here is I found from MS support
          • Oh, thanks, but the heading declarations is exactly what I am using now, that is different from VC->MAPI.H. #-:
            • see inside
              1. any difference if suffix &

              2. why don't you try to copy and paste the whole declare into ur program
              • '&' means AS LONG in VB, I did copy the whole declaration, and made all the changes necessary...........
                The property i mentioned is something like 'sender_address' in the TYPE of a MAPIMessage, which is accecssable in VC, but in VB, the delaration is not including that property, so I can't access that. I can access a message, but there is no that property!

                The problem of TYPE defination's difference, is what make me cry.

                To make my question simple, I use a function for example, that is what i posted, the SendMail function.
                • sorry, not good at VB, looks like u can create ur own wrap DLL using VC to include all u want for VB
          • actually, i want change a property in the TYPE of MAPIMessage, but that property defined in VC head file, not exist in VB declaration!!