|
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...
|
|
|
|
|
Hey,
I am writing a program, and one of the functions of this program is to simulate holding down of two keys on the keyboard. I am not sure how to go about this. I don't think the sendkeys function is what I am looking for, because it only sends the keystroke, not holds it down. Is there any sort of way to do this?
|
|
|
|
|
Have you tried searching Google? A quick search found the answer for me. Please do more research next time before posting.
Hogan
|
|
|
|
|
|
no because if you can't answer a question like this, you don't deserve to get a position writing really bad C# code.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Come on dan - what was the original question? We're intrigued now...
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
He posted a sample code fragment that he'd been presented with in an interview and asked what the problems were with the class. The impression that came across was that he was in the interview at the time and had been given an internet connection. BTW - the mistakes were glaringly obvious; they weren't tricks and I would doubt the coding ability of anyone who didn't spot them. There were only a dozen lines of code after all, and he was told that there were 3 problems.
Deja View - the feeling that you've seen this post before.
|
|
|
|