|
Hi
I have created a dll in vc++ 6.0 from where i want to send a specific message to my c# application and than want to handle that event in my c# front end
further i am also using that dll in a web seb service in c# that is used in an interface developed in vb.net.
is it possible to send my custom message from vc++6.0 dl to c# web service.
Waiting for ur responce
Thanks.
|
|
|
|
|
I have made a Custom Control and I'm having troubles in design time - I have omitted the Dispose method to the ABox in the code below.
Using the following code in design time (adding an ABox to a Form), i can change the MyComp.MyText property in the property editor and the Text property on my ABox will change.
But I can't change the MyComp.MyList property and make it change the ABox' Items values. It works in RunTime but not in design time.
How come?
Any and all ideas would be very welcome.
spif2001
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace AgroTest
{
public class ABox : System.Windows.Forms.ComboBox
{
private System.ComponentModel.Container components = null;
private MyComp myComponent;
public ABox()
{
InitializeComponent();
this.myComponent = new MyComp(this);
}
[Category("AgroTest"), System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public MyComp MyComponent
{
get
{
return this.myComponent;
}
}
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
}
}
using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Collections.Specialized;
namespace AgroTest
{
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class MyComp
{
private ABox owner;
private StringCollection myList = new StringCollection();
private string myText = "!!";
internal MyComp(ABox owner)
{
this.owner = owner;
}
[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design",
typeof(System.Drawing.Design.UITypeEditor)),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
DefaultValue(false)]
public StringCollection MyList
{
get{return this.myList;}
set
{
try
{
this.owner.Items.Clear();
foreach(string s in value)
{
this.owner.Items.Add(s + "!!");
}
this.owner.Invalidate();
this.myList = value;
}
catch(Exception){}
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
DefaultValue(false)]
public string MyText
{
get{return this.myText;}
set
{
try
{
this.owner.Text = value;
this.owner.Invalidate();
this.myText = value;
}
catch(Exception){}
}
}
}
}
|
|
|
|
|
Hi,
Try calling the InValidate() method, even after you set the value in the property.ie,
In "public StringCollection MyList" and "public string MyText", in the set block , call Invalidate after u set the value to MyText.
Try this and let me know...
Regards,
Manivannan
|
|
|
|
|
Sadly it had no effect - thanks though
|
|
|
|
|
Hi i'm new to C# and i'm trying to create a telephone Call Record on a datagrid but i couldn't get anything displayed on my datagrid. Though i assigned my datasource to be my call records. I was just wondering if anybody can give me a little lecture on datagrids.
Thanks.
|
|
|
|
|
Could you post some code as to how you are assigning the datasource? Is this a windows form app or a web app?
|
|
|
|
|
I want to get and set ShortDate format from control pannel setting.how can i do in C#.
Pls answer me.
|
|
|
|
|
I can only point you in the vague direction of the Globalisation namespace of .NET. This article mentions changing the CulterInfo (which is what you want) of a thread.
regards,
Paul Watson
South Africa
The Code Project
|
|
|
|
|
hi,
i need to create new tabpage in runtime by user action. and, each tabpage should be the same with same controls. i draft a Panel User Control. i planned to use it to insert in the tabpage dynamically.
anyone have idea on this issue?
thanks,
jim
|
|
|
|
|
Try this:
1. drag and drop a textbox ctrl, a button and a Datetime picker.
2. run the application and press tab . u can see the focus in each control including DTpicker.
3. Just select another date in the dattime picker using that combo.
4. now press tab , u will see that DTPicker doesnt receive the focus....
help me if u can brin the focus ....
regards, Mani
|
|
|
|
|
hello i am creating a docking window class and so far it all works and im just using the regular dock property and it inherits from Form when my form is docked to the parent and is resizable i can resize it however when it loses focus it snaps back to fill the parent i tried saving the size in the resize event and setting them in both paint and deactivate events however neither will retain the size what can i do to make it save the size when it gets resized.. i am using similar code when it is not docked and that works fine
|
|
|
|
|
i am new to win ce application i have a small pocket pc application i want to create .MSI file for my application. i have three projects in one solution myapplication project,custom installer(empty project),setup project i have added a installer class file for CustomInstaller project and modified it with some code, but i am getting the following error when i build the Custom Installer project. The error is
"Pre-Build Event Faliled"
please help
regards for any help
Any comments please mail to chatcops007@yahoo.com
|
|
|
|
|
Try this article here on CodeProject:
http://www.codeproject.com/netcf/compframe4.asp
hope it works - it did for me...
spif2001
|
|
|
|
|
Look at your project properties to see what the pre-build event is (if you don't already know). Whatever it is (batch file, script, etc.) you can try running it separately, from a command prompt and proceed to debug it. The article refered to by spif2001 has a batch file, for example.
Additionally, if the script has any error output, you should be able to see it in Visual Studio's "output" window.
By the way, I think you get that message whenever the specified script returns a non-zero errorlevel.
Matt Gerrans
|
|
|
|
|
How can you do this for other browsers like Netscape or Opera? Can this be done for other browsers?
http://www.codeproject.com/useritems/iemozilla.asp[^]
If it has been done can you tell where I can learn more about this or other good resource sites.
Thanks,
|
|
|
|
|
Here is my situation. I have a treeview where the user chooses the type of object they want to create. Next I need to create an instance of that class on my window. Then I need to manipulate the functions and attributes of that class with the window interface. For some dumb reason I thouht that I could force a class onto an object variable. I create an object of type subclass then place it in a variable of type object. The problem is that this requies casting the value from a switch statment anytime I want to access any attributes or functions. I have been looking at this all day and am going cross eyed. Someone please slap me and give me the answer that is probably right in front of my face. How can I take a variable of type object that I know contains some form of subclassed object and create an instance of that subclassed object.
|
|
|
|
|
I'm not sure I understood your problem correctly, but you could assign the object variable to a temporary variable of the proper type, e.g., assume your class is named "MyClass", and your object variable is named "obj":
MyClass x = (MyClass)obj;
Then, instead of using (MyClass)obj all over, you can use x.
HTH.
Yes, even I am blogging now!
|
|
|
|
|
That is what I thought I could do. The problem is what type is MyClass. The obj variable could hold one of 10 different sub classes. Which sub class do I declare x as? This is why I kept talking about the switch statment. I would have to have a switch statment in every function that declared a local var of the appropriate type. I want to create a class level variable that is strongly typed to the sub class stored in obj. Sorry about the bad grammer and explanation in my first posting I was burned out at that point. I am starting to look into using a factory to return the appropriate type but do not fully understand if that fixes my problem because I still have to know what the return type from the factory would be. I feel like I am in an endless loop!
|
|
|
|
|
This is a simple OO problem.
What you need is a base class (preferably an Interface) which defines all the shared functionality of your common objects, that is what you declare the "MyClass" as in the above example.
eg:
interface IDoSomething
{
void DoSomething();
}
interface IDoSomethingFactory
{
IDoSomething CreateDoSomething();
}
public class ConcreteDoSomething : IDoSomething
{
public void DoSomething(){Console.WriteLine("Done");}
}
public class ConcreteDoSomethingFactory : IDoSomethingFactory
{
public IDoSomething CreateDoSomething()
{
return new ConcreteDoSomething();
}
}
function DoFunkyStuff(IDoSomethingFactory factory)
{
IDoSomething myObj = factory.CreateDoSomething();
myObj.DoSomething();
}
|
|
|
|
|
But then my variable is typed to the base class or interface. I then have to write logic all over my app to account for the differing functionality within each sub class. I may be asking a stupid question with this one I was just hoping that there was an easier way. What you suggest is actually how I started except I used abstract and virtual methods in my ancestor class. I just felt like there should be an easier way. I started to look at taking my object and using GetType and then using Reflection to emit a new class of that type but did not pursue it very far. Has anyone else tried something like this?
|
|
|
|
|
Where are my manners? I have forgotten to thank everyone for the responses. It has been awsome being able to get feedback and bounce ideas off you guys. Thank you very much.
|
|
|
|
|
Jim,
You may want to post some simple examples of what you are trying to do, as its hard to give ideas with nothing to go on.
Im 99% sure whatever your problem is can be solved with a decent object model, but I cant be too specific without knowing whhat exactly you're trying to achieve.
|
|
|
|
|
Could somebody kindly give me the code for setting the data to the clipboard for the location point of a control and then retrieving it from the clipboard? The code for the control would be done using ((Control)sender).Location as the data point and it would contain the X parameter (ie X=100 for example) and the Y parameter for the point (ie Y=100 for example). Thus the whole amount that should be written to the clipboard is {X=100, Y=100} which is stored there as a System.Windows.Forms.DataObject. What is the code to write the location of the control using ((Control)sender).Location and retrieving it in another event handler?
New_Phoenix
|
|
|
|
|
The following code example will show you how to use the Clipboard class and place values into and out of it.
private void button1_Click(object sender, System.EventArgs e)
{
Point pt = new Point(100, 100);
Clipboard.SetDataObject(pt, true);
}
private void button2_Click(object sender, System.EventArgs e)
{
IDataObject obj = Clipboard.GetDataObject();
if(obj.GetDataPresent(typeof(Point)))
{
Point pt = (Point)obj.GetData(typeof(Point));
MessageBox.Show(string.Format("X:{0} Y:{1}",
pt.X.ToString(), pt.Y.ToString()));
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Nick Parker:
I just wanted to thank you. Your code worked great.
I do have two more questions to ask, though. Is it possible to create two clipboard objects with chains of data, one to contain the one set of points and the second to contain a second set of points? I would also then need to be able to add to and remove from those chains and thereby move the next element up the chain in the clipboard.
Second, how could I go about parenting one control to another control? For example, I have one control, and I would like to be able to join two controls together so that they could move together. I know that it would be something involving: ctrl.Controls.Contains(control). That is, I would need at some point to ask the control:
if (ctrl.HasChildren)
{
}
How do I join one control to another control so that I could later check to see if it has any children or whether it is a parent of other controls?
Thanks again ! ! !
|
|
|
|