|
Haven't tried it but this[^] may help
Dave
|
|
|
|
|
No, It doesn't help. because it assumes just file system paths not pidl!. you can not convert every pidl to string.
|
|
|
|
|
|
thanks,
I see the code but I can't find out why my code doesn't work properly. my code is like the code in the page that you mention. (the caller is not presented in the page just callee is presented)
modified on Friday, March 7, 2008 5:01 AM
|
|
|
|
|
Hello Amirreza_nl,
I wrote the code that was alluded to earlier in this thread (from CodeGator.com). You are correct that your code is similar to mine, however I am calling a slightly different method to get the path from the PIDL. In my case I am using the SHGetPathFromIDList function. Also, my code doesn't convert from the InPtr to a ITEMIDLIST structure. I am able to deal with PIDL's as IntPtr objects instead of converting them to ITEMIDLIST structures. (See my code here)
You don't say which call is failing in your code, is it SHGetSpecialFolderLocation or SHGetFileInfo?
My suggestion would be to try omiting the conversion of the PIDL to a struct if possible.
I hope I have helped,
Martin
Martin Cook
Jesus answered, "I am the way and the truth and the life. No one comes to the Father except through me." John 14:6
|
|
|
|
|
Hi,
first of all, thanks for ur reply. I think SHGetFileInfo doesn't work well. because the first call's return value is ok. but SHGetFileInfo's return value sometimes is not ok. I run the code 2 or 3 times then it works well and show control panel's (or something else) attributes correctly! I don't know why!
SHGetPathFromIDList doesn't work at all with something like control panel (I think). we can use it when pidl is controled by file system(file or folder that is stored physically in a hard disk). so I can not use it for my app.
typedef struct _SHITEMID {<br />
USHORT cb;<br />
BYTE abID[1];<br />
} SHITEMID;
I wrote this in C#:
[StructLayout(LayoutKind.Sequential, Pack = 1)]<br />
public struct SHITEMID<br />
{<br />
public UInt16 cb;<br />
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]public SByte[] abID;<br />
}
then
typedef struct _ITEMIDLIST {<br />
SHITEMID mkid;<br />
} ITEMIDLIST;
in C#:
[StructLayout(LayoutKind.Sequential, Pack = 1)]<br />
public struct ITEMIDLIST<br />
{<br />
public SHITEMID mkid;<br />
}
|
|
|
|
|
oh, I think I find the bug in my code!
I write:
[StructLayout(LayoutKind.Sequential, Pack = 1)]
but I must write:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
instead.
I use unicode charset for my all methode definitions.
But I wonder why this makes a problem! we have two types of pidl!? on for ansi one for unicode!? why? in pidl address we have string!??
|
|
|
|
|
I am Bang Hoang Viet. I am Vietnamese. My English isn't good. I use datagridview to display data of SQL 2000 database. My data source have a lot of rows. I need view record_id 1500 on screen but i don't know how to. Nomarly I scroll datagridview go to record_id 1500 to confirm by my eyes on screen. Someone help me catch pages's record_id 1500 and display auto on screen.
Soon!
Thank very much for help me!
|
|
|
|
|
|
Thank very much!
That I known. My problem have been I had listed datagridview's record then I modify record's ID 1500. Then I upgraded database and reconnect data source to view datagridview. I want catch record's ID 1500 and view on screen and see I have modified that record. So can you help me resolve this problem.
Waitting for you and thank you very very much!
|
|
|
|
|
Can someone please help me to open a file in the application using openFileDialog. I have a button "Open File" > which then opens an openFileDialog window, I then select the file and click Open, but it does not want to open. I do get the path and everything, but it does not want to open. Maybe I am using the wrong code. Here is a snippet of my code:
//Opens the file and populates the datagrid
private void btnOpenFile_Click(object sender, EventArgs e)
{
ofdExcelDoc.Filter = "xls files (*.xls)|*.xls|All files (*.*)|*.*";
if (ofdExcelDoc.ShowDialog() == DialogResult.OK)
{
ofdExcelDoc.OpenFile();
try
{
// Attempt to open the file and output its contents to a text box
Stream stream;
if ((stream = ofdExcelDoc.OpenFile()) != null)
{
StreamReader reader = new StreamReader(stream);
//dgFileInfo.DataSource = reader.ReadToEnd();
txtOutput.Text = reader.ReadToEnd();
stream.Close();
}
}
catch (Exception ex)
{
MessageBox.Show("There was an Error: " + ex.Message);
}
}
}
}
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
remove the first occurance of ofdEcvelDoc.OpenFile();
|
|
|
|
|
I removed that line but it is still not opening (the file/doc does not get opened)
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
replace
ofdExcelDoc.OpenFile();
with
System.Diagnostics.Process.Start(ofdExcelDoc.FileName);
i hope it will work
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
it worked, thanx
Mvelo Walaza
Developer
Telkom SA
|
|
|
|
|
glad to know
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
this is first time im posting here... i need some help about explosion or particle system. if anybody have website, ebook or sample project about explosion, can u share with me...i need more information and sample coding about explosion or particle.
because i need that to finish my final project..my final project about explosion modeling using xna.
|
|
|
|
|
|
|
hi,
i'm having a strange problem withe datagridview
i'm designing with right to left
i've have this kind of a table
column1 - column5 are textbox cell
column 6 and 7 are button cell
now the problem is that when i'm in .cs[Design] the buttons "Jumps" to be in 1st and 2nd column
like the index is autometiclly changed to be the 1st and the 2nd column
i've changed the view back to left to right but still tha problem stays
help!!!, what am i doing wrong?
Have Fun
Never forget it
|
|
|
|
|
just change thier order in Columns property
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i know that
but it's like an anoying dog that always return after you send him away
Have Fun
Never forget it
|
|
|
|
|
is your DGV in TabControl ? sometimes its irritate me when i edit DGV in tabControl
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
BINGO
yep it's in a tab control
but what is thc connection between them that causes the effect??
Have Fun
Never forget it
|
|
|
|
|
i still haven't understood xD, but i got it work,
it often occurs when TabAllignment changed,
try some steps,
1. Extact DGV from TC
2. Add new TC or TabPage
3. insert DGV in it
i hope it will work...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|