Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
GeneralWebservice methods disappear Pin
wantacobra200314-Feb-05 6:27
wantacobra200314-Feb-05 6:27 
Generaljavascript doesnot work in firefox Pin
kinnera14-Feb-05 5:43
kinnera14-Feb-05 5:43 
GeneralRe: javascript doesnot work in firefox Pin
Dave Kreskowiak14-Feb-05 5:47
mveDave Kreskowiak14-Feb-05 5:47 
Generaloverride delete key in datagrid Pin
xrado14-Feb-05 5:29
xrado14-Feb-05 5:29 
GeneralExporting DataGrid to Excel Pin
LuKas23_14-Feb-05 5:12
LuKas23_14-Feb-05 5:12 
GeneralA TCPListner problem that i am not sure about Pin
sameerhanda14-Feb-05 4:12
sameerhanda14-Feb-05 4:12 
GeneralRe: A TCPListner problem that i am not sure about Pin
Marc Clifton14-Feb-05 8:16
mvaMarc Clifton14-Feb-05 8:16 
Generalactivesync icefilefilter Pin
Luigi Grilli14-Feb-05 3:18
Luigi Grilli14-Feb-05 3:18 
hi everybody,
i'm trying to write a file filter for activesync to convert files with a specific extension. i found the api ICeFileFilter into msdn. But there is no c# code all over the the internet and very few lines of c++ examples(i found 1 example).
my problem is that i can't figure out how make it work.
i created the registry entry for my filter dll and activesync now fire an error when trying to copy this files to the device(at least it's something!!!).
my dll is surely not implementing correctly the ICeFileFilter.
aslo i'm unable to find this guid: 6C5C05E1-97A2-11cf-8011-00A0C90A8F78
wich seems to be the ICeFileFilter guid but it's not in my windows register.

here is the code:
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Windows.Forms;<br />
<br />
namespace myFilter<br />
{<br />
	/// {6C5C05E1-97A2-11cf-8011-00A0C90A8F78}<br />
	[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), <br />
		Guid("6C5C05E1-97A2-11cf-8011-00A0C90A8F78")]<br />
	public interface ICeFileFilter<br />
	{<br />
		[PreserveSig()]<br />
		Int32 NextConvertFile (<br />
			int nConversion,<br />
			CFF_CONVERTINFO pci,<br />
			CFF_SOURCEFILE psf,<br />
			CFF_DESTINATIONFILE pdf,<br />
			bool pbCancel,<br />
			IntPtr perr);<br />
		Int32 FilterOptions (IntPtr hwndParent);<br />
		Int32 FormatMessage (<br />
			UInt32 dwFlags,<br />
			UInt32 dwMessageId,<br />
			UInt32 dwLanguageId,<br />
			[ MarshalAs (UnmanagedType.LPStr)]<br />
			string lpBuffer,<br />
			UInt32 nSize,<br />
			IntPtr Arguments,<br />
			UInt32 pcb);<br />
	}<br />
<br />
	//{6C5C05E0-97A2-11cf-8011-00A0C90A8F78}<br />
	[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), <br />
		Guid("6C5C05E0-97A2-11cf-8011-00A0C90A8F78")]<br />
	public interface ICeFileFilterSite<br />
	{<br />
		[PreserveSig()]<br />
		Int32 OpenSourceFile (<br />
			int nHowToOpenFile,<br />
			[In, Out] byte[] ppObj);<br />
		Int32 OpenDestinationFile (<br />
			int nHowToOpenFile,<br />
			string pszFullpath,<br />
			[In, Out] byte[] ppObj);<br />
		Int32 CloseSourceFile (object pObj);<br />
		Int32 CloseDestinationFile (<br />
			bool bKeepFile,<br />
			object pObj<br />
			);<br />
		Int32 ReportProgress (<br />
			UInt32 nPercent<br />
			);<br />
		Int32 ReportLoss (<br />
			UInt32 dw,<br />
			string psz,<br />
			[In, Out] byte[] args<br />
			);<br />
	}<br />
<br />
	//{6C5C05E2-97A2-11cf-8011-00A0C90A8F78}<br />
	//filteroptions<br />
<br />
	// {<<myguiid>>} (removed)<br />
	[ComVisible(true), Guid("<<myguiid>>")]<br />
	public class myFilter : ICeFileFilter<br />
	{<br />
		public myFilter()<br />
		{<br />
			//<br />
			// TODO: Add constructor logic here<br />
			//<br />
		}<br />
		<br />
		public Int32 NextConvertFile (int nConversion, CFF_CONVERTINFO pci, CFF_SOURCEFILE psf, CFF_DESTINATIONFILE pdf, bool pbCancel, IntPtr perr)<br />
		{<br />
			//do something<br />
			return 0;<br />
		}<br />
		public Int32 FilterOptions (IntPtr hwndParent)<br />
		{<br />
			//do something<br />
			return 0;<br />
		}<br />
		public Int32 FormatMessage (UInt32 dwFlags,UInt32 dwMessageId,UInt32 dwLanguageId,[ MarshalAs (UnmanagedType.LPStr)]string lpBuffer,UInt32 nSize,IntPtr Arguments,UInt32 pcb)<br />
		{<br />
			//do something<br />
			return 0;<br />
		}<br />
	}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class CFF_CONVERTOPTIONS<br />
	{<br />
		public UInt64 cbSize;<br />
		public Boolean bNoModalUI;<br />
	}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class PFF_CONVERTOPTIONS : CFF_CONVERTOPTIONS{}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class CFF_CONVERTINFO <br />
	{<br />
		public Boolean bImport;<br />
		public IntPtr hwndParent;<br />
		public Boolean bYesToAll;<br />
		public ICeFileFilterSite pffs;<br />
	}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class PFF_CONVERTINFO : CFF_CONVERTINFO{}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class CFF_DESTINATIONFILE <br />
	{<br />
		public String szFullpath;<br />
		public String szPath;<br />
		public String szFilename;<br />
		public String szExtension;<br />
	}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class PFF_DESTINATIONFILE : CFF_DESTINATIONFILE{}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class CFF_SOURCEFILE <br />
	{<br />
		public string szFullpath;<br />
		public string szPath;<br />
		public string szFilename;<br />
		public string szExtension;<br />
		public int cbSize;<br />
		public FILETIME ftCreated;<br />
		public FILETIME ftModified;<br />
	}<br />
<br />
	[StructLayout(LayoutKind.Sequential)]<br />
	public class PFF_SOURCEFILE : CFF_SOURCEFILE{}<br />
}<br />


thanks everybody for all kind of help!
GeneralLine Numbers Pin
jcrussell14-Feb-05 2:48
jcrussell14-Feb-05 2:48 
GeneralRe: Line Numbers Pin
Stefan Troschuetz14-Feb-05 4:10
Stefan Troschuetz14-Feb-05 4:10 
QuestionIs possible load a directory in binary mode? Pin
Anonymous14-Feb-05 2:34
Anonymous14-Feb-05 2:34 
AnswerRe: Is possible load a directory in binary mode? Pin
Colin Angus Mackay14-Feb-05 2:51
Colin Angus Mackay14-Feb-05 2:51 
GeneralRe: Is possible load a directory in binary mode? Pin
Anonymous14-Feb-05 4:42
Anonymous14-Feb-05 4:42 
GeneralRe: Is possible load a directory in binary mode? Pin
Colin Angus Mackay14-Feb-05 4:47
Colin Angus Mackay14-Feb-05 4:47 
GeneralRe: Is possible load a directory in binary mode? Pin
Daniel Turini14-Feb-05 6:44
Daniel Turini14-Feb-05 6:44 
QuestionHow to intercept directory changes Pin
Anonymous14-Feb-05 2:32
Anonymous14-Feb-05 2:32 
AnswerRe: How to intercept directory changes Pin
Sebastian Schneider14-Feb-05 2:47
Sebastian Schneider14-Feb-05 2:47 
QuestionXML Documentation? Pin
Rob Tomson14-Feb-05 2:10
Rob Tomson14-Feb-05 2:10 
AnswerRe: XML Documentation? Pin
TRekrap14-Feb-05 11:57
TRekrap14-Feb-05 11:57 
GeneralRe: XML Documentation? Pin
Rob Tomson14-Feb-05 19:01
Rob Tomson14-Feb-05 19:01 
GeneralRe: XML Documentation? Pin
TRekrap15-Feb-05 3:15
TRekrap15-Feb-05 3:15 
GeneralRe: XML Documentation? Pin
Rob Tomson15-Feb-05 12:02
Rob Tomson15-Feb-05 12:02 
GeneralRe: XML Documentation? Pin
ThaddParker16-Feb-05 8:31
ThaddParker16-Feb-05 8:31 
GeneralCOM components in .NET Pin
Andreas X14-Feb-05 1:46
professionalAndreas X14-Feb-05 1:46 
GeneralC# Calling instances of Winforms from dlls Pin
jslater14-Feb-05 1:22
jslater14-Feb-05 1:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.