|
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
|
|
|
|
|
Two ideas, check if there is an event for just before an something is changed (i know text boxes have it ) and do everything there (you can see what the new value is from the eventargs).
Or make a custom control that inherits a datagrid, and if you can, override the part where items are updated.
Sorry if i'm a little vague, but im off to bed, up early tomorrow
|
|
|
|
|
There's no obvious event that I can find (eg cellEnter) so I can store the value before it's changed.
Goodnight and thanks for your suggestions
Glen Harvy
|
|
|
|
|
I've played around a while and tested and tried a BUNCH of stuff about an icon. I've made an icon and added it to the solution explorer. Then, how do I get the icon to show up? Please help, I've honestly been doing some things to get better and dusted off the Dummies book! I know this is an easy question for most, but it gives me trouble! Thanks in advance.
|
|
|
|
|
What do you want to do with the icon?
Paul Marfleet
|
|
|
|
|
Well, I want to make it appear in the form's corner, but when I set it in the code, it fails, and when I set it in the form designer, another paper-like image replaces my icon.
|
|
|
|
|
You should be able to set the icon in the Form designer by clicking the '...' button against the Icon property and browsing to your icon file.
Paul Marfleet
|
|
|
|