Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
GeneralRe: accessing properties of the mdiParent from the child Pin
Anonymous8-Feb-05 3:18
Anonymous8-Feb-05 3:18 
GeneralRe: accessing properties of the mdiParent from the child Pin
kowplunk8-Feb-05 3:22
kowplunk8-Feb-05 3:22 
GeneralRe: accessing properties of the mdiParent from the child Pin
Skynyrd8-Feb-05 11:56
Skynyrd8-Feb-05 11:56 
GeneralDataGrid Cell being edited Pin
Keith La Force6-Feb-05 9:55
Keith La Force6-Feb-05 9:55 
GeneralRe: DataGrid Cell being edited Pin
Christian Graus6-Feb-05 14:40
protectorChristian Graus6-Feb-05 14:40 
GeneralRe: DataGrid Cell being edited Pin
Luis Alonso Ramos6-Feb-05 17:55
Luis Alonso Ramos6-Feb-05 17:55 
GeneralRe: DataGrid Cell being edited Pin
Keith La Force7-Feb-05 1:16
Keith La Force7-Feb-05 1:16 
GeneralGetOpenFileName in C# Pin
Formato6-Feb-05 9:01
Formato6-Feb-05 9:01 
Smile | :) Hi everybody!
Maybe there is somebody who can give me a bit of help; I am about to give up:
I need to ‘translate’ in C# the function GetOpenFileName to include a FileOpenDlg in a Dlg template containing other components, but I cannot handle in C# the reference to the Dialog template resource and the call back function.
Below is the code:

[ StructLayout( LayoutKind.Sequential, CharSet=CharSet.Auto )]
public class OpenFileName
{
public int structSize=0;
public IntPtr dlgOwner= IntPtr.Zero;
public IntPtr hInstance=IntPtr.Zero;
public String filter = null;
public String Customfilter= null;
public int maxCustFilter=0;
public int filterIndex=0;
public String file= null;
public int maxFile = 0;
public String fileTitle= null;
public int maxFileTitle= 0;
public String initialDir= null;
public String title = null;
public int flags=0;
public Int16 fileOffset=0;
public Int16 fileExtension=0;
public String defExt= null;
public IntPtr custData=IntPtr.Zero;
public IntPtr fnHook= IntPtr.Zero;
public OFNHookProc fnHook= IntPtr.Zero;
public String TemplateName;//=null;
}

[ DllImport( "Comdlg32.dll", CharSet=CharSet.Auto )]
public static extern bool GetOpenFileName([ In, Out ] OpenFileName ofn );
……..
…….
private void cmdOpenClick(object sender, System.EventArgs e)
{
OpenFileName ofn=new OpenFileName();

ofn.structSize=Marshal.SizeOf(ofn);
ofn.dlgOwner= this.Handle;
ofn.hInstance=IntPtr.Zero;
ofn.filter="Eseguibili (*.exe)\0*.exe\0Text Files (*.txt;*.doc;*.wri)\0*.txt;*.doc;*.wri\0Tutti (*.*)\0*.*\0\0";;
ofn.Customfilter = null;
ofn.maxCustFilter=0;
ofn.filterIndex=0;
ofn.file=new String(new char[_MaxPath]);
ofn.maxFile=ofn.file.Length;
ofn.fileTitle=new String(new char[_MaxFile]);
ofn.maxFileTitle=ofn.fileTitle.Length;
ofn.initialDir="C:\\";
ofn.title="Apri un file";
ofn.flags= OFN_EXPLORER|OFN_ENABLETEMPLATE|OFN_ENABLEHOOK;
ofn.fileOffset=0;
ofn.fileExtension=0;
ofn.defExt= null;
ofn.custData=IntPtr.Zero;
ofn.fnHook=??????????????????????????;
ofn.TemplateName=????????????????????;

bool risp=GetOpenFileName(ofn);
}

Any pretty good ideas? Many tanks in advance!!
mino



mino
GeneralRe: GetOpenFileName in C# Pin
Heath Stewart7-Feb-05 6:15
protectorHeath Stewart7-Feb-05 6:15 
GeneralEvents and delegates: help! Pin
Gleb Belov6-Feb-05 4:55
Gleb Belov6-Feb-05 4:55 
GeneralRe: Events and delegates: help! Pin
mav.northwind6-Feb-05 5:12
mav.northwind6-Feb-05 5:12 
GeneralRe: Events and delegates: help! Pin
Gleb Belov6-Feb-05 5:37
Gleb Belov6-Feb-05 5:37 
GeneralRe: Events and delegates: help! Pin
Skynyrd6-Feb-05 6:17
Skynyrd6-Feb-05 6:17 
GeneralEventHandler question! Pin
QzRz6-Feb-05 1:50
QzRz6-Feb-05 1:50 
GeneralRe: EventHandler question! Pin
mav.northwind6-Feb-05 3:11
mav.northwind6-Feb-05 3:11 
GeneralRe: EventHandler question! Pin
Heath Stewart6-Feb-05 7:24
protectorHeath Stewart6-Feb-05 7:24 
Generalcreate a Byte[] array Pin
Sasuko6-Feb-05 0:19
Sasuko6-Feb-05 0:19 
GeneralRe: create a Byte[] array Pin
Robert Rohde6-Feb-05 0:56
Robert Rohde6-Feb-05 0:56 
GeneralRe: create a Byte[] array Pin
Sasuko6-Feb-05 1:27
Sasuko6-Feb-05 1:27 
Generalremote user name Pin
Opa Knack6-Feb-05 0:12
Opa Knack6-Feb-05 0:12 
GeneralRe: remote user name Pin
Heath Stewart6-Feb-05 7:21
protectorHeath Stewart6-Feb-05 7:21 
QuestionCreating MMC snap-in? Pin
esjq5-Feb-05 23:33
esjq5-Feb-05 23:33 
AnswerRe: Creating MMC snap-in? Pin
Heath Stewart6-Feb-05 7:18
protectorHeath Stewart6-Feb-05 7:18 
GeneralRe: Creating MMC snap-in? Pin
esjq6-Feb-05 20:53
esjq6-Feb-05 20:53 
Generalupdate doesn't update database Pin
xrado5-Feb-05 23:14
xrado5-Feb-05 23:14 

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.