No, can't figure this out by myself... I do have some dll's written in c++ which are part of a big project. Now I want to do a C# program that only display functions and parameters from a selected dll dynamically. Tried some with LoadLibrary but can't get it to work. I won't call the dll code just need the info. Ideas?
mikla521
Posts
-
Dll info -
Silverlight webserviceI have made a Silverlight application which use a WCF webservice. I works fine but there is a small problem. The background: I run a gameserver and the game saves a resultfile which is updated in an interval (can be set). I have a webpage with a Silverlight app. The SL app uses webservice to update some data on the client, with an automatic update every 20 seconds or so. Also works fine. The Webservice parse the file from the game and that's no problem. But I realize that if, let's say, 50 ppl go to the page and just watch the SL app update, the webservice parses the file 50 times every 20 seconds! Not good... Here is how I want it to go: The client calls the webservice and gets the already parsed file as data. And the parsing/reading the file will update in the background and store the data to be ready for transfer to the client. But how do I make my webservice parse the file without the client calling the service? I actually don't know how to pass this problem... not an webservice expert either :) Any tips and was I clear enough?
-
Event trigger, customOk, finally it works :) Was only a namespace issue....
-
Event trigger, customI have a UserControl with a custom RoutedEvent. I want to use that to trigger an animation, but can't get it to work at all.
public partial class InfoBox1 : UserControl {
public static readonly RoutedEvent MyFadeOutEvent =
EventManager.RegisterRoutedEvent("MyFadeOut", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(InfoBox1));
public event RoutedEventHandler MyFadeOut
{
add { AddHandler(MyFadeOutEvent, value); }
remove { RemoveHandler(MyFadeOutEvent, value); }
}
void RaiseMyFadeOutEvent()
{
RoutedEventArgs newEventArgs = new RoutedEventArgs(InfoBox1.MyFadeOutEvent);
RaiseEvent(newEventArgs);
} ...<UserControl.Triggers>
<EventTrigger RoutedEvent="InfoBox1.MyFadeOut">...and the error: 'InfoBox1.MyFadeOut' value cannot be assigned to property 'RoutedEvent' of object 'System.Windows.EventTrigger'. Value cannot be null. What am I doing wrong here? :confused:
-
XMLDataProviderThink I solved it myself this time :) Code behind:
String xpath = "CouplerSettings/Product[@Id='" + productName + "']/Coupler[@Id='R+S Grid']";
XAML
<TextBox Text="{Binding XPath=Attenuation[@Id\=\'GSM850LowChTX\']/@Value}" />
-
binded TextBox update only on focus lostAt this moment, I'm one of them putting up a lot of questions here but I actually can solve your problem. In my way of course :)
<TextBox Name="tb1" ></TextBox>
<Button Height="23" IsEnabled="{Binding ElementName=tb1, Path=Text, Converter={StaticResource StringBoolConverter}}"></Button>and a ValueConverter like this
public class StringToBoolConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value.ToString() == "")
return false;return true; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion }
and in your resource
<local:StringToBoolConverter x:Key="StringBoolConverter" />
-
XMLDataProviderJust discovered the XMLDataProvider, great! :) My problem this time is the binding. My XML file looks like this...with several products and more than one Coupler per product but with different Id.
<CouplerSettings>
<Product Id="C702">
<Coupler Id="R+S Grid">
<Attenuation Id="GSM850LowChRX" Value="8.9875" />
<Attenuation Id="GSM850LowChTX" Value="7.745" />
<Attenuation Id="GSM850MidChRX" Value="10.7375" />
<Attenuation Id="GSM850MidChTX" Value="8.73375" />
....I select product in a ListBox, based on another file. Then I want to bind a TextBox to a Value with a specific Attenuation Id, that is within the same element. In my code I have
String xpath = "CouplerSettings/Product[@Id='" + productName + "']/Coupler[@Id='R+S Grid']";
XmlDataProvider providerCoupler = new XmlDataProvider();
providerCoupler.Source = new Uri(@"D:\Programming\MyFile.xml");
providerCoupler.XPath = xpath;
WrapPanelCoupler.DataContext = providerCoupler;and in XAML
<WrapPanel Name="WrapPanelCoupler" Grid.Row="2" MaxWidth="800">
<TextBox Name="textbox1" Text="{Binding XPath=???If I select the C702 product and Coupler with Id="R+S Grid" and then want to bind the TextBox text to the Value where i.e the Attenuation Id="GSM850LowChRX", how to do that? If I change the code to
String xpath = "CouplerSettings/Product[@Id='" + productName + "']/Coupler[@Id='R+S Grid']/Attenuation[@Id='GSM850LowChRX']";
and
<TextBox Name="textbox1" Text="{Binding XPath=@Value}
does the trick but I really want the binding to include the Attenuation Id.
-
Animate a button when mouse is overOk, from the beginning I started with a style. Seems like I missed to add..
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform/>
</Setter.Value>
</Setter>Why is that necessary? Anyway, it works fine now.
-
Animate a button when mouse is overWhat am I doing wrong this time? I want a button to change the scale when mouse is over. I'm really missing something, cause this doesn't work. But what is wrong?
<Button Name="MyScaleButton" >
<Button.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="(Button.RenderTransform).(ScaleTransform.ScaleX)"
From="1" To="2" Duration="0:0:1">
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers>
My Button
</Button>Nothing at all happens here. Must be wrong in the TargetProperty?
-
UserControl DatabindingBeen trying around a little... If my data object looks like:
public class MyData : INotifyPropertyChanged
{
private String m_LowChRX;
private String m_LowChTX;public String LowChRX
{
get { return m_LowChRX; }
set { m_LowChRX = value; OnPropertyChanged("LowChRX"); }
}
public String LowChTX
{
get { return m_LowChTX; }
set { m_LowChTX = value; OnPropertyChanged("LowChTX"); }
}...In my code I can set the data values in
MyData myData1;
And use binding like this
binding = new Binding("LowChRX");
binding.Source = myData1;
myBox.tbLowChRX.SetBinding(TextBox.TextProperty, binding);where myBox is my UC. And, again, I have 6 textboxes in myBox. Then I have to repeat that binding for each textbox. And here is the point where I change from myData1 to other data objects. If I have a List<String> in my UC, how do I bind it? When then TextBox is a Control, maybe I have to make a custom control inside which hold my List? So I can bind like:
myBox.CustomControl.SetBinding(Property, binding)
Am I on the right track now? :)
-
UserControl DatabindingI will try again :) A listbox where I can select product, nothing strange here. Then a Tab with 6 radiobuttons to select Coupler and in that same Tab I have my UserControls. So when I change selectedItem in my listbox OR change radiobutton, I need to update my UserControls with new data. ONE of the UserControls in my XAML looks like:
<AttBox:MyAttBox Header="GSM 850" x:Name="AttBox_GSM850"/>
In my code I have (don't care about the private members now, let's say they are public :) ):
public CouplerDB myDB = new CouplerDB
When I want to change in the UC I get the values from:
Product p = (Product)productListbox.SelectedItem;
myDB.m_products[p.ProductName].m_attenuations["Cable"].Values[Band.GSM850][0]
myDB.m_products[p.ProductName].m_attenuations["Cable"].Values[Band.GSM850][1]...so I can set
AttBox_GSM850.LowChRX = myDB.m_products[p.ProductName].m_attenuations["Cable"].Values[Band.GSM850][0];
But to simplify things here... If I have ONE and only ONE UC. I want a Dictionary where each KEY selects, i.e a List<String> to populate the UC listboxes, also want TwoWayBinding. Ehh..I have a testproject, where can I post it? :)
-
UserControl DatabindingOk, will try refine myself here :)
public class CouplerDB
{
private Dictionary<String, Coupler> m_products;
....
}public class Coupler
{
private Dictionary<String, Attenuation> m_attenuations
....
}public class Attenuation
{
private Dictionary<Band, List<String>> m_values = new Dictionary<Band, List<String>>();I want my user control textboxes to display the values from the List<String> but it's not absolute necessary to have that list, just a place to store 6 different value. Scenario: In a listbox I can select a product. Radiobuttons to select Coupler. Then I have a UserControl for each Band which I want to display the corresponding Strings. Clear? :-D *Sigh* If I change Coupler I need to change the binding. Another way to do it is to hardcode everything, but then I need almost 60 UserControls with a total of 360 Textboxes! My way I "only" need maximum 10 UserControls...
-
UserControl DatabindingI give up, can't find any good information about this anywhere :( I have a UserControl with 6 textboxes. I have a quite complex datastructure from where I want to fill these textboxes. The datastructure contains several sets of "String[6]" but I can't figure out how to bind it :(
public partial class MyAttBox : UserControl
{
// 6 of these with different names
public static DependencyProperty LowChRXProperty = DependencyProperty.Register("LowChRX", typeof(String), typeof(MyAttBox));
public String LowChRX
{
get { return (String)GetValue(LowChRXProperty); }
set { SetValue(LowChRXProperty, value); }
}
}"main" XAML:
<AttBox:MyAttBox Header="GSM 850" x:Name="AttBox_GSM850" />
my data is stored like:
public class ABC
{
private Dictionary<String, List<String>> m_values = new Dictionary<String, List<String>>();public Dictionary<String, List<String>> Values { get { return m\_values; } set { m\_values = value; } }
What I want to is to select a Key in my code and connect the Values to the texboxes in my UC. How?
-
GAC problemWhat I have done: The main app reversed. The dll from GAC also reversed and put into same solution. The main app has the Framework.dll as reference. Building works. When I run I get following: "The following module was built either with optimization enabled or without debug information".... and the path to GAC dll. That indicates to me that it's wrong dll since I run in debug mode, even the Framework.dll. Maybe this is over my head :) The point is that I don't need the dll to reside in the GAC, but how do I make the reference point to "my" dll?
-
GAC problemI don't have a clue how to solve this... In the first place I needed to know how to read Shared Memory. Then I have a freeware program that use that and my thought was to reverse engineer that app to see how it's done. Well, works like a charm, so far. The problem is: The main app use a dll from the GAC, lets say Framework.dll. I have reversed engineered that one too and have a reference in the main app to that dll. But when I run the program it is the original one in the GAC that is used and I can't find where to change that.
-
Databinding in UserControl [modified]Oh, my fault, the intention was to bind to the property :)
-
Databinding in UserControl [modified]I'm stuck (as usual). A have a user control with 6 textboxes. But to make it easier, I'm trying to break down the problem a bit and lets say there is one textbox. USERCONTROL1.XAML:CS
public partial class AttenuationBox : UserControl
{
private String justAtest;
public String ATest { get { return justATest; } set { ...public String LowChRx { get { return tbLowChRX.Text; } set { tbLowChRX.Text = value; } }
...
}USERCONTROL1.XAML
<textbox name="tbLowChRX" text="{Binding Path=ATest}"></textbox>
Now I want tbLowChRX to be bound to justAtest. But just can't get it to work. Must be something I have missed in Source or Path or...
modified on Sunday, April 19, 2009 12:49 PM
-
Context menu in DatatemplateOk, thanks :) I tried that before but it doesn't seems like it's possible to use the startup Window1 class. Think I have to create a separate class behind my resource file and go from there...
-
Context menu in DatatemplateI have created a separate file with my templates and style and use <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="resourceDic.xaml"/> </ResourceDictionary.MergedDictionaries>
-
Context menu in DatatemplateSorry....like this then... <DataTemplate x:Key="TestDataListTemplate" > ... <Grid Margin="5,2"> <Grid.ContextMenu> <ContextMenu> <MenuItem Header="Delete" Click="MenuItem_Click_DeleteProduct" /> </ContextMenu> </Grid.ContextMenu>... Error:ResourceDictionary root element requires a x:Class attribute... If I add x:class="MyProgram.Window1" to <ResourceDictionary the i get this instead, among a few others... Error: Partial declarations of MyProgram.Window1 must not specify different base classes....don't get it. :sigh: Well, it seems like I have more problems. The goal is to have ListBox with DataTemplate items, then I want a ContextMenu where I can choose to delete an item... Maybe I have to think in another way.
modified on Sunday, April 12, 2009 2:41 AM