|
I appreciate the tip. I am aware of the "using" syntax, but in my case that won't work. As I mentioned in my response to John Simmons's post above, my application is written in C++/CLI, which has no such construct. There were multiple reasons for that language choice, some of which I mentioned and others that are irrelevant to this conversation. And even if I was in C#/VB, I'd still have the same problem with the Menu control. Can't use "using" for something like a menu that has to be present for the duration of execution.
Regardless, I think it was one of Luc Pattyn's responses that directed me to try examining memory usage through the Environment.WorkingSet (thank's again, Luc). This provides memory use much closer to what I would expect based on my interaction with the application. I still find it alarming that the .NET virtual machine continues to eat up additional memory when it's not needed, but there I just have to trust that the GC will do its job when push comes to shove.
|
|
|
|
|
Hello. I hope these are some simple questions:
1. Is there a way to read an embedded resource out of a managed DLL without having to load the whole assembly?
2. If, as is my understaning, the answer to #1 is "NO", what is the point of embedding resources instead of loading your resources from individual files at run-time? In other words, if I have a DLL that contains 128MB of images, and I only want to extract a 64KB image from it, what is the point of embedding when I'd have to take the 128MB hit on my memory use -- especially when an assembly can't be unloaded?
Thanks for your input.
|
|
|
|
|
Hi,
AFAIK:
1. No
2a. You can make a single-file app that holds images, fonts, whatever.
2b. You can protect your data by putting it in as a resource (possibly using encryption).
2c. You can group things that belong together into a single DLL, have several of those
and load the one you need (e.g. language selection, regionalization)
2d. If you are that concerned about memory footprint, make smaller DLLs; at one resource
per DLL, it does not make much sense any more.
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
|
|
|
|
|
Good point. I had actually thought of the resource grouping as opposed to having a bundle of extra files. And I'm even OK with having to load the entire DLL to get a resource. It's the inability to unload the DLL that I don't like.
Maybe I'm still clinging to the old-school mentality of maximum memory conservation. I'm only 30 yrs old, but that still puts me at old enough to have had it beaten into my head in school about programming for minimal memory use and maximum efficiency.
Regardless, if I have data resources that need to be copied into memory for runtime manipulation, and the DLL can't be unloaded, well then I have two full copies of those resources resident in memory for the duration of execution. That seems wasteful, and that's what I can't stand about it.
|
|
|
|
|
If you really want to get rid of some DLL, load it in a separate AppDomain;
you can unload an AppDomain, which also frees all its code space.
There is a price to pay: you now have to communicate from one AppDomain to another.
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
|
|
|
|
|
Hi
i have a logging session which i use in the global.asax file which determines if the user is authenticated to the system
i ahve it working within reason
but if i try to access a page before logging in it will render page then will write my relogin page to the same page
I want it to redirect to this page relogin page if the user isn't authenticated on the system, so that nothing is showing by the browser
i have the following code
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
Session("loggedin") = "False"
CheckLoggedIn()
Session.Timeout = 20
End Sub
Sub Application_OnPostRequestHandlerExecute()
CheckLoggedIn()
End Sub
'Check that the user is logged in.
Sub CheckLoggedIn()
'If the user is not logged in and you are not currently on the Login Page.
If InStr(Request.RawUrl, "default.aspx") Or InStr(Request.RawUrl, "passwordrecover") And Session("loggedin") = "null" Then
ElseIf Session("Loggedin") = "False" Then
server.transfer("relogin.aspx")
ElseIf Session("Loggedin") = "True" Then
End If
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a session ends.
' Note: The Session_End event is raised only when the sessionstate mode
' is set to InProc in the Web.config file. If session mode is set to StateServer
' or SQLServer, the event is not raised.
Server.Transfer("relogin.aspx")
End Sub
I have also tryed using response.redirect, but this jus does the same in thing IE, and firefox will jus timeout everytime
any help appreciated
boyindie
|
|
|
|
|
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when a new session is started
just remove Session("loggedin") = "False" then try
else
just set Session("loggedin") = Null
CheckLoggedIn()
Session.Timeout = 20
End Sub
saniya khengar v
|
|
|
|
|
I have got it working now
but it doesn't allow null as its outdated, it will only allow a dbNull
but i just set it
session=""
works jus as well
|
|
|
|
|
Hi All,
I am familiar with vc++ and I want to learn vc++.net. So Can you plz suggest one good book at beginner level and one good book at middle level in vc++.net.
Rgds
trinadh
|
|
|
|
|
If you mean VC++.NET is C++/CLI (Managed C++), there are not many books to choose from. Here is my list from beginner to advance:
Beginner:
Pro Visual C++/CLI and the .NET 2.0 Platform, Stephen R. G. Fraser, Apress
C++/CLI The Visual C++ Language for .NET, Gordon Hogenson, Apress
Beginner/Intermediate:
C++/CLI in Action, Nishant Sivakumar, Manning
Intermediate/Advance:
Expert C++/CLI .Net for Visual C++ Progammers, Marcus Heege, Apress
The Hogenson book is for people who are new to C++/CLI but it reads better if you already have programming experience. IMHO, the easiest reading books are by Fraser and Sivakumar (a Code Project regular). Also, all these books are available in PDF format.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
George L. Jackson wrote: Nishant Sivakumar
Where have I heard of that guy?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I have had the same deja vu feeling myself? Weird!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi all,
Actually i want the solution of the fact that i want to avoid the runtime environment installing by including those dll in the application installer required to run the application that is developed in the .net.
in nutshell , my question is how to avoid the whole .net framework runtime environment to run the application that is developed in .net. this is bcoz we dont want to install the .net framework 2.0 in our client machine even we have developed his product in .net platform.
Thank you in adavance
naresh is testing the site.
|
|
|
|
|
Thats not really a possible scenario I'm afraid. The framework isn't just a bunch of dlls that your application depends on.
Also I doubt Microsoft will legally allow you to redistribute any of the framework by hand - they give you the runtime merge module and the dotnetfx redistributable for a reason.
|
|
|
|
|
Thank you very much Mark for your information.
naresh is testing the site.
|
|
|
|
|
Hi Mark.
There is product called thinstall that is doing the job wat i was expecting ..is it illegal??
wat's ur view abt this software??
thank you
naresh is testing the site.
|
|
|
|
|
It's not illegal at all. Essentially, what Thininstall is doing is creating a customized virtual environment that your application runs in. From your application's point of view it is running with the full framework installed. The company has been around since 1999 and appears to have a well established client list, but the product is not cheap. The base price is $4995.00 USD plus distribution fees. To me, it's not worth the price.
|
|
|
|
|
Hi,
The solution you want is definitely feasible but costly.
Yes a .NET application can be deployed to the client machine without installing the complete .NET Framework. Yes and please dont ask me how because i dont have the answer.
But someone has the answer and its here:
Salamander .NET Linker and Mini Deployment Tool
As regards license issues with Microsoft i guess once you reach the above link you will find a key quote given by a Microsoft employee so rest assure it is not anti licensing as far as you are concerned.
But then it is not free and you will need to make sure you get it genuinely and it has great benefits by providing inbuilt obfuscation that prevents reverse engineering of .NET MSIL code, the biggest disadvantage of .NET Applications.
So best of luck and do reply, eagerly awaiting your comments.
Regards,
Vaibhav Sharma
|
|
|
|
|
Hello everybody,
I´ve a strange problem with WPF Animations.
The mouse will moved over an UserControl (screenshot white area) and the current mouse position will displayed in a pixelbar, displayed by a line at the current pixel position (screenshot orange arrows).
Screenshot link:
http://www.connectiongroup.de/other/scrollbars_export2.png[^]
The pixelbars are own UserControls, which gets the current mouse position over the MouseMove event by the white UserControl.
On my machine with windows vista it´s runs terrible slow, as far the mouse leaves the origin (0x, 0y) it will more stucks, likes on a 486 runinng quake.
Now then, here´s the joke: Under windows XP the same compiled wpf application runs without any problems or stuking. - but, why this?
I´ve tested the executeable on other vista machines, always the the same problem at all.
Anticipate: It´s a Core2Duo with 2.8 GHz and a GeForce 7800 - should actually run ...
Detailed information:
The projekt runs under visual studio 2008 beta 2, it´s a wpf application using 3.5 .NET framework.
I´ve observed in general that wpf animations runs very slow under vista, e.g. a simple rectangle opacity fadein and -out. With XP there´s no problem...
Whereby can this due to, has anyone such a similar problem, does anybody know this problem?
|
|
|
|
|
I´ve solved the problem now.
The microsoft support page contains an article "Performance for a WPF-based program that uses the layered windows feature may be less than expected in Windows Vista":
http://support.microsoft.com/kb/938660/en-us
Because Microsoft didn´t provide the download of this hotfix directly, I´ve found it at this page also:
http://thehotfixshare.net/board/index.ph...s&showfile=2879
Executing this update, at first it throws an exception with the code number "0x80070003", which can be solved by deleting the content files of the folder "\Windows\SoftwareDistribution".
After the update runs sucessfully, the animation performance problem was gone!
So, if you add this XAML code to your application for creating a transparent window:
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
...the problem occur immediately !
You can check this out, before starting the update by removing the XAML "transparent" parameters.
Another phenomenon is, that under Windows XP the performance problem doesn´t occur, just with Windows Vista.
I think they didn´t tested this setting enough at release state - hope I can help with my post.
|
|
|
|
|
could any one give me some help on installer class
with regards
Balagurunathan.B
|
|
|
|
|
balakpn wrote: could any one give me some help on installer class
Such as? What would you like to know?
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
hi
i want to make my setup as user interactable like checking is the user is with administrator rights otherwise it should not allow to install have to quit the setup. i dono how to use installer class and write code on that.
with regards
Balagurunathan.B
|
|
|
|
|
There are lots of examples on google and a bunch of information in the class library documentation.
Did you read any of this?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
hi
i want to get the values like file version product version of an exe
pls give me some idea
with regards
Balagurunathan.B
|
|
|
|