|
Hi all, I was wondering if anyone out there had tried using .NET objects from a pre-.NET scripting environment (I want to use Windows Script hosted JScript). I'm sure it is possible through COM interop, but can anyone tell me of an article or web page to get this running quickly and easily?
Thanks for any suggestions,
Nick
|
|
|
|
|
You can call a .NET component from the outside world. That's done through CCW, COM Callable wrapper, which is by the way the keyword to use to find articles on Cp, MSDN, ...
The procedure is as follows :
- write a component using C#, or whatever .NET language you can think of
- register the component to the unmanaged world using the regasm.exe cmdline. Doing so, this component looks like a standard COM component, except the fact that the InProcServer32/LocalServer32 registry key points to mscoree.dll instead (that's the CLR entry point).
- use JScript to create an instance of this object. Here is how you create COM instances :
var ExcelSheet;
ExcelApp = new ActiveXObject("Excel.Application");
ExcelSheet = new ActiveXObject("Excel.Sheet");
ExcelSheet.Application.Visible = true;
ExcelSheet.ActiveSheet.Cells(1,1).Value = "This is column A, row 1";
ExcelSheet.SaveAs("C:\\TEST.XLS");
ExcelSheet.Application.Quit();
A useful link[^] on MSDN.
|
|
|
|
|
Thanks, I looked around for a while but unless you know a couple of 'magic keywords' like CCW its pretty hard to search for anything containing .NET and JScript. Thanks again, there are a world of cool possibilities for this stuff
|
|
|
|
|
Does anyone know if there are .Net file exists/delete methods that will handle wildcards? File.Exist and File.Delete do not. Thankyou!!
Lorne
|
|
|
|
|
|
Hello,
I've got a C# windows app and I'd like to keep the resources in a centralized place so I've added a resx file to my project where I store all my english strings. This is I guess what they call an embedded resource. My question is, can I add another resx file to hold my german strings and embed it into the same assembly? If so, can anyone pls outline how to do that?
Thanks in advance. Any help is highly appreceated.
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
Matthias Steinbart wrote:
embed it into the same assembly
Although it's probably doable, I don't recommend it. It's part of the usefulness of assemblies to have a culture attached to them (AssemblyInfo.cs file). Typically you provide an assembly for each supported culture, and doing so the run-time automatically loads the appropriate assembly. This saves you time, effort, plumbering, and... bugs.
|
|
|
|
|
Hi all,
What is the easiest way to tell if a computer has the .NET Framework installed? The more non-technical the better. Is it the same for each OS or are there different methods?
Thanks in advance
Andy
|
|
|
|
|
presence of <winsysdir>mscoree.dll (the entry point of the CLR).
Also read the registry to check out the current version (HKLM\Software\Microsoft\.NETframework).
|
|
|
|
|
Hi ,
I can't run ASP.NET Applications or SOAP apps on my PC.
I have WIN2K PRO SP3 w/ IIS installed ..
Here is the error msg I get when i run my apps ..
Compiler Error Message: CS0013: Unexpected error writing metadata to file 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\webapplication2222\df162b42\f1bc067\tvjmw6ty.dll' -- 'The directory name is invalid. '
( It looks like a file not a directory name .. ) .. ??
ANYONE ???
|
|
|
|
|
See if you have both C: free diskspace and if the ASPNET user have writing rights on the specified folder.
Other thing you could try is see if the directory C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files exists.
The 3rd thing to try is running C:\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_regiis.exe
The last thing to try is suicide
I see dumb people
|
|
|
|
|
Tried all those things: nothing worked.
Even tried re-install .NET/VS.NET ..Didn't work..
Re-install IIS .. didn't work ..
Any other ideas ???
I'm wondering if its because my system is UP TO DATE ..
mmmmmm
|
|
|
|
|
I got it fixed... Even a re-install won't fix it..
What you have to do is go to control Panel, Select Add/Remove Programs and when the .NET screen comes up select REPAIR and that will work. Apparently it forces the regirstration of some DLLs or something ..
But it is funny that a re-install doesn't work ..
hehe .
thks .
Dato .
|
|
|
|
|
Hi,
I have installed .NET Beta 2, version v.1.0.2914 on my computer.
Trying to UnInstall the .Net raises an error "Setup cannot read/write to System Registry".
I want to install an SDK framework and I need to uninstal first the above but cannot.
Can you help me here?
Thanks
|
|
|
|
|
garfild wrote:
I have installed .NET Beta 2, version v.1.0.2914 on my computer.
Trying to UnInstall the .Net raises an error "Setup cannot read/write to System Registry".
I want to install an SDK framework and I need to uninstal first the above but cannot.
Can you help me here?
We had a problem at work with either beta 1 or 2, I can't remember. It was just on a test machine so we wiped it clean and did the re-install.
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
I have only been looking at the articles posted for .NET for a short time. There are some very usefull articles and complete components. Does anyone have any comments or thoughts on starting a CodeProject namespace and bringing together the code into one place? This would reduce the possible duplication and help developers using the code........
Am I barking up the wrong tree?
|
|
|
|
|
|
I take your point .......but from small beginnings......?
|
|
|
|
|
That would be a cool idea if the code centered around one mega-application.
What sought of examples are you thinking of, Charlie?
namespace CodeProject.ArticleSection.ArticleShortName.Module ?
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
Simon,
I was thinking along the lines of mimicking the .NET runtime structure, MS have done all the hard work so why not copy it.....
CodeProject.System.Windows.Forms......
etc.....
I was looking for balloon code and there are 2 good examples (Peter Rilling, Rama Kirshna). There is one aspect to the code project of learning and the other of simply reusing code directly. I spent some time looking at each and wondered why not have a general namespace \ project that people can contribute to so to prevent duplication. Each ballon article has benefits but consumers of the code are left pondering....
The 'code project' .NET area could easily be a definitive runtime available to all.......
Your thoughts..?
Charlie
|
|
|
|
|
|
Definately the 'best of the best', thats my point exactly.....
A small community of Platinum / Golds members or maybe the editor could suggest a number of people to 'decide what would go in or not......'.
The code project site could have a dedicated area for managing the framework. The changes to the actual library would get votes / ammendments by the people above and
a quorum number would allow the code to become part of the library.
I don't know how other opensource projects work? Do you?
Charlie
|
|
|
|
|
|
The repository wouldn't be too bad. A simple start would be a discussion thread:
'CodeProject Framework'
and and an article containing the code. I'd put myself forward to manage the code side. Ofcourse having a namespace could mean that separate zones, ie strings, controls could be managed by different people. Code management is an arse but the benefits are great....
As to your other point, is there sarcasm present? I take you point though....There is one aspect to developing a public library.....lots of qudos when applying for jobs. If an applicant had that on his CV then it would almost guarentee him a job.
Creating a project would achieve the same thing as a library would evolve from that.
1) The application itslef.
2) A library of generic functions.
But what to do....?
Charlie
|
|
|
|
|