|
good day people
so i want to get the location for every file type (both dll and index) and i tried using SHGetFileInfo api (ICONLOCATION flag) but for some reason it only works for either the desktop or a folder, regular fyletipes like .txt, .pdf, .xml dont work
is there another way i can get the dll and index for every file type?? i tried searching in the registry and it works for me but two specific file types still give me problems (cant find their icon's dll and index) when i run my program in another computer (my OS is windows vista x32, i have problems running it in vista (x86)
i'll repeat my main question: How can i get the dll and index for every file type??
thanks in advance for your help
|
|
|
|
|
|
actually i tried that already, that example gets the handle for the icon with SHGetFileInfo api, i need the dll path and the index, you know like for .exe files the dll is shell32.dll and the index is 2?
i tried using that same api with the flag ICONLOCATION and it did get the dll and index, but only for the desktop and folders, regular file types like .pdf or . txt wouldnt work
thanks anyway for your help
|
|
|
|
|
Unable to cast object of type 'System.DateTime' to type 'System.String'.
private void StudentsDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
// Although we could have the SQL statement return a formatted date,
// this is really a User Interface issue and should be handled here.
//
// Display only Date part of datetime
if ((this.StudentsDataGridView.Columns[e.ColumnIndex].Name == this.TeachersDataSet.Students.BirthDateColumn.ColumnName))
{
if (!(e.Value == DBNull.Value))
{
e.Value = DateTime.Parse((string)e.Value).ToLongDateString(); e.FormattingApplied = true;
}
}
}
Learning to Code
|
|
|
|
|
Mo John wrote: Unable to cast object of type 'System.DateTime' to type 'System.String'
The exception says it all. You don't say what's the problem you're having, but if it is what I suspect, use the debugger and have a look at e.Value.
|
|
|
|
|
Oh yeah! The problem: When Iinter the birthdate in the field click save it update the database. When I query the database all the data is present. When I try to access the same field on a click button to get data on the persons it will not convert the field. I get the error message.
Trying format the field so only the date will show and not the time.
Learning to Code
modified on Monday, December 15, 2008 12:54 PM
|
|
|
|
|
So have a look at the e.Value with the debugger. Especially, check the datatype.
|
|
|
|
|
System.Threading.Thread.Sleep(1000);
the System.Threading.Thread.Sleep(1000); blocks the current thread for the timeperiod in param and dont let execute the next code to it, like MessageBox. But i want current thread keep running however the code blocked.
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-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Xmen wrote: But i want current thread keep running however the code blocked.
Huh? How would that work?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
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-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
There is no distinction between "Form moving code" and "other code" for the CPU, it's all the same.
If you have some code that needs to be paused, then you need to put it into a second thread and stop this one instead.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg wrote: There is no distinction between "Form moving code" and "other code" for the CPU, it's all the same.
dude, it was just an example
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-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Xmen wrote: dude, it was just an example
I know, and I also told you what you need to do instead.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
code is either running or your thread is sleeping; there is no sleepwalking in .NET
Did you have a question of some kind?
|
|
|
|
|
yes, thats why i asked for assurance
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-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Greeeg wrote: System.Threading.Thread.Sleepwalk(int milliseconds)[^]
what is this ? a link ? or a not available reference ?
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-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Break the code block that exists before the Sleep call to another method, and execute this on another thread, like others have pointed out, is the only way to accomplish what you are asking for.
|
|
|
|
|
is there any method to check the precedence of operators
|
|
|
|
|
|
Just scope your algorithms, and you'll be fine. It's better that way anyway.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i mean there are two operators such as + and *. is there any logic to check which has higher precedence.
my code is...
char a='+',b='*'
bool result = Higher_Precedence(a,b);
public bool Higher_Precedence(char a , char b)
{
?????..
}
i dont know how to identify the higher precedence
|
|
|
|
|
Precedence would probably be language-specific, but generally they all follow the same order. Someone else already provided a link for C#. And no, there's no logical way to determine precedence (in the form of a function, or otherwise).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
if you have two operators, say + and *, you can figure out their precedence by comparing the
results of the following expressions:
A= 2 + 3 * 4
B= 2 + (3 * 4)
C= (2 + 3) * 4
if A==B and B!=C then * has higher precedence than +
if A==C and B!=C then + has higher precedence than *
you can generate C# code dynamically, as an example see this article[^].
Hence you can build a method that determines precedence for any pair of operators in C#.
You can apply similar techniques to other languages as long as dynamic code generation is supported.
Warning: you need to pick good constant values to make sure B!=C (all zeroes or all ones would be a very bad choice).
|
|
|
|
|
Seems like a lot of work when the answer is already very well documented.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|