|
Hi,
haven't used Pascal so far. Is this library COM enabled? If yes then you can just add a reference to it - Visual Studio will automatically create a managed wrapper for it. Otherwise read about DllImport which might also help.
Robert
|
|
|
|
|
no its not a com enabled library ,,,,
thanks
hello
|
|
|
|
|
Hi guys,
I have built a custom Installaion project for one of my programs. I
have included in it some code that registers the product. This
registration code is in a seperate DLL file which gets executed. The
DLL has got a window form interface with a few options ("Demo",
"Activate", "Exit"). The problem is that if you click "Exit" I get the
following error message:
Could not find file "c:\proramfiles\company name\application
name\applicationname.InstallState".
If I click on the "Activate" Button it takes me through the activation
process sucessfully but upon going back to the installer it pops up the
same error message above.
I hope somebody can help here.
Thanks
|
|
|
|
|
I want to return a System.DateTime object from a method and be called when its value is chagned without keeping a reference to it.
For example
class SomeClass
{
public System.DateTime Field
{
get
{
return new System.DateTime(); //I want to know when the value of this object changes
}
}
}
|
|
|
|
|
System.DateTime just returns the current system time when executed. It does not get asynchronously updated by the system.
Geo
|
|
|
|
|
I think I didnt explain it very well
The DateTime will be populated with a value by the calling code. I want the class that returned the DateTime object to know when that happens.
|
|
|
|
|
|
George L. Jackson wrote: Use an event (delegate).
Please excuse my stupidity but how do I actually do that? Can I make an event fire when the value of the datetime object changes?
|
|
|
|
|
Hi,
first of all DateTime is a structure. This means that you don't pass around a real reference but a copy of the structure.
In your case you will probably need a small wrapper class for your DateTime:
public class MyDateTime {
private DateTime _value;
public event EventHandler ValueChanged;
public MyDateTime(DateTime value) {
_value = value;
}
public DateTime Value {
get { return _value; }
set {
_value = value;
OnValueChanged(EventArgs.Empty);
}
}
protected virtual void OnValueChanged(EventArgs ea) {
if (ValueChanged != null)
ValueChanged(this, ea);
}
}
Now whenever someone sets the Value property to a different value the ValueChanged event will be raised.
Your class should then look something like that:
class SomeClass
{
public MyDateTime Field
{
get
{
MyDateTime result = new MyDateTime(new System.DateTime());
result.ValueChanged += new EventHandler(OnFieldValueChanged);
return result;
}
}
private void OnFieldValueChanged(object sender, EventArgs ea) {
}
}
Depending on what you do it might also be necessary to unbind the event at some point. This would also depend on the fact if you really create a new instance of your DateTime on every get on the Field property. Probably something like this is better:
class SomeClass : IDisposable
{
private MyDateTime _field;
public SomeClass() {
_field = new MyDateTime(new System.DateTime());
_field.ValueChanged += new EventHandler(OnFieldValueChanged);
}
public MyDateTime Field
{
get { return _field; }
}
public void Dispose() {
_field.ValueChanged -= new EventHandler(OnFieldValueChanged);
}
private void OnFieldValueChanged(object sender, EventArgs ea) {
}
}
Robert
|
|
|
|
|
|
Hi Robert,
Thanks for your reply. I had thought of doing it this way but the problem is if the user of this code does the following
SomeClass c = new SomeClass();
MyDateTime t = c.Field;
t.Value.AddDays(2);
The event will not fire.
If they do this it would be ok
t.Value = t.Value.AddDays(2);
but I cant enforce this because I cant make the get() return a const
|
|
|
|
|
Looking more closly at the doco there is no method on DateTime that will change its value. The methods that modify the value return a new structure. Our programmers are just going to have to learn to code
someObj.Timestamp = someObj.Timestamp.AddDays()
I really really miss C++'s const-ness
|
|
|
|
|
I thought you were using get/set properties to access the DateTime. Thus, event code can be triggered once the property is accessed.
|
|
|
|
|
Thanks again for your help. Im sorry if I wasnt clear and sent you on a wild goose chase
|
|
|
|
|
Hello!
I have my UserControl which has its own size (in Designer view), and also I have it placed to some form, where it also has its own size.
Question: How can I make so that userControl would resize while placed to form, where it has its own size?
Thank you for your help!
|
|
|
|
|
What?? I don't understand your question!
|
|
|
|
|
I've created a .NET developer search engine using Google's COOP system so I can get more relevant results at www.netbrick.net. It seems to work very well. I would like to invite you to check it out and let me know what you think.
Thanks,
-Tyler
Tyler Jensen
Right tools, right methods!
|
|
|
|
|
I've been trying to install a VS Add-in and although it shows up under the Add-in manager, the add-in (VSDocMan) is unable to insert the MenuItems into the Tools menu. I would suspect a problem with the application but when I try to install the VBCommenter Add-In I get exceptions when it loads. Am I missing some hidden setting that might be preventing the IDE from loading the Add-in correctly? Any help would be appreciated. TIA
Uptight Ex-Military Republican married to a Commie Lib - How weird is that?
|
|
|
|
|
Do you know what is the MOST IMPORTANT BUG in .NET framework 2.0?!!!
Please reply it here
|
|
|
|
|
|
no i dont know
no i dont know,
|
|
|
|
|
The fact that it doesn't install a turing test that runs via global keyboard hooks and disables the net connection of anyone who fails.
|
|
|
|
|
I need to implement a xaml writer that can save event handler info into xaml file. However, after I went through the Markup Object, I cannot find the info.
For example, I have following codes:
Window w1 = new Window();<br />
DockPanel p1 = new DockPanel();<br />
<br />
w1.Title = "Mock Window";<br />
w1.Content = p1;<br />
Button b1 = new Button();<br />
b1.Content = "Test Button";<br />
b1.Height = 50;<br />
b1.Click += new RoutedEventHandler(OnMockButtonClick);<br />
p1.Children.Add(b1);
When I called XamlWriter.Save(w1), I want the following xaml string output:
<Window Title="Mock Window"><DockPanel><Button Height="50" Click="OnMockButtonClick">Test Button</Button></DockPanel></Window>
|
|
|
|
|
hi dear
can u please tell me that.. what will happen if i am going to launch / deploy an application on .net framework2.0 which is developed in .net framework 1.0 or 1.1 ???
please guide me in this matter..
regards
vishal
Thanks & Regards
Vishal Sharma
vishalsharma556@yahoo.co.in
|
|
|
|
|
As long as the 1.1 framework is installed on the server, you're fine. Your other option is to port it over to 2005 using VS.
|
|
|
|