|
Dear Addy Tas,
Thanks for your reply.
Yes, CLR setting is checked.
But now I found out that it's happening only in some CLI/C++ projects. In other CLI/C++ projects, the load event is fired.
So now I'm trying to pin-point what's wrong with those projects, but still can't get a clue though I spent so many days on it. The projects are actually UserControl projects and we have another function to call such as Init() after creating the control. If I can't pin-point why it's happening, I'm thinking I will move the code lines from the Load-event to that Init() function.
Regards,
Zaw Min Tun
|
|
|
|
|
Hi,
An easy way to find out where it goes wrong is to add console.writeline as spcific places and see if it got there. Than slowly work your way to the line that is giving you problems. Either you find out why you have the issue or just move it to the init method.
Good luck, AT
Cogito ergo sum
|
|
|
|
|
What is Difference b/w layered and tier architecture. Describe related to .net architecture.
|
|
|
|
|
Although you may see these two terms used to refer to each other, there is a real difference between tiered an layered components. Tiered components indicates that there is a physical separation, such as in different assemblies on the same or different servers. Layered architecture refers to logically separating components, so (for instance) you have a data layer, business layer and data access layer. This does not mean that you need to create a separate assembly for layered architecture (although this is common - and means that it works closely with tiered architecture). So, as you can see, tiered architecture refers to the physical separation and the layered architecture refers to the logical separation as a result of a design phase.
In practical terms, tiered architecture is common in enterprise style developments, and this may not suit a small utility application developed at home - but a layered architecture could help here as well.
I have to say that this sounds like an interview question to me - I leave it to you to actually understand what I just typed in, and figure out how it relates to .NET. At least that way, it will demonstrate that you have comprehended the differences.
|
|
|
|
|
Thanks a lot
|
|
|
|
|
No problem. Glad to help.
|
|
|
|
|
Hi to all,
I have a scenario: We have a functionality in which we are sending mails through outlook. Now in control panel we do have an option to choose profile(from which profile mail will be sent.).
We can select the option "Prompt for a profile to be used".
My question is: Can we check that the user has selected the above option or not through coding?
cheers,
sneha
|
|
|
|
|
Probably. Make a snapshot of the registry, toggle the setting, make another snapshot and compare the two. There are some tools like RegShot[^] available on the internet that could help there.
Bastard Programmer from Hell
|
|
|
|
|
Hello,
What i have is: short[],byte[] arrays.
Those arrays hold the raw data of a monochrome image(8-bit or 16-bit).
I want to create TIFF files using those arrays,how can i do this?
Thanks
|
|
|
|
|
Ouch. This is a large task. Effectively you are going to have to recreate your array following the TIFF standards, and create a TIFF format file. This is not an easy task, and will require you to recreate the TIFF format on your own.
|
|
|
|
|
There is a constructor Bitmap(Int32, Int32, Int32, PixelFormat, IntPtr) , where the last parameter points to an array of pixel data in one of the known formats, so if your image data is just pixels (akin a bmp file), you could create a Bitmap , then Save it in the format of your choice. Make sure to read the remarks in MSDN!
|
|
|
|
|
I have a .NET 1.1 C# windows application that needs to pass an ADO.NET dataset object to a .NET 3.5 web service.
When I run it I get an unhandled XML Exception occuring in system.xml.dll. System Error.
I suspect that it is due to the difference in .NET frameworks between the windows app and the web service, but I could be mistaken.
Is anyone able to shed any light on this most horrible of problems?
|
|
|
|
|
Hi All,
I've been looking into AOP lately for a project and was wondering what the general consensus was in .NET land on this issue?
There are a few different approaches to this one can take, seems that the "pure" idea of AOP is performing compiler weaving with tools such as PoitSharp. However there isn't any budget for things like this so I started looking at LinFu which uses Cecil from the Mono project.
Having not implemented this before I'm interested in getting some info on real world experiences.
What kind of issues do we face in terms of debugging for instance? Also I wondering what the performance hits are like when using lots of proxies etc ...
Cheers,
Jammer
|
|
|
|
|
Hello everyone. First i want to say sorry for my possible mistakes expressing my self because my english is reduce. But i will try to make my self clear enough and misspellings.
Introduction: I'm using LINQ to make queries against database. I built a abstract BusinessBase class where i built the basic operations (CRUD)as generic methods and they will be inherited by others classes that may want to insert, Update,delete an entity or Get a collection with all entities, of a specific type, from a database. But, as iwant get an entity by its IDs, for all entities, i want to include the BusinessBase class the method that allow me to do that.
What i want to know is: there is any way to embed SQL syntax in a linq querie, becasue the properties that are keys are diferent in names and numbers from entity to entity. Something like that:
public TEntity GetEntityByIDs("Employees"(*),[("id1",value1),("id2",value2)]){
var query = from e in dbContext.GenericNameEntitiesCollection(**)
(using T-SQL)"WHERE id1(***) = value1(****) AND id2(***)=value2(****)"
select e
}
(*) the name of the property that gets the ObjectSet with the entities
(**) public ObjectSet<employee> Employees
(***) names of the fields table at the database
(****)the correspondent values at the database
|
|
|
|
|
Hello,
Im using vs2010 .NET 4.
Ive created a new WPF projects that uses assembley created in .NET 2.
When i tried to compile i got the next error:
"Mixed mode assembley is built against version v2.0.50727 of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information".
After googling i found the solution af adding those line to the app.config:
<startup useLegacyV2RuntimeActivationPolicy = "true">
<supportedRuntime version = "4.0" sku = ".NETFramework,Version
=v4.0"/>
/startup>
But the error still present.
Can any one help?
Thanks.
modified 21-Nov-11 3:33am.
|
|
|
|
|
Add the following code, it should work properly
<startup uselegacyv2runtimeactivationpolicy="true"> <supportedruntime version="v4.0"> <requiredruntime version="v4.0.20506">
I have tried it.
|
|
|
|
|
What code?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
|
Hi,
1.
there is no unboxing, and no run-time penalty, if one of your methods is declared as returning IEnumerable<string> and actually returns a List<string> or a string[]. The compiler has checked each return statement returns the promised type, and they do as both List and Array are implementing IEnumerable, so all interface members are available as is.
2.
AFAIK ToList() creates a new List. IMO most ToSomeThing() methods create a new object, the one exception I know of is the meaningless string.ToString()
|
|
|
|
|
Luc Pattyn wrote: is the meaningless string.ToString()
For being meaningless it sure is used quite often
No comment
modified 21-Nov-11 21:00pm.
|
|
|
|
|
Mark Nischalke wrote: For being meaningless I sure it used quite often
It sure is.
|
|
|
|
|
|
when a method promises to return an IEnumerable, then it can actually return a List, an Array, a StringCollection, ..., as they each implement (hence ARE) IEnumerables. IEnumerables is just a more vague description of a pretty specific object which could be a List, an Array, etc. There is no conversion, no "new object" at all.
Collin Jasnoch wrote: why not just use List<T> or arrays for your return type?
I see at least two reasons why it could make sense:
1. you want to return something that the caller can perform only some operations on; when you return a List as an IEnumerable, the caller can enumerate the items in the list, and change those items, however he can't change the list itself. That is encapsulation.
2. assuming all that is required by the caller is IEnumerable, why offer him more? As a provider of the callee, you could change your implementation (say from arrays to lists), and still return the object as an IEnumerable, the caller wouldn't notice. And sometimes, you might return either an array or a List, using different return statements in your one implementation.
Example:
Since .NET 1.0 (when no generics existed) Directory.GetFiles has been defined as returning an array, which is expensive promise: while collecting the data, they don't know yet how many items will be present, so they must count first, allocate an array, stuff it, and then return it. Had it been declared returning an IEnumerable from day one, the current implementation could have taken full advantage of a generic list.
|
|
|
|
|
|