|
Well after a few hours of looking around I have come up with a grand total of nothing.
So I have started to write my own, so far so good, but I have encountered a stumbling block - I cant find any code to open a file given its path.
For example, I am trying to open the following file :
C:\skunkworks\directoryviewer\test.txt
Does anybody have any info on achieving this?
I have been looking through this article :
http://www.codeproject.com/csharp/csdoesshell2.asp[^]
But it all seems to much to simply open a file in whatever the associated application.
|
|
|
|
|
I have found a solution to the file opening problem I mentioned above, just incase somebody is searching these forums for a similar answer this is the code I used :
<br />
FileInfo launchfi = new FileInfo(strDocumentPath);<br />
Process proDocument = new Process();<br />
proDocument.StartInfo.FileName = launchfi.FullName;<br />
proDocument.StartInfo.WorkingDirectory = launchfi.Directory.FullName;<br />
proDocument.StartInfo.UseShellExecute = true;<br />
try<br />
{<br />
proDocument.Start();<br />
}<br />
catch<br />
{<br />
MessageBox.Show("Unable to open selected document. If this problem persists please contact your Administrator.", "Document Open Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);<br />
}
|
|
|
|
|
Hi there
Basically whats the avantage of .NET over Visual studio 6.0.Many Ppl say that Common language Specification is the Advantage.
Do they mean that a code writtern in VB .NET can be used in C#?
If so we can very well write a dll in VB, that can be used in VC++.
Plz make me clear on this stuff .
Thanks in adv.
Srini
|
|
|
|
|
the difference is mainly
1) common class library across languages.
2) class/object reuse across languages.
you can't do this is vb/vc++ - you can provide a dll interface, but thats at a function level, not an object level.
of course you can get the same results with vb/vc++ and some clever programming, but the whole point is the M$ have done it for you.
its all about productivity.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hello all
If anyone knows a good .NET spell checker component, please let me know.
Thanks
Smitha
It is better to be hated for what you are than to be loved for what you are not.
-- Andre Gide
|
|
|
|
|
Hi I have just finished writing one. The core is in native unmanaged C, but I made a .NET class for it as well. The DLL is meant to be used in Mirc, but can be accessed from .NET as well. Reply so I can email it to you.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Hi
i wrote a program using sockets. Program works well under w2k server, but under wXP, it does not. This is a server-client program. Under XP, client could established a connection, but after establishing, the connection lost. I tried many times, and many different ports, but the result was same. (I disabled wXP's firewall). Can anyone help me?
|
|
|
|
|
Yoe'll have to send a snippet of your code.
|
|
|
|
|
Thank you, i solved the problem. I found an error in my code.
|
|
|
|
|
Hi!!!
i have created a custom text Box inherited from TextBox Class. When I drag 'n' drop it from toolbox to Form. It shoes wait cursor and nothing happens . But creating at runtime works fine....any hints???
sorry for my bad English.
|
|
|
|
|
You may have included some code that causes an infinite loop or the like at design time. Check your code for anything that relies on something that only exists at runtime. You can then do some logic arounbd this checking for whether it is designtime or runtime.
if(!this.DesignMode)
{
this.DoSomething();
}
Let me know if you need more info.
|
|
|
|
|
how can i add a user in active directory?
i want to add a user in active directory and set his password.
how can i.
|
|
|
|
|
use
DirectoryEntries.Add method
Sonork ID 100:25668
|
|
|
|
|
Hi,
I am doing some owner drawn menus that are supposed to display when right clicking on a NotifyIcon in the Tray. This has lead me to discover these 2 issues...
1. You can't use the OwnerDraw property on menuitems that are added to the "ContextMenu" property of a NotifyIcon. When you do, the user defined "MeasureItem" and "DrawItem" events never fire so you end up with a blank menu. - I fixed this by switching to use the NotifyIconEx that I downloaded from this site, and all my menus work fine then.
2. When you call e.DrawBackground() in the DrawItem event of the menu it draws the correct highlight color, but it draws the background as "KnownColor.Window" instead of "KnownColor.Menu" when the item isn't selected.
Does anybody know anything about these 2 things? Anybody know any way to get this work correctly? Or are they already working correctly and I just didn't RTFM?
Cheers,
Chris.
|
|
|
|
|
Hi,
In what dll is stored the GET_X_LPARAM(GET_Y_LPARAM) macro from the win32 SDK?
It is declared in WindowsX.h, but in what dll it is located?
As for my custom caption form I need to get the non-client mouse coordinates and to override the wndproc and catch the WM_NCHITTEST message.
Thanks in advance!
Gogou
GAtanasov
|
|
|
|
|
Macros aren't "stored" in DLL's. Macros are simply code substitution constructs which allows you to substitute a block of code with a friendly name. In other words, when you compile a source file and a macro is encountered, it removes the macro name from the source location and places the macros code at that place and continues compilation. The macro itself, just like a comment, isn't located in the resultant binary file. You'll have to write your own version of it.
|
|
|
|
|
C++ macros are not located in DLLs, they are parsed at compile time.
Alexandre Kojevnikov
MCP (SQL2K, Win/C#)
Leuven, Belgium
|
|
|
|
|
Hi. I'm a C# newbie and I'm having a bit difficult time to understand using "this". For example:
public class DBBool
{
public DBBool(int value)
{
this.value = value;
}
.....
}
By using "this.value = .." to what do we assing the value and how will we use that value afterwards?
|
|
|
|
|
The this pointer is a reference to "yourself". Use it to access members (properties and methods) you inherited from other classes, and for a way to pass a ref of yourself to another object.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Nice sig...
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
jdunlap wrote:
"Do unto others as you would have them do unto you." - Jesus
Not to sound picky, but I thought that was quoted by confucious??
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Both of them said it. It is the basic tenet of morality - loving and caring for others. But you are right - that exact wording was probably Confucius's.
It will be different depending on which translation of the Bible you use, but here is the NASB-U version, which puts it in plain, every-day English:
Luke 6:31 "Treat others the same way you would want them to treat you."
Something to think about from day to day, isn't it?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
this refers to that particular instance of the class.
In the snippet above you have to use this.value in order to assign the value passed in as value to the variable called value in the class.
If you didn't specify this the compiler wouldn't know that you mean the variable named value in the class instead of the local variable called value .
Make a little more sense?
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
So this code translates as: "Assign the value from parameter to the 'value' variable of the DBBool class". Am I right?
|
|
|
|
|
Short and Sweet: "this" refers to the class in which you are typing the word "this" in. It just specifies that you are working with THIS class and not any other class the you refernse to, just the one were you are currently coding in....
public class OtherClass
{
string MyVar = "OtherVar";
public OtherClass()
{
}
}
public class MyClass
{
string MyVar = "YourVar";
public MyClass()
{
string OUTCOME = this.MyVar //is anything in MyClass, nowhere else
}
}
the OUTCOME would be "YourVar";
Leon v Wyk
|
|
|
|