|
Judah Himango wrote:
MSDN subscribers can get their hands on the full version of Visual Studio 2005 beta right now in fact.
Actually, no we can't - not yet anyway. Should be able to in a couple days. The latest post is still the May '04 CTP.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Anyone have some good example code for calling Java routines from C#?
- Bruce
BRCKCC
|
|
|
|
|
Unless you're able to convert the Java .class file to a .NET assembly, I believe this will require either a COM bridge or Mono's IKVM Java runtime. Mono lead dev Miguel de Icaza wrote a Java app on top of Mono that might get you pointed in the right direction: clickity[^].
Additionally, if you have the Java source code, you could try recompiling as J# code which gets compiled as a .NET assembly.
#include "witty_sig.h"
|
|
|
|
|
I've got an article on that at http://www.devx.com/interop/Article/19845[^]. It's a new edition of an article[^] I wrote for CodeProject alost two years ago, which was a rewrite of an article I wrote about a year before that. Sure, there are already bridge products that have been out for a couple years, but these articles will tell you how it's done (using JNI and, optionally, COM - though not required if you P/Invoke native functions from the JNI library you'd have to write).
The DevX article I linked first goes into greater depth about calling Java methods from the JNI DLL.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
Does anyone know of a good documentation generator for .NET code (C# or VB.NET)? Is there anything comparable to JavaDoc? I've tried using VS.NET's built in html documentation generator, but I have found it's documentation to be pretty useless, especially because it shows every member of a class, including private members. Is there anything close to the quality of JavaDoc?
Thanks, Andreas
|
|
|
|
|
Use NDoc[^], a project I'm proud to be a part of. It's used by many companies and can generate many types of documentation, with support for additional documentors. You can produce HTML Help 1.x and 2.x documentation that looks and pretty much acts exactly as the .NET Framework SDK documentation - consistency definitely helps.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Yep, I've just started using NDoc, and it's great!
|
|
|
|
|
I am a beginner & was working on namespace system.web.mail. i was simply trying to mail a hello world message on the click of
a button. BUT when i tried to do it i got an error message as follows
System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server.
i have not configured my outlook express is it due to that, or is there some other problem. please help me. my code was as follows
private void button1_Click(object sender, System.EventArgs e)
{
sendemail();
}
public static void sendemail()
{
SmtpMail.SmtpServer = "www.hotmail.com";
MailMessage mm = new MailMessage();
mm.From = "casablancaknight@hotmail.com";
mm.To = "casablanca111@hotmail.com";
mm.Body = "hello";
mm.Subject = "hi";
SmtpMail.Send(mm);
}
|
|
|
|
|
You specified a web page as the SmtpServer . You need to provide the address to the SMTP server.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hey, in my application i have a designer like control wich i want to split
5 ways (horizontaly) , how can i do this? im curently using 4 splitters
but the movment isnt good, what is the right way to do this?
|
|
|
|
|
Hello,
i've tried to serialize a Class with member of type ArrayList but it doesn't work. The Xml Document is empty. What's wrong?
Code:
class ImageCollection
{
[XmlElement(Type = typeof(Image)),
XmlElement(Type = typeof(Image))]
private ArrayList images = new ArrayList();
ImageCollection()
{
}
public void addItem(Image image)
{
this.images.Add(image);
}
}
ImageCollection img = new ImageCollection();
img.addItem(new Image());
XmlSerializer serializer =new XmlSerializer(typeof(ImageCollection));
XmlTextWriter writer =new XmlTextWriter("Images.xml", System.Text.Encoding.UTF8);
serializer.Serialize(writer,img);
writer.Close();
Thanks and greets from Austria
|
|
|
|
|
If you read the documentation for the XmlSerializer class, it states that only public properties and fields are serialized.
It is recommended that you do not expose public, read-write instance fields, so I would recommend exposing a read-only property (only has a get accessor so other classes can't assign a new ArrayList ) and attributing that as yo've done for the private field.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath – I’m sure you’re reading this… I’m 95% of the way to a solution to the Explorer dragimage problem. That’s both good and bad news. First off, the problem all along wasn’t my implementation of the COM interfaces; I had that right the whole time. The problem is how c# registers objects as drag targets. It does it automatically, so you have to first revoke and then re-register the control for drag drop to catch the interface’s methods.
That being said, I have a test project which, when something from the shell is dragged over the form, will fire the IDropTarget.DragEnter event. I have an IDropTargetHelper object that I’m using to call the DragEnter method, and voila, the Explorer drag image appears! HOWEVER, I am getting a NullReferenceException when calling the IDropTargetHelper’s DragOver method, and the drag image will not move with the cursor since there's an error. I’ve scoured the net for a reason why this is happening, but no luck there. Debugging doesn’t help since we’re dealing with an unmanaged code…
Would you be willing to help in any way? I can post code, email a sample, whatever you might be up for... I’m so close I just need to get over this one last hurdle!!
Thanks!
|
|
|
|
|
Never mind... I found a work around for the problem
|
|
|
|
|
I want to write a program that will allow me to populate TextBox controls on other unknown applications from a Drag/Drop type event.
Exmaple: I open a Web page or other Dialog program that contains a TextBox, I would like to drag an Icon from my program over the target TextBox and fill the target TextBox with my own data.
Somthing similar was done in the password hacking Reveal program way way back, but rather than revealing passwords, I want to send data to the targeted Control. How do I get/send information from the target control ?
Can I use the Drag/Drop event to get the window name, then get the control handle from the window name somehow?
Any ideas out there ?
|
|
|
|
|
If you want to paste data into a textbox, you will need to get the handle to the window (i.e., textbox) you want to access and then send the appropriate message. I did something similar the other day in C++ with Outlook so I can get the count of the items within the Outlook address book. Here is an example of what I did:
HWND hwnd;
CString text, msg;
text = "Address Book";
hwnd = ::FindWindow(NULL, text);
if(hwnd != NULL)
{
HWND hwnd2;
hwnd2 = ::FindWindowEx(hwnd, NULL, "OUTEXVLB", NULL);
if(hwnd2 != NULL)
{
LRESULT num;
num = ::SendMessage(hwnd2, LB_GETCOUNT, (WPARAM)0, (LPARAM)0);
if(num == 1)
msg.Format("Results: %i entry.", num);
else if(num > 1)
msg.Format("Results: %i entries.", num);
else
msg.Format("Results: No results.");
SetDlgItemText(IDC_Results, msg);
}
else
{
msg.Format("Results: No results.");
SetDlgItemText(IDC_Results, msg);
}
}
else
{
msg.Format("No results.");
SetDlgItemText(IDC_Results, msg);
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
For this methodology, I assume you got the control name ("OUTEXVLB") via spy++ ?
I'm looking to get the handle for any TextBox based on the location of the mouse.
|
|
|
|
|
|
Start with looking up the documentation for Control.DoDragDrop() . The complicated part is detecting the start of a Drag-Drop-Operation; you probably already have that. OTOH, the simple part is providing string data for the operation.
private void sourceControl_MouseMove(object sender, MouseEventArgs e)
{
sourceControl.DoDragDrop(someText, DragDropEffects.Copy |
DragDropEffects.Move);
}
That's it! You drag something, and drop it over *any* Textbox/RTF-Box (Explorer, Word(pad)...).
|
|
|
|
|
Can I simple-bind an object that derives from System.Windows.Forms.UserControls class?
Thank you,
Brett
|
|
|
|
|
Bind data to it, or bind it's properties to something else? Please be specific, as this is a rather ambiguous question.
Both are possible, but rather than go into a length discussion of both, please be specific. Also take a look at the Control.DataBindings property in the .NET Framework SDK that gets installed by default with VS.NET.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the response. I has more of an explaination here but didn't receive any replies.
I have created a UserControl which contains a ComboBox. This combo box if filled with data in the controls constructor. I created a public property to expose the ComboBox.SelectedValue property so I may bind to it from forms which use the control. The bindings never work. The debugger doesn't compain at all, and the values in the UserControl's ComboBox never changes with the CurrencyManager.Position changes.
|
|
|
|
|
Using the DataBindings property like so doesn't work?:
myUserControl1.DataBindings.Add("SelectedValue", dataSet1, "DataTable1");
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Correct, that binding will not work, hence my dilemma.
Neither of these work:
myUserControl1.DataBindings.Add("SelectedValue", dataSet1, "DataTable1");
myUserControl1.DataBindings.Add( new System.Windows.Forms.Bindings("SelectedValue", dataSet1, "DataTable1"));
Note, setting a value directly to the UserControl property does work.
Thanks for your assistence,
Brett
|
|
|
|
|
Both of those overloads to the same thing. The first actually uses the params to construct a Binding instance and then calls the second overload.
The thing about binding contexts is that they must be bound exactly the same. So, if you bind a ComboBox to a DataTable , then the Binding must also be bound to a DataTable .
I threw together a quick example. The ComboBox.DataSource is bound to a DataTable (in a DataSet ). The DisplayMember and ValueMember specify column names (say, "ID" and "Name").
I also defined a property (SelectedValue ) that reflects ComboBox.SelectedValue and created a binding in my ctor like so:
this.DataBindings.Add("SelectedValue", dataSet1, "Table1.ID"); The really important part is how you get the binding context. For the back and previous buttons, I threw together this:
private void button1_Click(object sender, System.EventArgs e)
{
CurrencyManager cm = (CurrencyManager)this.BindingContext
[this.dataSet1.Table1];
if (cm != null)
if (cm.Position >= 1) cm.Position--;
}
private void button2_Click(object sender, System.EventArgs e)
{
CurrencyManager cm = (CurrencyManager)this.BindingContext
[this.dataSet1.Table1];
if (cm != null)
if (cm.Position < cm.Count - 1) cm.Position++;
} Notice that the BindingContext is the table itself - the same as was bound to the ComboBox .
Microsoft MVP, Visual C#
My Articles
|
|
|
|