|
Heh, I guess we did get distracted from the original question there - sorry.
I guess the correct answer is, that depends. What do you mean by 'loading the assembly'. You can certainly force assemblies to be loaded manually whenever you want via System.Reflection.Assembly.Load(AssemblyName), you could have a bunch of those at the top of your Main().
Whether this really gives the effect you want is unclear though. This will cause the assembly to be mapped and the metadata parsed, but nothing will be JITed, that still happens on a mostly per method basis.
As an aside, here is the blog entry[^] I mentioned earlier about ngen.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi!
That gives me some hint. However, since you say nothing will be JIT'ed, it won't work for me. I have thought about adding a dummy shared method to all my classes and call them one after the other. Will the whole assembly get JIT'ed or only the dummy method will be compiled?
Thanks!
Carl
|
|
|
|
|
Even in your initially executing assembly methods are JITed on demand. Calling one method in an assembly does not force the rest to be JITed.
I suspect you are chasing a bit of a phantom here - how do you actually know that forcing your assemblies to be loaded and compiled at process creation is actually what you want? Like all performance matters, the only answer is to measure - guessing what will improve performance without profiling is extremely prone to error.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Dear All,
I wanted to know whether there is a way to solve this problem or not?
The problem is as I describe it here:
There is already a program written and it has to access a directory which the user working with this program does not have access. I know how to set an impersonation context in a program I (I mean I) am writing. But the problem here is that this program is already written and compiled and I do not have access to source files to add this impersonation solution to the source code. So I need a way to change the user which is logged in toa user that has access to that folder and run the program in a way that impersontion context is copied for that program so this program can use iot to access the folder.
Please help me through this problem.
Thanx Alot
|
|
|
|
|
Sounds like P/Invoke time. Read up on LogonUser and CreateProcessAsUser on MSDN.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Or CreateProcessWithLogonW() which is easier.
Mazy
No sig. available now.
|
|
|
|
|
Good catch, assuming it doesn't need to run on NT4 - which one would hope is getting to be a safe assumption these days.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
According to MSDN both are the same except seconnd on one need W2K ot higher and it is easier to use.
Mazy
No sig. available now.
|
|
|
|
|
Hi,
Please look at the code and let me know the error !
System.Reflection.Assembly thisExe;
thisExe = System.Reflection.Assembly.GetExecutingAssembly();
string[] t = thisExe.GetManifestResourceNames();
foreach (string s in t)
{
System.IO.Stream str = thisExe.GetManifestResourceStream(s);
Console.WriteLine(str.GetType().ToString());
}
The result is :
"System.IO.__UnmanagedMemoryStream" for all resources.
Why ? Any suggestions ?
Paul
|
|
|
|
|
Hi,
i guess because you write out the type of the stream class, not of the content. stream.GetType() is not equal to stream content type.
.:[Greetz from Jerry Maguire]:.
|
|
|
|
|
Remoting client can subscribe to event supported by a Remotable object:
IncomingDelegate d = new IncomingDelegate(this.SomeHandler);
MyRemoteObj.evIncoming += d;
That's simple enough. But what if you want to subscribe to event on server side? Thanks.
norm
|
|
|
|
|
I believe you would have to switch roles and set up a remotable object on the client PC that would act as a server to the Server PC. (If that all makes sense )
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Hello everyone,
I am trying to make use of a datagrid loaded with data from a database. I have the datagrid displayed and filled with data, but I am having a problem with the double-click event and the keypress event. The datagrid will not pick up either one of those events unless the focus is on the Row Header all the way to the left of the row. I need to be able to double-click on a specific cell and use the data within that cell. The CellChanged event would work, but it does not need to occur on a single-click, only a double-click. Any ideas????????????????
Thanks,
Kendal
|
|
|
|
|
I have created a very simply Windows Service.
I know the service runs because the event view shows it runs and the service writes a short text file as extra proof it is running.
What I would like the service to do is called an old C++ FormView based application. So I haved coded a process call like this;
OnStart()
{
Process myProcess = Process.Start("C:\\TestDir\\TestProcess.exe");
}
The "TestProcess.exe" also runs, again it writes to a text file to prove it has run.
But the TestProcess (which is FormBased-FormView) displays no visible window. My question is- how can I see the Form of the TestProcess, is there a way to make it visible?
thanks
|
|
|
|
|
Services run on a different WindowStation from the interactive user. This is by design. You need to back up and reconsider your plan here - a service runs all the time, what would you expect to happen to that TestProcess GUI application as a user logs in and back out all while you service is still running?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Can you set COM+ attributes at runtime inside you code? Thanks.
norm
|
|
|
|
|
I complied unmanaged C++ code to .dll and call the method in .NET.
I have found that the memory of a pointer is freed more than one time. The block used for freeing memory is as under.
int *p;
p = memalloc(sizeof(int)*100);
...
if( p != NULL)
{
free(p);
p = NULL;
}
Even though it has been checked if p not equal to NULL while calling this code from .NET aware language the assertion is thrown by .NET run time!!! What should be done for this issue?
|
|
|
|
|
try using __nogc*
|
|
|
|
|
Posted a question a while ago:
"Is there some way to manipulate/store/use 256 bit int/float/long so that finally a calculator for those 256 bit values can be made?"
One suggestion was to divide that number into 2 decimals or 4 longs BUT I'm pretty much a newcomer so could anyone help me out some little more and tell me howwww exactly to divide that 256 bit input into those 2 128 bit decimals? I mean the problem facing me is this: I take a string input (readline) and then have to convert that to some numerical form to perform the mathe operations...but to do that I have to have some container, a datatype big enough to hold that converted 256 bit value first right?...so how do I know how and from where to break that converted string input into 2 decimals actually during conversion? I do hope I haven't muddled this up ...BUT anything possible plz? ...
Thanks beforehand for time and help...
|
|
|
|
|
|
I want to create an XML web service that allows a user to enter two U.S. addresses, and be able to obtain step-by-step driving directions.
At first I was hoping that Yahoo or Mapquest would have a web-based API that I can use, but I can't find any APIs for them. PLEASE let me know if they (or any other map sites) have these APIs.
So my second alternative is to find a free XML web service somewhere out there that can provide more or less the same functionality. That way, I can still create my custion XML web service, and have it call the 3rd party web service to do the job.
Microsoft's MapPoint.NET web service (http://www.microsoft.com/mappoint/webservice/default.mspx) would have been the perfect solution for me, but it's not free. I'm doing this for a school project and, as a student, I can't cough up what Microsoft is charging for using its MapPoint.NET service.
So, I would like to know if anyone knows of another map web service that is free. Thanks.
|
|
|
|
|
.Net use a stranger approach to pass data into event handler, all event handler has the same prototype:
void eventhandler(object sender, System.EventArgs e)
but there is no event-specific data contained in the EventArgs object, so how can i get event-specific data (such as X/Y in a mouse event)?
in my case, i wrote a event handler for the Click event of ListView, when user click on one of the subitem in the ListView, I want to know whick subitem is clicked.
any comments is welcome
|
|
|
|
|
ListViewItem Selected = MyListView.SelectedItem;
or, if you have multiple ListView's and they all use the same event handler
<br />
ListView MyListView = (ListView) sender;<br />
ListViewItem Selected = MyListView.SelectedItem;<br />
|
|
|
|
|
thanks, Wjousts
what i really want is the sub item be clicked
ListViewItem Selected = MyListView.SelectedItem;
this code will get the selected item, not sub item.
I have found an approach, send a WIN32 message LVM_GETSUBITEMRECT to the ListView window, it's work, but I think there must be some better way.
|
|
|
|
|
Wjousts wrote:
MyListView.SelectedItem
Sorry! Doesn't work. Use MyListView.FocusedItem instead.
|
|
|
|