|
leppie wrote:
So those 2 are == ? If I write IL manually, can I write it either way then?
What triggered me to ask this , is that method overhead does add up, even though its only about 5ns a call, but call that 100,000 times and it makes sense to inline a method, if possible. It appears the JIT is NOT inlining small methods eg operater overloads. Is there a way to force this without having to manually edit the IL?
==? In theory, yes.
IIRC, the JIT inlines any method with less than 32 IL bytes.
One thing to notice is that the JIT can't inline a virtual method, because the proper method to call is only known at the time of the call, and can change from call to call. BTW, virtual method calls are very expensive.
If you need such degree of control, I suggest you that, before going into ILASM, try managed C++, at least for the critical part. It's not that beautiful, but you still have templates and some form of inline control.
And if the "inline" keyword doesn't help, you can always resort to macros
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
Daniel Turini wrote:
BTW, virtual method calls are very expensive.
I didnt spot that
The whole program will be ported to C (for CS) once I have finished it, so I will keep those things in mind. Maybe make some IL "macros" ?
Thanks for the help
PS: You know of any good (free) IL resources, besides SSCLI and the Tool Developer Guide?
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
PS: You know of any good (free) IL resources, besides SSCLI and the Tool Developer Guide?
Nope. Actually, I almost only use the good old compile, "let's see in ILDASM" and System.Reflection.Emit documentation.
The cordbg.exe, if you don't mind using a so beautiful interface, is a very good source for finding how the JIT is behaving. It's a bit hard, you need to know x86 ASM (it's not THAT different from IL), generate a Release version with debug info, and use "m JitOptimizations=1" to be sure that JIT will optimize code. Then, debug with that beautiful interface until you reach the call you need to check and use "dis" to see the native instructions.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
Daniel Turini wrote:
Then, debug with that beautiful interface until you reach the call you need to check and use "dis" to see the native instructions.
I tried that, and the debugger skipped the bp with JITOpt 1, so I assume it gets inlined.
Just one final question (I promise):
How does one view the contents of the evaluation stack?
<a TITLE="See my user info" href=http:
|
|
|
|
|
For a long time I've found it convenient to stick pictures I want to share with friends in the wwwroot folder and send a link, rather than sending the whole file to them. It's worked perfectly until now. It seems to have stopped working as soon as I installed the v1.1 Framework, and those who try to access even old content now get a 404 error or an access violation message. I can't even troubleshoot it myself because it works fine for me here. Paul Watson suggested a change to a setting in machine.config, processModel.user = SYSTEM instead of machine, but it didn't help. What else might need to be changed to restore the functionality of the server?
[EDIT]
Thanks to some judicious testing by Paul, the culprit was revealed to be the firewall, installed the same week as the Framework. I hate it when I can't even test things myself!!![/EDIT]
"Ask not for whom the bell tolls; It tolls for thee..."
|
|
|
|
|
hi there.
i want to write a control for comfortable scrolling on a touchscreen (in fact only two buttons up/down )
now i'm searching for the right method for scrolling the client-area up or down..
any idea?
thanks,
phil
|
|
|
|
|
I have System.Windows.Forms.Panel with scroll area
larger than the visible window of the panel and
AutoScroll property on the Panel element set to true.
I have placed few UI elements in the panel that are
outside the visible window of the panel, which needs to
be scrolled to be seen. By default these elements are set
to visible=false.
However, when I toggle the "Visible" property TRUE/FALSE
on the elements that are outside the Panel's visible
window area, the scrollbar provided by
System.Windows.Forms.Panel does show up but it
miscalculates and displaces
the elements in the panel arbitrarily. Did any one run
into this problem. Any workarounds?
Thanks in advance.
Best Regards
Ven
|
|
|
|
|
How do I take an arbitrary string and UTF8 encode it using System.Text.Encoding.UTF8? I found out how to write strings and how to convert byte data, but not how to convert strings. You'd think this would be easier; maybe I'm missing something.
(I'm using C# by the way).
|
|
|
|
|
Use Encoding class in System.Text namespace.
Basically to convert, you first set up encoding. Let's say you have a simple string that you named simpleS. Here is the code that would convert:
Encoding ascii = Encoding.ASCII;
Encoding utf8 = Encoding.UTF8;
byte[] simpleBytes = ascii.GetBytes(simpleS);
byte[] newbytes = Encoding.Encode(ascii, utf8, simpleBytes);
that's it. Key here is static Encode method provided by Encoding class. Once you have the new byte array, you can convert it to char array of utf8 encoded chars.
I hope this is of some help. MSDN documentation also has a very similar example and more stuff on this encoding. I know I used it for the project I worked some time ago.
|
|
|
|
|
the method of msdn can only used in the case that you exactly know which
version of framework installed in client machine.
But generally we are in this case that we build a application under
framework1.1 and we don't know the version of framework on client machine.So
it seems the only way that we can do is bet the version of client.My god!!!
I mean we can not let the same copy of 1.1 application run either on framework1.1 or on framework1.0.
Is that true??
lost my way
|
|
|
|
|
why don't you just install the 1.1 framework? The two frameworks will run side by side - the only issues I have come across is that 1.0 ASP.NET apps will have to cope wioth the new 1.1 security feature of not allowing tags (and other things) to be placed in element data. i.e "<a" typed="" in="" an="" edit="" box="" will="" throw="" error="" 1.1="" and="" 1.0="" if="" not="" handled="" or="" prepared="" for="" when="" is="" installed.=""
<p="" align="right">Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
I am sure a lot of you have come across .NET based portals such as IBuySpy and DotNetNuke.
Has anyone else come across other portals based on the .NET framework?
The only other one I have come across is PassagePortal (www.cubiccompass.com).
Any suggestions? And any suggestions to other portal frameworks written in say perl/php/asp/jsp etc
(I am sure there must be a few I have missed in my google searching)
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
Problem:
I have a really complex class library project that I am sure has an awful lot of redundant code (properties, methods, etc...) that are not used.
I want to be able to generate a report of which methods, properties etc of my object model's classes are referenced throughout the other dependant projects etc.
Question:
Is there an application, perhaps a VS.Net Add In that does this already? If not does anyone have any implementation suggestions before I spend the rest of today reinventing the wheel?
Ta muchly
JBoy
|
|
|
|
|
Has anyone used the Bitmapeditor/Imageeditor class in .NET? I looked at it this weekend and could not get it to do anything. My best guess is that you must call the "EditValue" method to run the thing, but that apparently requires having an IServiceProvider. How do you get one of those?
|
|
|
|
|
OK, I have basic and probably simple question for you guys...
Here is the situation:
Assuming:
1. I have WinForm Control ("UserControl1") sitting on HTML page, let's assume his name on HTML layout is "ctrl";
2. I have property of that control named "Object" that has set method;
3. My HTML script does the following:
ctrl.Object = ctrl
I'm setting Object property back to the value of "this" on the site of the control.
So, basically, i understand that .NET class through RCW get's converted to IDispatch and then this IDispatch (probably with new CCW) get's passed back to the control.
Now, it's not surprising that after that trip I'm getting
public object Object
{
set
{ m_object = value; <
}
at <> m_object of type "System.__ComObject"....
Now the question: Using what operation could I convert m_object from "System.__ComObject" to my original "UserControl1" type???!!!...
And if you tell me that this is impossible -- your hyped .NET Framework sucks!!!...LOL
Please, don't refference Marshal::CreateWrapperOfType -- cause id doesn't work...
Also, maybe you can give me an example on how I could enumerate WinForm controls on HTML page, from inside one of them and get native .NET classes for each of them -- maybe there is some method -- don't refference "Container" or "Parent" control properties, because they are both nulls (probably because IE is not managed container)...
Anyway, any answer maybe of help...
|
|
|
|
|
lets get this straight are you trying to manipulate a COM object that is hosted in the client browser from the server side code? if so - you can't (not directly but there is nothing stopping you adding javascript to manipulate the object). if not - then you'll have to make your clarify your question.
maybe by source code extracts
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
Server is not involved at all..
Simple, Container hosts WebBrowser -- now WebBrowser hosts .NET control -- container queries that WebBrowser for HTML content and get's IDispatch of that control from IHtmlElement...
Having that IDispatch now Container without any WebBrowser or HTML involvement can call methods on that .NET object... Right???...
If so, reverse should be true -- meaning that .NET object getting IDispatch of some other components should be capable of recognizing .NET controls having that IDispatch -- Right?... So, that was my original question...
BTW: I know an answer... Instead of using just ctr --> you must just use "ctrl.object"... So, script line will look like this:
ctrl.Object = ctrl.object --- hehehehe... UGLY!!!...
But seriously: All those .NET Gurus, are just GURUs in there own world!!!...
Yesterday I had pretty good dinner and at night when I was in a deep sleep, suddenly I waked up with a terrible pain in my stomach!!!... Did you ever have this???... So, while running to the bathroom and in there I suddenly realized -- I didn't have any "delegate" for that pain -- and I didn't created any "EventHandler" for it -- not to say that I was not planning to call the base class implementation (interesting, what would it be???LOL)... It just happened!!!...
Enough joking!!!...
So, my point is: You have a pointer which was Marshalled and UnMrashalled, and/or Split and Restored, and/or Divided/Multiplied.... Good system should be able to discover and restore it's Native Type... What is interesting --> that Marshalled IDispact supports IManagedObject even after RCW<->CCW... So, somebody was realy LAZY!!!... OK???!!!...
Regards to ALL MSFT GURUS!!!...
|
|
|
|
|
ah I see what you are trying to do now - does the object host the IDispatch interface? best way would be to see if you can manipulate it via javascript on any exposed methods / properties.
Now this is really a COM question not a .NET one - is it possible to cast the interface you get from the query of IHtmlElement castable (bad english I know) into a .NET object - Sorry but there is no guarantee of that as there is no guaranteee in C that an interface can be cast into the supporting object (proxies, tear off interfaces etc and the like)
Have you come across the samples that shows how to host a .NET control in a webbrowser? see the authpring custom controls at http://samples.gotdotnet.com/quickstart/aspplus/[^]. I can't remember if any of these uses javascript to manipulate the contents
I know this doesn't answer your question but it leads us on a road to find an answer.
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
"does the object host the IDispatch interface?" Man, you are probably one of those who got into the crowd of MSFT beleivers that CLR has nothing to do with COM!!!... Sure -- each object and type in CLR hosts IDispatch -- it's just hidden by implementation, but could be exposed at anytime...
From what you are writing I understand you are "language" guy -- casting or not casting -- that something what language allows you to do and not really how it's implemented and if implementation allows you to do that, even if language does not -- then there must be some "trick" to be performed...
As to my original question -- forget it -- I have found an aswer...
About sample -- listen: I'm not reading samples -- I'm usually writing them -- just very few I'm showing to the crowd...
My point was:
.NET is great and no question server site programming could be speed up and improved;
as to the client -- I'm not so sure...
Also:
I'm really pissed of by so many young ".NET GURUS" who invented CLR and who are so proud of themselves and etc... They are claiming that this is the best environment and etc, and so on.... While in reality: no questions they performed nice job in Object Data definition and implementation of endless number of namespaces and componentrs, while I would say very poor one and almost nothing in functional logic...
Just few examples:
1. During 11+ years of COM, standard property browser is not part of OS, however only after 2 years of .NET it is ==> confirms that they did a good job on implementation front, but very poor on COM -- Right???;
2. About poor functional logic: my previous message about stomach problem at night was not an accident -- those hyped "Delegates" -- this is just pure wrong -- Client Doesn't have to subscrive for an event at least on Programming level -- Even if he doesn't -- he still should be notified(1) -- and second -- Ideal Event implementation shouldn't require me as a programmer to write even 1 line of extra code, and of course shouldn't require me to "call base class, or things will not work"... As well as I shouldn't check for delegates to be not null -- and etc., etc., etc....
I'm not proposing any implementation here -- I'm just pointing the fact that CLR implementation is not the best...
3. Exposing WinForm Controls as an ActiveX Controls was dropped -- why???... Somebody was just LAZY -- you have reflection, so you can generate TypeLibrary on the fly -- they are saying that Each Event has different interface, therefore one [default, source] can't be generated -- wrong -- this is just implementation detail -- create an extra object that will advice real .NET component on all outgoing interfaces, collect them in one, create collective type library and send it back to subscriber as one source both for events and collected type library -- why this simple thing han't been done???...
Anyway: the real trouble is -- stupid middle and high level managers are planning to move there developments to new CLR platform -- that's fine for companies that are just starting new developments... This is absolutely stupid for owners of currently successfull client site unmanaged systems... Unfortunately only low level programmers understand this... But it's killing very good products...
Still waitingg for MSFT that is giving advices to those "stupid managers" --to see at least one container application like Excel and/or Word and/or IE written completely as managed!!!....
Any scenario is fine with me though... The more mess MSFT creates the more job for me...hehehehe...
Regards ;P;)
|
|
|
|
|
fine so - you found an answer - mind sharing it with us are you one of those take take take and never give back people
|
|
|
|
|
Anonymous, are you able to read????...
I thought I gave an answer:
>> Assuming:
1. I have WinForm Control ("UserControl1") sitting on HTML page, let's assume his name on HTML layout is "ctrl";
2. I have property of that control named "Object" that has set method;
3. My HTML script does the following:
ctrl.Object = ctrl <<<<====!!!!
I'm setting Object property back to the value of "this" on the site of the control......
<<
In my next message I gave an answer:
>>
You should use:
ctrl.Object = ctrl.object <=== Check "ctrl.object" here, instead of just "ctrl"...
Now:
"ctrl" is IHtmlObject wrapper created by IE around real .NET IDispatch, while:
"ctrl.object" is IDispatch of an Object itsel (doesn't have to be .NET BTW)...
As to me never giving back -- maybe... But I never take either... ;);P
|
|
|
|
|
Okay I see where you coming from but...
Originally you seemed to be accessing your code from .NET and now you seem to be to just doing it via javascript. Is this the case are you still trying to turn your IHTMLElement into the original object or are you just sticking with the exposed IDispatch
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
igor1960 wrote:
The more mess MSFT creates the more job for me...hehehehe...
Ok, you solved your own problem before the gurus. Sounds like you are more interested in showing others how smart you really are. Don't get me wrong, we need more people like you. If you post your code, ideas, observations, and criticism (of microsoft) as articles, it will be more interesting.
|
|
|
|
|
"Don't get me wrong, we need more people like you"...
And who the heck are YOU???!!!
Why do I need to criticise MSFT???!!! It's doing it's best providing me an my family with "bread and butter"!!!...
What I'm criticising -- middle and top level management of other companies, that are very fast in catching next hype in order to preserve there position in hierarchy -- those guys are really "empty" and the only reason for there existance is mess they are creating as well as the only ability to play golf and drink!!!...
As to technical issues -- .NET is great, except because it is so, it's pretty simple to implement simple tasks, while difficult to perform and/or have knowledge on how to implemet difficult/not ordinary ones...
That's it...
|
|
|
|
|
"And who the heck are YOU???!!!"
I am Anonymous101. If you think the name doesn't give enough information, I could change it to something like Anonymous1960.
"Why do I need to criticise MSFT???!!! It's doing it's best providing me an my family with "bread and butter"!!!...
What I'm criticising -- middle and top level management of other companies, that are very fast in catching next hype in order to preserve there position in hierarchy -- those guys are really "empty" and the only reason for there existance is mess they are creating as well as the only ability to play golf and drink!!!..."
Looking at the number of exclamation marks, it seems that you have more anger in your chest than a suicide bomber. Why? Let me guess, you think .NET has made programming too easy and therefore takes some of the privileges away to smart guys like you, right?
Either your confidence or your skill is overrated.
|
|
|
|
|