vb.net - Error Using An Object Array With .NET COM Interop DLL -


I have found many other references to this error while using Google but I am having trouble understanding this That is how they apply for what I am doing.

Here is a VBA error, I am compiling time: "Function or interface is marked as restricted, or the function uses an Autoconction type that is not supported in Visual Basic . "

The error is the VBA code:

  'ftp also does not post the code here dim (f) a com object created as wooxter.ftpfile f = ftp GETFileList 'is a purpose array of type FTPFile dim I for integer = 1 for return (UBound (f) - 1) fFileExists (stg.LocalPicDir & amp; "\" & amp; (i) .FileName) If this is true then then fGetFileSize (stg.LocalPicDir & amp; "\" & amp; f (i) .FileName) = f (i) .FileSize then error 'error occurs on the above line at compile time Is specially on 'f' (i) .FileSize, But not F (I) .FileName 'fGetFileSize Returns to a VBA Long  
  Public Interface IFTPFile ReadOnly property: f (i) .FileSize is a VB.NET long end from the other end   

it read as long as my relevant net code Failsijh () only asset filename () as string End interface & lt; ClassInterface (ClassInterfaceType.None) & gt; _ Public Class FTPFile: IFTPFile private sFileName String = "" applies as private lFileSize Long Public Sub New (ByVal fName as a string, the ByVal FSize) sFileName = fName lFileSize = FSize End Sub a different class public in the event of termination as a class piece GetFileList () as FTPFile () IFTP.GetFileList dim ftpfiles () EnterpriseDT.Net.Ftp.FTPFile ftpfiles = fCon.GetFileInfos FTPFile as dim results (ftpfiles.Length - 1) For i as integer = 0 ftpfiles.Length - 1 result (i) = new FTPFile (ftpfiles (i) .Name, ftpfiles (I) .Size) Next Return result End Function

There is no notion of Kansltrs of COM Or to talk more, constructor with logic If you declare any consultants for your class then it should include a non-parameterized constructor. You will always need to create the filename and filesystem properties that client code will always use.

The next problem is that VBA does not have 64-bit integral data types. FileSize property rather than the long, avoid integer or double single, the file sizes are not important enough points for correctly stored. It can not store 16777217.

Comments