|
You can use C/C++ built DLLs in C#. Look into p/invoke. Assuming the fortran code was compiled into c++ compatible DLLs as well you could you it as well.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
hi thanks for the reply. I did look into DLLs but i didn't get one to work.
do you have a tutorial link on DLLS?
Is there an easy way to create C++ compatible DLLs using Fortran code?
And can classes get incorporated into DLLs? or just methods?
Is it not possible to use the object files then? I'd rather not translate the Fortran.
|
|
|
|
|
Assuming you have the source available the pinvoke wizard should be able to help with getting the declarations to do the import correct.
http://www.paulyao.com/resources/tools/pinvoke.asp[^]
I suggest looking for a fortran board for assistance with getting DLLs that can be called by standard win32 applications. This isnt a good place to try and find someone with that skill.
You can import structs, classes, and stand alone function calls from a native dll.
You can't use object files. They're a semi compiled format and native code can't be directly compiled into managed code. You need dlls. If you can use the obj files in a windows C/C++ compiler you should be able to create a dll containing all of thier functionality for use via p/invoke.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop.
-- Matthew Faithfull
|
|
|
|
|
|
Ylno wrote: Is it possible for me to use the object-files produced when compiling C++/Fortran
and use them in C#?
It might be possible. If it is possible it would likely be easier to accomplish if you knew about Computer Programming.[^]
The process of writing source codes requires expertise in many different subjects, including knowledge of the application domain, specialized algorithms, and formal logic.
led mike
|
|
|
|
|
Thanks led mike. I did think about learning programming but I thought I'd try C# first.
I guess it's time to bite the bullet.
led mike wrote: It might be possible. If it is possible it would likely be easier to accomplish if you knew about Computer Programming.[^]
-- that's exactly the type of comment that makes people stay away.
|
|
|
|
|
I've got a serious problem with these two. In short, they aren't working or I'm not doing it right (I'm hoping it's the latter).
I am trying to open a Word document. After the user closes the Word document, I want to start another process (namely, a web address). Every time, the processes open one after the other -- without pausing or anything. Here is the code I have (and I have tried various rearrangements):
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();<br />
psi.RedirectStandardOutput = true;<br />
psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized;<br />
psi.UseShellExecute = false;<br />
psi.Arguments = @txt_Wordfile.Text;<br />
psi.FileName = @WordExe];<br />
<br />
System.Diagnostics.Process WordProcess = new System.Diagnostics.Process();<br />
<br />
WordProcess = System.Diagnostics.Process.Start(psi);<br />
WordProcess.EnableRaisingEvents = true;<br />
WordProcess.WaitForExit();<br />
<br />
System.Diagnostics.Process.Start(txt_website.Text);
Even in debug mode, it shows WordProcess.HasExited == true right after the process starts.
Also, the window does not open maximized.
Please help! Thanks!
|
|
|
|
|
I think that this is due to the fact that Word starts up by opening an intermediary executable, which is killed immediately after it loads the actual Word executable. What you should probably do is use the windows handle to call the win api method ShowWindow to maximize after you instantiate word (look for windows with class name "OpusApp"). Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I think I know what you're talking about, but just in case I'm wrong, could you put that in a sample code? Thanks!
|
|
|
|
|
just a quick question... for anyone using cvs/svn which product and which shell/ide intergration are you using?
|
|
|
|
|
Wrong forum but TortoiseSVN.
|
|
|
|
|
We use TortoiseSVN, and also have AnkhSVN for IDE integration. (Its cool to run both at the same time). Ankh is convenient (but not a proper source control plugin) and lacks some of the features of Tortoise. Considering they are both free though, you can't go wrong
|
|
|
|
|
Hello,
Does anybody worked on parsing exception and displaying user friendly messages. I know, this depends on project to project, but i just want to know is there any standard proceedure to parse an exception and come up with good user friendly (Vista type) taskdialog?
Thanks
|
|
|
|
|
Is there a was to bind a listbox.items to a database? I'm trying to use one column (Phone) to store 5 items that are in a listbox... any references that you could point me to?
|
|
|
|
|
ListBox.DataSource = MyDbPhoneList:
ListBox.DisplayMember = "Phone";
only two letters away from being an asset
|
|
|
|
|
so the phone listbox takes 5 phone numbers... will those 5 phone numbers be listed under the column phone for each person? How will you fill will those 5 phone numbers be listed back in the listbox?
|
|
|
|
|
I think you need to do some research on how to use a ListBox and possible GridView
only two letters away from being an asset
|
|
|
|
|
Hi All,
I am trying to encode in to my website using Flash media encoder.
Can any one let me about the parameter in My object tag?
<object>
----code
thank you
Regards
|
|
|
|
|
kibromg wrote: I am trying to encode in to my website using Flash media encoder.
Can any one let me about the parameter in My object tag?
Are you suffering from some wierd form of whiplash that prevents you from raising your eyes to the top of the page and see that this forum is about C#?
|
|
|
|
|
Should'nt the following code not work? I really can't see what's is wrong. I have debugged it, and know the xmldataprovider does contain the data. I have also tried to edit the XPath to other things. And yes, I have looked at other examples and can't figure out what's is wrong. The code works in XamlPad without modifications...
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Page.DataContext>
<XmlDataProvider
XPath="/Accounts/*">
<x:XData>
<Accounts>
<Sum Use="Sum1">
<Account Use="Account1"/>
<Account Use="Account2"/>
</Sum>
<Sum Use="Sum2">
<Sum Use="Sum3">
<Account Use="Account3"/>
<Account Use="Account4"/>
</Sum>
<Account use="Account5"/>
</Sum>
</Accounts>
</x:XData>
</XmlDataProvider>
</Page.DataContext>
<Page.Resources>
<HierarchicalDataTemplate
DataType="Sum"
ItemsSource="{Binding}">
<TextBlock Text="{Binding XPath=@Use}" />
</HierarchicalDataTemplate>
<HierarchicalDataTemplate
DataType="Account"
ItemsSource="{Binding}">
<TextBlock Text="{Binding XPath=@Use}" />
</HierarchicalDataTemplate>
</Page.Resources>
<TreeView ItemsSource="{Binding}"/>
</Page>
Best regards
Lasse Espeholt
|
|
|
|
|
Hi,
In WinForm .net 2.0, is there a drop down control which allows multiple selections?
Drop down control seems to allow only for a single selection.
Thanks
|
|
|
|
|
No, But you should be able to create one with some effort. Basically you would need to create a control, add in a combobox and a checked list box. Set combobox's ListControl property to the list box. You would need to keep track of selections separately and display it as comma separated text or something similar.
|
|
|
|
|
Hi,
I'm trying to serialize an object which contains an array of Objects, which holds in one of it's elements a generic LinkedList. And when I try to serialize the object, i get a InvalidOperationException, saying that "There was an error generating the XML document.", and no further details. Does anybody know what can cause this, and how to resolve it?
Here's the example code (doesn't work):
[XmlRoot()]
public class TestObj
{
private Object[] array = new Object[2];
public TestObj()
{
}
[XmlArray()]
public Object[] Items
{
get { return array; }
set { array = value; }
}
}
class Program
{
static void Main(string[] args)
{
TestObj t = new TestObj();
LinkedList<String> list = new LinkedList<string>();
list.AddLast("abcdef");
t.Items[0] = list;
t.Items[1] = 123;
XmlTextWriter wr = new XmlTextWriter("test.xml",Encoding.UTF8);
XmlSerializer s = new XmlSerializer(typeof(TestObj));
s.Serialize(wr, t);
wr.Close();
}
}
|
|
|
|
|
Do the following:
[Serializable]
public class SerializableLinkedList<t> : LinkedList<t>, IXmlSerializable, ISerializable {
...
}
</t></t> Then instantiate and use that class instead (in your example, the ISerializable interface is optional). Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Thanks for the reply,
The Serializable attribute and ISerializable are connected with regular serialization, not XML serialization. So marking the class as Serializable or implementing ISerializable won't solve the problem.
As for IXmlSerializable, it would probably work, but I would have to implement my own xml serialization routines for the LinkedList, which would lead to adding an amount of unnecessary code (and I would need to do the same for other collection classes, like List<> or Dictionary<>, which also cause the same problem), and it's not what I would want to do.
If I won't find any other way to solve this problem, I think I'll just use a BinaryFormatter to serialize this class.
|
|
|
|