|
hello every one,
can i integrate my Menu with Windows Shell ContextMenu (the one which pops up whenever we right click mouse) using C# classes.
Problem is, I want to do it without using Interop (Com) simply because i dont have pre-requiste COM knowledge.
suggestion of ne kind are welcomed
thanx.
|
|
|
|
|
goooooooogle wrote:
Problem is, I want to do it without using Interop (Com) simply because i dont have pre-requiste COM knowledge. suggestion of ne kind are welcomed
If you don't want to learn, why are you bothering asking. There are a whole slew of articles here on both COM Interop and Shell programming within C#. I would suggest you read those and when you get stuck either check out MSDN[^], post a question to the articles author on the forum within the article or post a question here.
- Nick Parker My Blog | My Articles
|
|
|
|
|
goooooooogle wrote:
Problem is, I want to do it without using Interop (Com) simply because i dont have pre-requiste COM knowledge
Impossible. Windows is still COM based so either you do it in COM or you don't do it all.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How would I go about changing the number of spaces a tab uses when the user presses Tab on his/her keyboard? Thanks in advance.
Happy Programming and may God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
From my experience, I dont think u can, I digged alot thru the Win API but couldnt find anything...
top secret xacc-ide 0.0.1
|
|
|
|
|
See the documentation[^] for the RichTextBox.SelectionTabs property. This is the same as sending the EM_SETPARAFORMAT with a PARAFORMAT2 structure in native code with the cTabCount and rgzTabs fields assigned.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the help.
Happy Programming and may God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
Hi All,
We want to use sql server reporting services (ssrs), but want to create our own viewer and print buttons. Does anyone know of an article that shows how to do this. We really need to create a dll that can be called that will print our reports. Any info would be appreciated.
later,
Clyde
|
|
|
|
|
Here is task at hand:
I need to create a help system that allows users to hit F1 on any field, and they will get a popup explaining the use of the field. Assume that I know how to capture the keyboard event. I have a seperate class that has all functionailty of the HtmlHelp API in it. I need to call the HH_DISPLAY_TEXT_POPUP command. which takes the following structure for input: HH_POPUP as well as the location of the .chm file. I am getting confused as to how I define a structure to pass into this function. I do not have much experience with COM. The reason we are using this HtmlHelp API instead of the System.Windows.Forms.Help definition is becasue we want to read directly from our already created .chm file. If there is a way to do this with .net controls, please let me know as well. Thanks in advance!
|
|
|
|
|
Dear, Sir and Madam
Please see the code below.
bool bCtrl = false;
private void treeView1_KeyDown(object sender, KeyEventArgs e)
{
bCtrl = e.Control;
this.Text= bCtrl.ToString();
}
private void treeView1_KeyUp(object sender, KeyEventArgs e)
{
bCtrl = e.Control;
this.Text= bCtrl.ToString();
}
private void treeView1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
{
if(bCtrl)
DoDragDrop(e.Item, DragDropEffects.Copy);
else
DoDragDrop(e.Item, DragDropEffects.Move);
}
While I dragging item(node) why the KeyDown event is not fire?
How to solve this problem?
Sorry for bad English.
Thank You.
|
|
|
|
|
|
It's not supposed to. If you want to detect if the CTRL key was pressed while dragging, handle the Control.QueryContinueDrag event. See the documentation for that event as well as the QueryContinueDragEventArgs in the .NET Framework SDK for more information and examples.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a class in my middle tier in which I hold a DataTable object, which has already been filled out with data. All I want to do is filter the DataRows based on one of the Fields in the DataRow, and return a DataTable object with the filtered Rows.
This is my code:
public DataTable FilteredData( int clientType )<br />
{<br />
string filter = "CLIENT_TYPE = " + clientType;<br />
DataRow[] foundRows = _myData.Select( filter );<br />
DataTable dt = new DataTable();<br />
foreach( DataRow row in foundRows )<br />
{<br />
dt.Rows.Add( row );<br />
}<br />
return dt;<br />
}
The problem is that when it reaches the line dt.Rows.Add( row ); I get an exception saying that "This row already belongs to another table". It doesn't matter that I will be returning a seperate DataTable, as the Rows won't be updated in the interface. Can someone please tell me how I can return my data in a DataTable object, I would rather not have to return an array of DataRows.
|
|
|
|
|
Why don't you use DataView instead of DataTable?
You won't have to duplicate the data.
With your approach, you have to clone each row as DataRow can only belong to one datatable.
|
|
|
|
|
I would recommend you don't disconnect the DataRow from its DataTable . There is a lot of other information in there, such as change information - not to mention that the column definitions are part of the DataTable (which you didn't replicated; FWIW, the easiest way to do that is DataTable.Clone , which replicates only the structure).
An array of DataRow s is still bindable, as well. An array implements IList so that you can bind it to a DataTable , ComboBox , or any other control. In this case, it's much better to bind against a DataView instantiated with the DataTable as the ctor parameter, then use the RowFilter property. This will track all changes.
If you don't need binding or change tracking and just want a simple list of DataRow s, then you'll either have to cope with the array, remove them from the old table and add them to the new table (and use a reverse for loop - changing the enumerable will throw an exception), or use Array.CopyTo (inheritted from your DataRow[] ) which will perform a deep copy (a shallow copy won't solve your problem, since it only copies a reference to the original (same) object).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for all your help. I have decided to continue with using DataTable objects as the interface between the DataLayer and the Business layer and to now use DataView objects as the interface between the BusinessLayer and the GUI.
|
|
|
|
|
I must profess my config file ignorance. I'm required to use an open source logging project. The project deposits logs into text files based on a path attribute in my application config file. I would really like to dynamically set that path, say to, the application path. Can you use functions in a config file, or do I have to just do it manually?
Thanks,
Ryan
|
|
|
|
|
If you want the application path, simply use Application.StartupPath . Don't force a user to put the path of the executable into the .config file in that very path - it's redundent, requires extra steps (always faulty), and is easy to get from code (even with native executables).
If you want simple string settings, see ConfigurationSettings.AppSettings in the .NET Framework SDK, which also includes examples.
If you want to make your own configuration section, implement IConfigurationSectionHandler , which is documented in the .NET Framework SDK as well and includes samples. There are also several articles here on CodeProject that discuss section handlers that you should search for.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hey Heath,
As I stated in my orginial post, I am forced to use an open source project that requires me to use the .config file. Is there a way to use COnfigurationSettings.AppSettings in the .config file?
Thanks,
Ryan
|
|
|
|
|
What does that have to do with open source? ConfigurationSettings.AppSettings and Application.StartupPath should both be available for any project that is run against an implement of the CLI (.NET, Mono, and Portable.NET). Read about the <appSettings> section in the .NET Framework SDK.
Open source just means the source is available for anyone to use and modify according to the license agreement. What language, framework, platform, etc. is not a factor of whether or not something is called "open source". Technically, every project posted on this site that provides source code is open source.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
you only store data in the config file. There isn't any environment variable type of mapping unless the library provides it.
You probably have to set the logging directory programatically whenever the application directory changes.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanks Andy, thats what I needed to know. I wasn't sure if there might be some sort of environment variables.
Ryan
|
|
|
|
|
Hi!
I was wondering... Is it possible that ApplicationException (or any other Exception class for that matter) catch some errors that Exception cannot catch? ApplicationException inherits from Exception so I assume Exception would catch every errors ApplicationException would.
Thanks a lot
P.S.: btw, I haven't seen such a thing... yet
----------------------
Be proud. Be yourself.
|
|
|
|
|
Exceptions are caught in order:
try
{
}
catch (TargetException e)
{
}
catch (ApplicationException e)
{
}
catch (Exception e)
{
} If an exception was thrown and was a TargetException , then it would be caught by the first catch block. If it was any other derivative of ApplicationException (or ApplicationException itself), then the second target block would catch it. If it was any other Exception , the last line will catch it. If you don't plan on using the variables, you can drop them (just use catch (Exception) . If you don't plan on using the exception information, you can simply use catch to catch all exceptions.
If you reverse the order of the first two catch blocks, the first catch block will catch all derivatives of ApplicationException , including an ApplicationException itself. In fact, this generates a compiler error.
You should take a look at the C# Language Specification[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Does anyone has ever encountered this problem?
I called a method but it doesn't execute (btw it's executed most of the time but sometimes it's not)
Here's what I've done to test this:
I call the method normally and the first line in the method is a Trace.WriteLine instruction.
So I guess either of two things happen:
1. Trace is not working properly (which would be pretty bad)
2. My method really is not called (which I think is even worse)
but everything after the call seems normal...
I'm thinking maybe
ThreadPool.QueueUserWorkItem(new WaitCallback(SendData), DataObj);
causes the problem... but it doens't seem to get there since the Trace.WriteLine instruction mentioned above is not executed (well no text is in my log!)
----------------------
Be proud. Be yourself.
|
|
|
|