|
I already have a web applicaion and the webapplicaion has the .CS file. I am looking for a command to convert the .CS file to dll and reuse it to some other project.I am using VS 2005
Pavas
|
|
|
|
|
...you have to simply:
You have to insert a new Project inside you solution(class library type).
Then insert an existing item(c# file) inside this project.
Compile.
Add a reference in your app project, and use it!!
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|
|
Thanks!
Let me explain you in detail. Sorry for not detailing u the problem
I want to create a seprate project. Ourside the solution. So there are two seprate projects [one is web project and other one is windows service].
This Web project uses a connection class. Now is it possible to reuse the same connection class with out creating a coppy of .cs file.
Pavas
|
|
|
|
|
Dagnamit it - two people have told you now. You need to create a new project and move the code into that project. It needs to be a class library. That's how you create a dll. You need to move code into the dll, for it to be there, quite plainly. If you don't create a copy of the file, how can you hope to create a dll ? You'd then remove the copy from your project, as it will get the class from the dll.
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 )
|
|
|
|
|
here here, flame away!
|
|
|
|
|
I was thinking to convert a single file to dll using as below:
csc /target:library /out:CONNECTION.DLL app_code\Connection.cs
Shure creating a class library is the best Idea. I agree. Thank you
Pavas
|
|
|
|
|
The detail was fine (again), I simply do not believe you are reading the answers, which in turn suggest to me that you have never read a reference manual in your life!
|
|
|
|
|
|
Any ways thnaks for suggestion!
Pavas
|
|
|
|
|
Hi All,
I have 2 project in my solution - the first is something old that was wrote in C++ and the other is something new that i writing in C#.
In the C++ project - i have some big file ( h file ( header )) that contain some struct, enum, define ... and more const Return code.
What i want to do is to use those information somehow.
How can i do it ? i don't want to write all those information as new information by myself again - i want to use the exist info...
Thanks for any help.
|
|
|
|
|
You really can't. You can build your header file as a managed C++ dll, and import it, that would work. However, you can't just use it in yuor project, how could you ?
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 )
|
|
|
|
|
In general -
What i need to do in this case ?
I can use manages C++ code - but there is some example of how i can do it ?
|
|
|
|
|
MAke your header build into a dll and set the /clr option. Then you can import this dll into your C# project.
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 )
|
|
|
|
|
|
Hi,
I want to implement JPEG loseless and lossy compression. Can anyone please help me.
Darmi
|
|
|
|
|
There are many 'JPEG' compressions. The most common one is the lossy one supported by GDI+. Creating files using this compression in C# is trivial. There are also a number of 'lossless' compressions, including JPEG 2000, JPEG lossless, etc. For JPEG 2000, I use the Atalasoft imaging library ( the J2000 stuff is an add on, and not cheap ). There are no free implimentations of J2000 that I know of, there is a JPEG lossless dll from HP, but I never actually got around to using it, I just found it in my search for a lossless compression supported by DICOM.
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 )
|
|
|
|
|
Thanks Christian Graus,
But i need the implementation in C# or the algorithm to implement this compression techniques.
Thanks,
Darmi
|
|
|
|
|
I see. Well, I want a Ferrarri. Doesn't mean I can have one. Like I said, there are no C# implimentations for JPEG lossless that I know of. JPEG 2000, there are definately no free implimentations. The cheapest I found was Atalasoft, it's about $2000 plus the cost of their core library. It's very good, I use it.
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 )
|
|
|
|
|
Image image;
...
Bitmap bmp = new Bitmap(image);
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo ici = null;
foreach(ImageCodecInfo codec in codecs) {
if(codec.MimeType == "image/jpeg")
ici = codec;
}
EncoderParameters ep = new EncoderParameters();
long quality = (long)100; // 0-lossy ... 100-loseless
ep.Param[0] = new EncoderParameter(Encoder.Quality, quality);
bmp.Save(fileName, ici, ep);
life is study!!!
|
|
|
|
|
No, you are totally wrong. Even at 100, a JPEG is lossy. It's just less so. And, as I said in my answer, there are many JPEG formats, including lossless ones. They are not supported by .NET, only the common lossy JPEG format is.
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 )
|
|
|
|
|
Christian Graus wrote: No, you are totally wrong
not totally I guess..
Christian Graus wrote: Even at 100, a JPEG is lossy
maybe, but a lot less lossy than Image.Save()
life is study!!!
|
|
|
|
|
Hai Seishin,
I have tried this method. But i read some documents indicating two different algorithms for implementing lossy and losseless - huffman algorithm.. something like this. If we can implement lossy and loseless in the above method, then why its said that there are two different algorithms for each. Morover, i came to know that JPEG is lossy itself, but loseless have different format other than .jpg. Am i correct? Please help me.
Darmi
|
|
|
|
|
This has been bugging me for a long time. Does anyone know how to, in an MSI, quit a process before running the installation? All I want to do is quit my application so it can be properly installed over rather than give an error to the user.
|
|
|
|
|
If any of the files that are in an MSI package are in use by any application, the Windows Installer automatically displays the Files In Use dialog box. This is automatically done in InstallValidate action:
http://msdn2.microsoft.com/en-us/library/aa369546.aspx[^]
Are you are not observing this behavior?
|
|
|
|
|
Oh I certainly am, however I want the installer to simply quit the running instance automatically, without prompting the user, or giving any kind of message.
There are a couple reasons I want this behavior: one being that in some cases, the installer will be launched by the application itself, as a self-update, and it seems rather dumb to have a self-updating application give an error to the user that the "file is in use". Secondly, the application is relaunched after install is complete anyway, and no information is lost by quitting.
I want the process to be seamless.
And quite frankly, I'm at a loss. What I originally thought was such a simple thing has turned out to be absurdly complicated, or at least I have yet to find a simple solution to it.
Perhaps I will investigate this InstallValidate action... is there any way to customize this behavior to run my own code at this step? Even if I could just launch another process to do the work...
|
|
|
|