|
I had an issue recently in 2.0 that was fixed in service pack 1. I then found that 2.0 SP1 is bundled as part of 3.5 SP1 so if I was starting a new project I would not bother with anything lower than 3.5 SP1
If you want a widest potential audience for your application, it is probably best to stick to 2.0 however, as it is part of 3.0 and 3.5, and therefore will be on more machines than any other version.
The only versions worth upgrading from, and it is an upgrade not just recompile, is from 1.0 and 1.1. Even Microsoft are not supporting them much these days.
|
|
|
|
|
|
Hi,
1.
when you are creating a managed-code project (say an EXE file mainly consisting of C# code), then the only stuff you can "Add a Reference" is more managed code; unmanaged aka native code DLLs can be used through a technology known as P/Invoke; this does not rely on any "reference", Windows will locate those native code libraries just like it always has, by looking for them in a predefined set of folders (see the PATH environment variable).
2.
P/Invoke is pretty complex. I'm working on a little article series on the subject, part 1 of it is available here.
3.
There is an alternate route, where you would build a managed C++/CLI wrapper to the native code (using another "technology" known as "it just works"). Some are strongly in favor of that route, I'm not, as I'm not very active in C++ and don't want to rely on a third language to connect the two languages I do use most (C# and C).
|
|
|
|
|
Hi Luc
Thanks for your support.
I managed to get the FFT working as I found a P/invoke FFTW project I could "borrow" from.
I appreciate that you spend time writting your reply to me.
Will take a look at your article and try get familiar with P/Invoke.
Thanks again
Tom
|
|
|
|
|
Hi All,
I got a requirement to import and export the data from different databases, flat files, csv files and xml files. I am unable to decide whether I sould use typed datasets and SSIS for the same. This is first I am getting this kind decision making responsibility.
Can anybody give me any suggestions, or links to calculate the pros and cons of both methods. Any link or advice or anything will be helpfull. In this mean time I will google the this.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
Hey geniuses, it's me again. Google has failed me so I humbly come to you with a question about how .NET performs string comparisions.
A tiny bit of background, I'm reseaching how the use of string constants is better than hardcoding string literals (beyond good coding practice).
I wrote this code to check the various ways .NET handles strings.
string s = "howdy";
if (HELLO_W == "hello")
{
Console.WriteLine("condition 3");
}
And then checked the IDL with ildasm.exe
IL_0033: ldstr "howdy"
IL_0038: stloc.1
IL_0039: ldc.i4.0
IL_003a: stloc.2
IL_003b: nop
IL_003c: ldstr "condition 3"
IL_0041: call void [mscorlib]System.Console::WriteLine(string)
IL_0046: nop
So where is the string comparision? When I compare two ints, I see the comparision command "ceq".
As always, I appreciate your insights and am not afraid to kiss a little butt to get it.
|
|
|
|
|
If HELLO_W is a constant, then the result of the comparison is known at compile time and it will always be the same. I believe the compiler is smart enough to remove such unnecessary conditions...
You might get different IL code depending on the compiler settings (Release/Debug).
|
|
|
|
|
Yep, that was it. Thank you. Now I'm getting this.
IL_004a: call bool [mscorlib]System.String::op_Equality(string,string)
Rookie mistake.
|
|
|
|
|
|
Can't believe I am asking this, and I admit I am lazy right now... I just have not had the chance to look into it or test it yet today so I figured I would throw it out there and see what folks have to say...
By the way, I am interested in this even in non-dot-net based languages, but didn't want to cross post
When you fire up a list of threads are they always guaranteed to REALL fire up in the order that you start them in or could the scheduler for some reason decide to place one above another, keeping in mind that for my contrived example they all are the same code that is...
Just wondering if anyone has ever tried this and seen odd results, or at least results that made them go hmmm for a second... My assumption is hat the process of starting a thread is sync so they are always going to get started in the same order, no matter what goes on in the startup code of the thread procedure you are kicking off, but I honestly have not payed that close attention before and can't remember ever wondering\caring....
Just came to my head right now and figured I would ask....
|
|
|
|
|
Ray Cassick wrote: I am lazy right now
I'm not in a habit of answering lazy questions, I'll keep it short: nothing is guaranteed. A managed thread is as much as "a job that could be executed independently of other jobs within the same process", which means it needs synchronization if other threads are to produce data it needs or consume data it generates, and which also means it does not even have to map onto a "physical" thread. Yes, a new Thread instance may or may not imply a new thread (at least so says the doc, I haven't ever noticed any of this).
And unmanaged threads will be scheduled by the (Windows) kernel as it sees fit, based on CPU activity, thread readiness, thread priority, some fairness measures, and the like. And particularly in Windows with a minimum of guarantees. Starting a thread is like double-clicking an EXE file: it will eventually cause something to happen.
There clearly must be a more overall question, however you forgot to ask it I'm afraid.
|
|
|
|
|
It probably gets even crazier in .Net 3 and above as managed threads are generally serviced by a central threadPool, and you just get the next one to stick up it's hand and admit to not doing any work at the moment. It will then start when it is ready. If the pool is empty the framework just extends the pool, calls a party and a whole load more threads become available... Not unlike the highfliers of the hollywood party scene.
|
|
|
|
|
Did that actually happen in 3.0? I was under the impression 3.0 and 3.5 didn't change anything to what already existed in 2.0, it just added functionality. It would be more likely to hold true since 4.0 but I haven't observed (nor tested or analyzed) these aspects, I just have known all along it was going to happen someday, as it is in MSDN doc since day 1.
|
|
|
|
|
Depends.
3.0 introduced the ThreadPool but you could still do it the same old way if you wanted. Not sure about 4.0.
|
|
|
|
|
Threads can be expected to start and threads can be expected to stop(maybe). All other assumptions are not thread safe.
|
|
|
|
|
Yeah, I figured... and honestly I am not surprised, especially now days with the progression from simple clock allocation over to physical core style allocation.
Just makes me wonder if REAL multi-threading, outside of the typical ‘I just want to be able to do a few things at a time to help increase efficiency’ is really used today except for some very time-critical systems.
|
|
|
|
|
.NET 3.5
At loading of the map of a TIFF-file compressed by a JPEG algorithm in class Bitmap according to a code:
<br />
string sFileName = "C:\Test.tif"; <br />
FileStream m_WorkFileStream = new FileStream (sFileName, FileMode. Open, FileAccess. Read, FileShare. ReadWrite | FileShare. Delete); <br />
Bitmap m_pBitMap = new Bitmap (m_WorkFileStream);<br />
There is an elimination on the last line «Parameter is not valid». How it is necessary to load the map from a TIFF-file contracted by a JPEG-compression?
File example on http://ifolder.ru/19301311
|
|
|
|
|
GDI+ doesn't support JPEG compressed (LZW) TIFF files.
You'll have to use a third party library to handles images of this type.
|
|
|
|
|
Hi. I'm using an embed windows media player in a windows form in vb.net.
The Media Player has the uiMode = none. The Media Player Control has a fixede size of width = 480 and height =320
The videos plays fine, but when i pause a video(with a button of my form) the windows media player change its size without any reason. it happens sometimes when the video starts too. Does Anybody know why this is happening and how can i fix it?.
Please forgive my english. I need help. Any suggestions or article you know about this topic.
Thanks.
|
|
|
|
|
For a side project I am working on, I want to write a layout engine for a very simplified, light-weight mark-up language that will be used for writing hypernovels, also known as interactive fiction (read a page, click on one of the links on the page, and follow the story depending on where the link leads.) For flexibility, I would rather try and write my own engine rather than rely on HTML or XSL transformation.
The mark-up of the page text has <p> , <strong> , <em> and <hr/> tags, which work just like HTML. I am also adding a <high> (highlight) tag which will normally underline text, and a <link> tag to replace the HTML <a> tag (to avoid confusion over very different attributes.) Right now, I am only interested in finding a technique for doing the layout, but eventually the reader will be able to set preferences such as font family, font size and color.
The approach I am working on now is to parse the text into blocks with various rendering styles, use DrawString to write the blocks onto a custom control out one by one, then make a note as to the location of where the last block ended to be the starting location of the next block. The pages would be pre-validated before the book file is created, so I don't need to worry about missing or misaligned tags.
I have tracked down some open source materials, such as the Gecko engine used in Firefox. Unfortunately, the source code has all been complete browser implementations, and I don't really have the time to go through and try to separate the layout engine from JavaScript support, managing plug-ins and gracefully handling cantankerous web servers that have been running for 20 years. What can I say, I'm lazy like that.
Any suggestions as to technique, books, web sites, etc. that present the theory and practice of laying out and rendering marked-up text would be much appreciated. I have a strong preference for VB.Net or C# code, but anything that I can translate into .Net will be welcome, as would materials discussing the theory without the practice.
|
|
|
|
|
Gregory.Gadow wrote: use DrawString to write the blocks onto a custom control out one by one
I would try a RichTextBox first -- Gregory.Gadow wrote: I'm lazy like that
|
|
|
|
|
I have considered using a RichTextBox , but I figured that would mean translating the page into RTF first, which paints me into a corner I would rather avoid.
|
|
|
|
|
Creating an HTML document and feeding it to a WebBrowser would be easier than creating RTF.
|
|
|
|
|
That may be what I end up doing. I was particularly keen on creating a custom link tag; if I write the project in HTML then I will have to have each and every page -- potentially hundreds of them for a full novel -- as separate page files, and managing the network of links becomes unwieldy. My own mark-up would let me design a tag that could pull a page out of a compiled data store, and other tags to efficiently encode meta-data.
|
|
|
|
|
You could have virtual HTML pages by using an embedded web server; in such scheme your browser gets a page from the built-in server, which does whatever it takes to generate the HTML page on the spot; there is no need to have all the HTML pages ready beforehand.
I've done this, based on the ideas from a CodeProject article, unfortunately the link does no longer work: http://www.codeproject.com/KB/IP/CSHTTPServer.asxp[^]. Search for embedded HTTP server I'd say.
|
|
|
|
|