|
nta_3886 wrote: help me quickly
Not only is that not a useful subject, it is rude.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Aw crap, I hit the Spam button when I tried to hit the 5, sorry.
|
|
|
|
|
LOL !!
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
lolo lol........
|
|
|
|
|
Here is a XAML snippet (which would run in XAML Pad as well):
<TabControl>
<TabItem Header="One">
<TabControl>
<TabItem Header="OK">
<Button Content="OK"/>
</TabItem>
<TabItem Header="Not OK">
<Button Content="Not OK"/>
</TabItem>
</TabControl>
</TabItem>
<TabItem Header="Two">
<TabControl>
<TabControl.Template>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid KeyboardNavigation.TabNavigation="Local" SnapsToDevicePixels="true" ClipToBounds="true">
<Grid.RowDefinitions>
<RowDefinition Name="RowDefinition0" Height="Auto" />
<RowDefinition Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<DockPanel>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Name="HeaderPanel" ZIndex="1" KeyboardNavigation.TabIndex="1" IsItemsHost="true" />
<Label Content="Something" />
</DockPanel>
<ContentPresenter Name="PART_SelectedContentHost" Grid.Column="0" Grid.Row="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" ContentSource="SelectedContent" />
</Grid>
</ControlTemplate>
</TabControl.Template>
<TabItem Header="Apple">
<Button Content="One Apple a day, keep the doctors away"/>
</TabItem>
<TabItem Header="Carrot">
<Button Content="One carrot a day, ho well, nothing special"/>
</TabItem>
</TabControl>
</TabItem>
</TabControl>
Where every time you select the TabItem "Two" (in the toplevel tab) the inner TabControl would change its selected item.
(every second time it will be "Apple" every other second time it will be "Carrot")
Why does the inner tab changes?
How to work around this bug?
|
|
|
|
|
Please help me, I need to translate the following c# code to VC++ and I don't have too much experience in C#, and don't have time to get the experience. Please help!!.
using Copy_Vendor.API;
namespace Copy_Vendor_Client
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
CopyVendor copyvendor = new CopyVendor();
copyvendor.SendPrintJobInformation(Convert.ToInt32(txtData.Text), 25.93);
}
catch (Exception ex)
{
string temp = ex.Message;
}
}
}
}
|
|
|
|
|
Wrong way, you should always go to C#.
|
|
|
|
|
AntonioRamirezL wrote: using Copy_Vendor.API;
There is #include in C++, but it does something slightly different. Do you have this component in C++ ? If not, you are hosed. You can write a C++/CLI wrapper for this code, but then you need .NET again.
AntonioRamirezL wrote: public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
None of this converts directly, you'll need to create an MFC form to replace this one
AntonioRamirezL wrote: CopyVendor copyvendor = new CopyVendor();
copyvendor.SendPrintJobInformation(Convert.ToInt32(txtData.Text), 25.93);
All this code does, is call the component. Do you have a non .NET version of the component ? If so, it's trivial, if not, you need to use .NET.
AntonioRamirezL wrote: catch (Exception ex)
{
string temp = ex.Message;
}
C++ has exceptions, but not exception objects.
At the end of the day, this is boilerplate forms code, which calls a black box. Either you have that black box visible to C++, or you don't.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you for your answer it was very helpful. Now I understand that I can convert almost all the code but this line is the difficult one
using Copy_Vendor.API;
I already have a Copy_Vendor.API.dll I'm not sure but I think it was written in c# no header file is provided (.h)and I thought I should use import. Don't you have any idea on how to convert this line to VC++?
Regards
Antonio
|
|
|
|
|
using namespace Copy_Vendor.API;
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to C++/CLI Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
How would I, make a picture show up in the buttom right corner and allow me to click/hold and move it anywhere and it will drop back down to the status bar and walk back to the bottom right corner?
I'm not very good at coding. I've only been looking and learning for the last few days off of here.
Also, how would i add in a initialize program code?
What i mean by that is; A code that when i click the button it will open the correct program i list to it.
For Example: The button says 'Enternet' I'd like when i click it, it will open Enternet Explorer for me.
Any help would be appreciated.
|
|
|
|
|
C# Beginner Nick wrote: Forum C#
Subject: Re: How do i....
Sender: C# Beginner Nick
Date: 21:17 3 Oct '07
How would I, make a picture show up in the buttom right corner and allow me to click/hold and move it anywhere and it will drop back down to the status bar and walk back to the bottom right corner?
I'm not very good at coding. I've only been looking and learning for the last few days off of here.
Also, how would i add in a initialize program code?
What i mean by that is; A code that when i click the button it will open the correct program i list to it.
For Example: The button says 'Enternet' I'd like when i click it, it will open Enternet Explorer for me.
Any help would be appreciated.
Honestly, I'd encourage you to work through a C# book's exercises first if you are just starting out. Spend some quality time with Visual Studio (Express Edition is fine) and read lots and write lots of code.
It is unclear to me what you are trying to accomplish, but I think you'll be much more successful if you start out learning the language and working through some exercises. It might seem "boring" or "a waste of time", but it isn't, really.
Good Luck!
TODO: Find a witty quote by someone famous to put here.
|
|
|
|
|
Alright, and i have been. I've been studying at http://www.cprogramming.com for the last 3 or 4 weeks and looking at everyone's codes here to learn other commands.
What i am trying to accomplish is making a little Desktop Buddy that walks around and allows me to right click him and open certain programs that i use alot.
But thanks for the tip and I'll keep on doing that. The excersices at cprogramming.com do not cover what I need to learn, Some of the things i needed to learn I found in the last program I had looked at This.Close I couldn't figure out how to close my program until last night while studying someone else's codes.
The Online help feature of Express Edition doesn't help much either when I type in key words it does almost the opposite of what I need.
Thanks again and I will continue studying and codeing.
-- modified at 7:01 Thursday 4th October, 2007
|
|
|
|
|
Well, to start another app is easy.
using System.Diagnostics;
...
...
Process.Start(@"C:\WINDOWS\system32\notepad.exe");
That, amazingly, would start up notepad. You can also pass an internet address, and it will open the default browser to that address.
|
|
|
|
|
Hi,
I have some simple class (in C# ) that create and start ( by call ShowWindows() method ) some Form.
In creating and showing this Form i want to set the Focus to him - but no matter what i do i cant do it (!! !)
The simple C# class is call and create in/from some C++ class that call the C# by using Com Interop.
Someone can help me please ?
Thanks.
|
|
|
|
|
As this is not a general problem but a problem that is specific to the code that you have written, nobody can help you without seeing any of that code.
---
single minded; short sighted; long gone;
|
|
|
|
|
The code :
MyForm fw = new MyForm();
fw.ShowWindow();
=================================
I want to have focus on the Form fw when calling ShowWindow method.
|
|
|
|
|
use
ME.Activate
in form_load of the form you are showing
|
|
|
|
|
Considering Me is not a valid reference in C#, this code will not do anything but throw an error at compile-time.
|
|
|
|
|
get files from specif directory that sort by filename (DESC) ?
|
|
|
|
|
DirectoryInfo dir = new DirectoryInfo(@"c:\");
FileInfo[] files = dir.GetFiles();
Array.Reverse(files);
foreach(FileInfo file in files)
{
Console.WriteLine(file.Name);
}
Console.ReadLine();
|
|
|
|
|
Hi,
AFAIK the order of the files returned by GetFiles() depends on the underlying file system;
NTFS would sort alphabetically, FAT/FAT32 would not.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I didn't realize that FAT/FAT32 weren't ordered. My bad.
Implement a IComparer class then. You can change the compare method to sort however you want, by date if you wanted. Maybe even pass in an Enum of sort options.
using System;
using System.Collections;
using System.IO;
public class CompareFileInfo : IComparer
{
int IComparer.Compare(object first, object second)
{
FileInfo file1 = (FileInfo)first;
FileInfo file2 = (FileInfo)second;
return string.Compare(file1.Name, file2.Name);
}
}
public class MyClass
{
public static void Main()
{
DirectoryInfo dir = new DirectoryInfo(@"c:\");
FileInfo[] files = dir.GetFiles();
Array.Sort(files, new CompareFileInfo());
Array.Reverse(files);
foreach(FileInfo file in files)
{
Console.WriteLine(file.Name);
}
}
}
|
|
|
|
|
Use the following line of code to get list of files.
string[] files = Directory.GetFiles(@"C:\docs");
now iterate in your own fashion to descending order.
Balaji
|
|
|
|
|
Hi,
I have a table "Inventory" that has ID, ItemNumber, Description etc fields and the user can edit these via a datagrid.
The ItemNumber is also used in another table "SalesHistory".
What I want to do is update the ItemNumber in "SalesHistory" once the user has elected to do so before saving the ItemNumber change in the "Inventory" table to the database.
The problem I am having is determining the "old" value so I can update the "SalesHistory" table.
I don't want to call the database again to find the old value by matching ID's but it seems I have no alternative.
Suggestions please ...
Glen Harvy
|
|
|
|