|
Hmm, learning a least one new word every day now. I like that.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
MarKus0 wrote: So, it's the OS that allocate space on the stack for the process?!
No, not entirely. The processor has a stack the is allocated on a per-thread basis. Ever here of the Stack Pointer? Read[^]
It's the processor that's stopping you from doing what you want, not the .NET Framework or the O/S.
|
|
|
|
|
Dave - don't let facts get in the way of our mocking him.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My bad! :-> Please, proceed. I love a good show!
|
|
|
|
|
Dave Kreskowiak wrote: It's the processor that's stopping you from doing what you want, not the .NET Framework or the O/S.
IMO that is not entirely true; this is how I see it:
- most processors don't support heaps at all, yet lots of OS need heaps, so these
get implemented by software;
- stack structures can be implemented by software (e.g. the Stack class in .NET);
- there (still) are processors that don't provide hardware support for a stack,
yet a stack-based language (and OS) can made to run on them; when they have say
a shadow register for PC (into which the PC gets copied upon CALL or INT), each
function must start saving the shadow PC on a software stack;
- alternatively, if the CPU offers stack support (i.e. pushes the PC to a memory
location thru a pointing register) and you don't like the way it works, you can
undo it by software, and keep track of program flow in some other way.
- IIRC Intel's IA432 architecture did not have real stack support, instead it
allocated nodes (on the heap!) that got linked back and forth, resulting in
a distributed structure with stack behavior.
So I would say most OS really want to have hardware supporting a stack, and
hence most chip vendors provide exactly that, but either one can choose to do it
differently (which they seldom do).
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I was speaking from the Intel/AMD perspective, which does support execution stacks.
Luc Pattyn wrote: - alternatively, if the CPU offers stack support (i.e. pushes the PC to a memory
location thru a pointing register) and you don't like the way it works, you can
undo it by software, and keep track of program flow in some other way.
I don't think he's up to the task of re-writing the O/S just yet!
|
|
|
|
|
Guys please answer this..Why value type instances are int stack?
M.Sendilkumar
|
|
|
|
|
I thought we answered this already.
Because access to it is much faster than allocating memory on the heap for it, handling the pointer math, copying the values back and forth between memory and a register. On the stack, all that happens to get/set the value is the stack pointer is moved.
|
|
|
|
|
MarKus0 wrote: but will it be possible?
No it won't. For the reasons Luc gave.
This is a fundamental principle of the way stacks work in computer programs, and it has been pretty much since the first tiem a computer programmer created a subroutine.
|
|
|
|
|
Hi, I found that code around. Is it possible with managed c++ extension create oblects on the stack????
Does anyone explaim me that? Is this below true? In positive case, what does CLR do to allocate bHeap and bStack (I mean the difference)?
thanks
<br />
value class classB {<br />
private:<br />
int value;<br />
<br />
};<br />
classeB^ bHeap = gcnew classeB();
classeB bStack;
|
|
|
|
|
MarKus0 wrote: what does CLR do to allocate bHeap and bStack (I mean the difference)?
Why not see for yourself. Why not compile the code then look at the compiled IL through ILDASM (comes with the .NET SDK) or with a tool such as Lutz Roeder's Reflector (a quick google away)
|
|
|
|
|
Hi.
We have donwloaded and installed SharePoint 2007 (MOSS) evaluation version on one of our servers.
I have a DEV machine with .NET Framework 2.0 and VS 2005 on it. What kind of other tools do I need in order to start creating cutom web parts for SharePoint 2007? Right now my VS 2005 doesn't have an option of Web Part project. I know I need to download something but not sure what and in what order. My DEV machine doesn't have SharePoint on it.
Thank you,
|
|
|
|
|
I worked on sharepoint nearly 2 yrs back for some time , what I can recall from that is " we need to add a DLL provided by Sharepoint.
|
|
|
|
|
Are you talking about Microsoft.SharePoint.Portal.dll?
Here are the steps I've done so far.
1. We have a server with MOSS (SharePoint 2007) installed.
2. I have a DEV machine with VS 2005 and .NET framework (2.0 and 3.0)
3. I've installed Microsoft SharePoint Services 3.0 on that DEV machine.
4. I've installed Visual Studio SharePoint Extensions, which gave me these nice icons to create WebPart and other SharePoint projects.
Is this the right way to go?
After all this installations I still didn't have Microsoft.SharePoint.Portal.dll on DEV machine so I've copied it from server where MOSS installed and added to the ISAPI directory where all other dlls are.
After doing that I was able to create webparts that I've wanted and drop them into bin directory on the server. Of course I've run into some security issues, which I've solved by modifying trust level in the web.config from minimum to medium. I know that there's a way to attach config file for each part you create I just don't know how to do that yet. If you have any references and/or examples, or maybe even books I can read please send them my way.
I really appreciate your response.
|
|
|
|
|
good that you were able to create the webparts. I think you get a lot of help material on MSDN.
amit
|
|
|
|
|
There's a lot of information and it's all other the place. Why can't they just put it all together for user who wants to do development. You know what I mean. Step to follow to make sure you have all in place for development. Web Parts work good. My boss was happy. I guess MS wants you to take bunch of courses instead of figuring it out on your own. Do you have any links/info I can use for SahrePoint development?
Thank you,
|
|
|
|
|
I have a tab control with 4 tabs in a pocket pc application. My problem is that when I add a tab control, it goes on the bottom by default, but I want it on the top. How do I do this? please help
Thanks
|
|
|
|
|
I had a similar issue with tab controls but not on a pocket pc.
The way I have got around tab control issues is not to use them.
What I do is create a series of buttons and code their colour to change depending on whether they are clicked or not. I also create a panel for each button and then make the panels visible/not visible as needed.
This has allowed me to have colour buttons etc and have more control over button size position.
It's a work-around.
I hope this helps.
Guy
You always pass failure on the way to success.
|
|
|
|
|
I want to programatically access the printer status (usually get by printing off a status page). How do you do that?
Greetz,
Hendrik
|
|
|
|
|
|
Hello all!!
I have written a program in c# which use System.Windows.Forms.Webbrowser class.
I do something like this:
System.Windows.Forms.HtmlElementCollection refcol= webbrowser1.document.window.Frames[0].Frames[0].GetEelmentsByTagName("A");
When I load the page from apache2 on my computer it works perfectly.
But when I load it from remote server an exception occurs. This is the Text of exception:
/////////////////////////////////////////////////////
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Windows.Forms.UnsafeNativeMethods.IHTMLWindow2.GetDocument()
at System.Windows.Forms.HtmlWindow.get_Document()
at My_Web.create_elementscollection() in C:\Documents and Settings\Vahagn\My Documents\Visual Studio 2005\Projects\OGAME\OGAME\Class1.cs:line 49
at OGAME.Form1.button5_Click(Object sender, EventArgs e) in C:\Documents and Settings\Vahagn\My Documents\Visual Studio 2005\Projects\OGAME\OGAME\Form1.cs:line 53
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
and bla-bla-bla...
////////////////////////////////////////////////////////////
I think the problem is in secutity level. Do you know how to grant require permissions to my application? Or, may be the problem is other....
It has to be some way to solve this problem. I am administrator and I have to be able to allow my program to do anything it wants.
I'm beginner in programming, so I ask to use as less therms as you can.
Thanks in advance.
You can do everything!
|
|
|
|
|
You have to adjust code access security settings.
.NET checks where your application is started and assigns a codegroup.
Local executables have "full trust" by default.
If you start your app from a UNC path it is in intranet zone.
If you start it from a IP Adress it is in internet zone.
By default intranet und internet zone have serveral restrictions.
try this:
Open a command prompt and type:
caspol -rsg <your assembly="">
you can see the codegroups your assembly belongs to.
caspol -rsp <your assembly="">
will show you which permissions are granted to your application.
If you have the .NET Framework SDK on the machine you can use the .NET configuration tool.
If you want your application to have always fulltrust you can do this:
a) sign your assemblies with a strong name and
add a codegroup with a strong name condition (you can use caspol)
b) sign your assemblies with a certificate and
add a codegroup with a publisher condition (you can use caspol)
|
|
|
|
|
It doesn't help. The same problem appears again. When I run program in debug mode (by pressing F5) debbuger says that exception throws from mscorlib.dll. May be this will help you to help me?
|
|
|
|
|
the caspol.exe is part of the sdk !
See <%windows%>\Microsoft.NET\Framework\v2.0.50727
Please try this !
|
|
|
|
|
Hello!
I am trying to write a simple application that monitors filesystem access, and denies access to specific folders. I know that there is a class named FileSystemWatcher, but it gives only monitoring abilities. Can I stop copying a file when I catch it?
Thanks in advance!
Have a nice day!
|
|
|
|