Re: Trying to create a dll accessible from SQL Server (sp_OACreate), here is my code..
- From: Johannes Passing <johannes.passing@xxxxxxx>
- Date: Mon, 07 Nov 2005 15:45:20 +0100
Hi,
you have to declare your types as [ComVisible(true)].
However, you should have a look at http://support.microsoft.com/kb/q238425/ first - wininet does not support being used from within a service.
Do you really want your SQL server to use FTP?
/Johannes
Todd S wrote:
I am trying to create a class library accessible to in SQL server as a COM. I am using the Wininet.dll and can get it to build successfully. I then run tlbexp and create the type library and when I attempt to register the dll with regasm.exe I get the following error:
RegAsm : warning RA0000 : No types were registered
This is my code:
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Reflection; using System.IO;
namespace BDS_FTP { public class FTP { public FTP() { //COM requires an empty constructor }
//DECLARATIONS
[DllImport("wininet.dll")] public static extern long InternetOpen( string strAppName, long ulAccessType, string strProxy, string strProxyBypass, long ulFlags);
[DllImport("wininet.dll")] public static extern long InternetConnect(long ulSession, string strServer, int ulPort, string strUser, string strPassword,
long ulService, long ulFlags, long ulContext);
[DllImport("wininet.dll")] public static extern bool InternetGetConnectedState(ref uint ulFlags, uint ulReserved);
[DllImport("wininet.dll")] public static extern bool FtpSetCurrentDirectory(IntPtr ulSession, string strPath);
[DllImport("wininet.dll")] public static extern bool FtpGetFile(IntPtr ulSession, string strRemoteFile, string strLocalFile, bool bolFailIfExist, ulong ulFlags, ulong ulInetFals, ulong ulContext);
}
}
Any advice or help would be greatly appreiciated! Thanks! Todd S
.
- References:
- Prev by Date: Re: pointer to a c++struct kept by c# code
- Next by Date: TypeLoadException on trying to create typelib
- Previous by thread: Trying to create a dll accessible from SQL Server (sp_OACreate), here is my code..
- Next by thread: IDownloadManager in C#?
- Index(es):
Relevant Pages
|