|
When MS is talking about platforms, MS is talking about their own platforms, ie CE is a platform, so is 2K, so is XP, and so on.
One reason why the CLR (let Window forms alone for the moment) will never be cross-platform is that the .NET framework lacks a lot of useful and mandatory features we are used to with C++/MFC/... which in turn encourages C# developers to use what is called interop, a native bypass (which breaks cross-platform abilities).
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site. Support for development will ship at the same time as the Windows XP Service Pack 1 (SP1) release.
|
|
|
|
|
i am working on a graphics editing application in c#.
but when i wanna add a text area in some part of drawing, it seems impossible to embed WORD document or EXCEL document in it.
is it true? dotnet can't play a role as OLE container?
|
|
|
|
|
BTW, is there any method to get the aim to show RichText Style area with something you draw by programming?
I think if any one can show me how to make the richtext's background transparent will also help me a lot.
Thanks for your reading
|
|
|
|
|
There is a class in the System.Windows.Forms namespace which does this; it is called AxHost and is used for embedding ActiveX based controls.
But to quote MSDN: "You typically do not use the AxHost class directly. You can use the Windows Forms ActiveX Control Importer to generate the wrappers that extend AxHost. For more information, see Windows Forms ActiveX Control Importer (Aximp.exe)."
HTH,
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Thanks.
Yes, we can use ActiveX controls in the form of c#. By select the custom toolbox, you can pickup a lot of ocx and dll.
But how about the Document like WORD and EXCEL? I don't know how to cope with them.
|
|
|
|
|
Thanks.
Yes, we can use ActiveX controls in the form of c#. By select the custom toolbox, you can pickup a lot of ocx and dll.
But how about the Document like WORD and EXCEL? I don't know how to cope with them.
|
|
|
|
|
You've got a full working Excel sample in this directory : <vc7dir>\FrameworkSDK\Samples\Technologies\Interop\Applications\Office\Excel
Behind the wheels, you have to import the Excel typelibrary, which is either ...\Microsoft Office\Office\excel9.olb or ...\Microsoft Office\Office10\excel.exe
depending on the Excel version.
Then you can use the Excel object model as follows :
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Excel;
class AutoExcel {
public static int Main() {
Console.WriteLine ("Creating new Excel.Application");
Application app = new Application();
if (app == null) {
Console.WriteLine("ERROR: EXCEL couldn't be started!");
return 0;
}
Console.WriteLine ("Making application visible");
app.Visible = true;
Console.WriteLine ("Getting the workbooks collection");
Workbooks workbooks = app.Workbooks;
Console.WriteLine ("Adding a new workbook");
_Workbook workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet);
...
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site. Support for development will ship at the same time as the Windows XP Service Pack 1 (SP1) release.
|
|
|
|
|
Hi
I want to open a tab delimited file in Excel programatically, basically similating me double clicking it. Does anyone have a snippet on how to do this?
Thanx
|
|
|
|
|
System.Diagnostics.Process.Start("filename.xls");
This of course assumes Excel is installed.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Hi
Thanx, I guess I can do it that way if the file extension (*.tab) association has been made. Unfortunately, I cant assume that.
I was thinking of going thru COM but I'm not sure really. Maybe I must just read a a bit more.
|
|
|
|
|
Oh, huh.
The way I got around this in my program (.xctd -> .xml) was creatign a temporary .xml file and launching that with Process.Start . Dunno how that'd work for you, though.
If you're interested, here's my code for this, inside of the form or wherever:
private ArrayList tempFiles;
private string GetTempFilename(string extension)
{
string tempFilename = Path.GetTempFileName();
File.Move(tempFilename, tempFilename += ("." + extension));
this.tempFiles.Add(tempFilename);
return tempFilename;
}
private void MainForm_Closed(object sender, EventArgs e)
{
foreach(string tempFile in this.tempFiles)
{
File.Delete(tempFile);
}
}
It's not perfect, because the filename is temporary and therefore probably only suitable for restricted purposes.
Otherwise, if you know of any way to ensure that the temp files get cleaned up, I'd appreciate it. Right now, if the user doesn't close IE for my .xml files, they can't be deleted because they're in use.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
|
thz Stephane,
I looked at your other post b4 I even saw this one
StephaneRodriguez wrote:
You've got an Open command in the workbooks object.
Exactly what I was looking for , and stupidly overlooked
|
|
|
|
|
I want to write a windows control.How can I add a custom event handler to it?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
its very simple, first of all, you need to define a Delegate for the event, unless you want to use the EventArgs one. the code sample below shows it all.
public delegate void MyEvent(int SomeEventArgs);
public event MyEvent SomeEvent;
if (SomeEvent != null)
SomeEvent(m_theEventArgs);
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
hmmm,thanks.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
http://codeproject.com/dotnet/ntsecuritynet.asp[^]
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Did you use that library or you mean you have error in your code?I didn't have any problem with that library.What is your error?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have database access for a web service and I want to store config options like multiple database connection strings that an administrator can configure.
How do I do that?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Put a web.config file in the same directory as the web service and put a section in it that looks similar to this:
[Edit: Forgot the configuration tags ]
<configuration>
<appSettings>
<add key="settinga" value="valuea">
</appSettings>
</configuration> Then when you want to retrieve a value use the AppSettings property of the System.Configuration.ConfigurationSettings class just as you would a WinForms application.
for example:
string valuea = System.Configuration.ConfigurationSettings.AppSettings["settinga"];
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Thank you.
I am very new to using .NET and C#. When I made the app, I thought I would find this out later and hardcoded the values and then ran out of time.
It is a great relief that fellow guys at CodeProject always has the answers.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
i cannot find how to rename a file in c# can anyone help me out i would be glad for any urgent reply...
|
|
|
|
|
System.IO.File.Move("C:\\this.txt", "C:\\that.txt");
That will rename the file from this.txt to that.txt
David Stone
But Clinton wasn't a predictable, boring, aging, lying, eloquent, maintainer-of-the-status-quo. He was a predictable, boring-but-trying-to-look-hip, aging-and-fat-but-seemingly-oblivious-to-it, lying-but-in-sadly-blatant-ways, not-eloquent-but-trying-to-make-up-for-it-by-talking-even-more, bringer-in-of-scary-and-potentially-dangerous-new-policies. And there was also Al Gore. It just wasn't *right*.
Shog9
|
|
|
|