|
I think it is time for a Custom Marshaller. You need to implement this interface.
public interface ICustomMarshaler
{
public void CleanUpManagedData(object ManagedObj);
public void CleanUpNativeData(IntPtr pNativeData);
public int GetNativeDataSize();
public IntPtr MarshalManagedToNative(object ManagedObj);
public object MarshalNativeToManaged(IntPtr pNativeData);
}
And set MarshalAs(UnmanagedType.CustomMarshaler) on the class. From there you should havenough control to marshal just about anything. Note: You can now make classes without Layout.
Cheers
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
leppie wrote:
I think it is time for a Custom Marshaller.
Ok, it's an opportunity to learn something new
BTW, I am not the only one with this problem: http://www.dotnet247.com/247reference/msgs/28/141537.aspx[^]
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
Hi,
This is my followup to my previous question. Even after I choose to 'End Process'/'End Process Tree' of aspnet_wp.exe, because it is taking too much of resources, it keeps spawning a new instance, and even after ensuring that no HTTP requests are being sent. I have closed all browsers and all VS.NET windows.
And this instance is taking too much of memory too.
What is the problem?
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Deepak Kumar Vasudevan wrote:
Even after I choose to 'End Process'/'End Process Tree' of aspnet_wp.exe, because it is taking too much of resources, it keeps spawning a new instance, and even after ensuring that no HTTP requests are being sent. I have closed all browsers and all VS.NET windows.
This is default behaviour. In case one application crashes another.
Deepak Kumar Vasudevan wrote:
And this instance is taking too much of memory too.
It should not be. ASP.NET is stateless in nature. WHy is it taking so much memory? Can you not unload some memory?
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
Hi,
How can we control in WindowsXP / Windows 2000 Server how much memory each process is taking. If that is the case, can we restrict the amount of memory that is allocated to ASP.NET Worker Process (aspnet_wp.exe)
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Hi all,
I have the following problem, that I am facing. When my ASP.NET page loads and after the page load has completed and even after the browser IE spinner stops spinning, when I check Processes tab in Task Manager, aspnet_wp.exe is still consuming heavy memory and CPU usage is more than 90%. aspnet_wp.exe does not get stopped after page_load is complete.
And very frequently my EventViewer gets so many error messages of the type:
(*) aspnet_wp.exe (PID: 216) was recycled because it was suspected to be in a deadlocked state. It did not send any responses for pending requests in the last 180 seconds.
Why is this happening? I am currently using C#-based ASP.NET application and my backend is IBM DB2 running on RS/6000 AIX server. I am using OLEDB Provider given by IBM DB2 to connect to the database using System.Data.OleDb.
We also frequently get 'Server Application Unavailable' and the following message gets recorded onto the database:
aspnet_wp.exe (PID: 668) stopped unexpectedly.
Please help...
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Hi all,
I would like to have the following clarifications. With C#, writing to EventLog and Reading is bit more easier. But could somebody advise me regarding the same.
- Any standards that need to be followed, while writing to System EventLogs.
- What kind of data can be written into eventlogs?
- What is the normal industry custom to adopt when writing to the EventLog also fails? How should the application respond to the user in this circumstance?
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
I'm working with PerformanceCounter and I'm noticing very strange behaviour.
I can't add any instances to my counters once instances have been removed?
For example our application creates and destroys 'things' at runtime that I
want to add and remove from the perfmon instance list. The first instances
appear but I'm unable to get the new instances (same name & different names)
to appear! Even if I restart my process (Windows Service) I'm unable to even
add the first instances back. I'm forced to reboot the server!
Does anyone have any suggestions? Anything to do with object references?
|
|
|
|
|
Why does dotnet add the instances to performance counter all in lower case?
Other counters on the system seem to use mixed case.
Also simple changing the InstanceName and setting its value does not seem to
be enough to create a new instance under perfmon. It appears as though you
must create new PerformanceCounter objects for each instance. Not what the
documentation states though!
|
|
|
|
|
solidstore wrote:
Also simple changing the InstanceName and setting its value does not seem to
be enough to create a new instance under perfmon. It appears as though you
must create new PerformanceCounter objects for each instance. Not what the
documentation states though!
Wrong! If you look at the IL, you will see the last 2 instructions:
L_003e: call PerformanceCounter.Close
L_0043: ret
Now look at the NextValue call tree (thanks to Reflector). You will notice that PerfomanceCounter.Initialize() is called everytime, hence being closed, it will re-initialize.
MyDUMeter: a .NET DUMeter clone
|
|
|
|
|
I'm working with PerformanceCounter and I'm noticing very strange behaviour.
I can't add any instances to my counters? I used to have a single _Total
instance but now I change my code so that there is meant to be several
instances. I've followed all the examples etc... but no joy. I understand
the instance is meant to be created when you first set the counters value
and that you can reuse the PerformanceCounter object for multiple instances
by just changing the InstanceName before setting the RawValue. Does anyone
have any suggestions?
|
|
|
|
|
Is it possible to write .NET applets similar to java applets?
--
Ignorant people upsets me.
|
|
|
|
|
With the previous version of Visual Basic, it was possible write ActiveX Controls that are functionally equivalent (and quite more powerful too!) to Java Applets.
With the current .NET framework, I think it should be possible to develop a control and host it from within Internet Explorer. A search over CodeProject or Google should give some results. It should be possible, since if you query the useragent of Microsoft Internet Explorer after installation of .NET framework, it reports as:
Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Deepak Kumar Vasudevan wrote:
since if you query the useragent of Microsoft Internet Explorer after installation of .NET framework
That's what triggered my question in the first place. I haven't found anything on the subject yet, but I must admit I didn't go out of my way to find anything either.
--
Ignorant people upsets me.
|
|
|
|
|
|
Thanks! I found an example somewhere on how to do it, but it was much more complicated than this and it had some major tradeoffs (can't remember what it was). This looks sweet and simple. I think I'll try it right away..
--
"It is amazing how f-ing crazy I really am."
|
|
|
|
|
Google for "SimpleControl".
Then google for "Chris Sells", because he's written a few articles on this subject (MSDN and MSDN magazine) Also look at http://www.sellsbrothers.com/wahoo[^],
Make sure you know something about .Net code access security, permissions and codegroups, because you're gonna see security permission exceptions...
VictorV
|
|
|
|
|
I am not too sure if this is the right place for this post but..
I am developing a desktop application.
It is using JET as it's backend database. The mdb file typically resides on the local machine. I wanted to implement funcationaility where the mdb file could be shared. I tried to put a UNC (\\computer\my.mdb) as my path but it will not work. I know that the permissions are right on the other computer and all of that suff. I can open it no problem. Is the .NET Framework Security stuff restricting the files that I can access over the intranet? I know it does it with assemblies.
Any ideas?
Thanks,
Jonathan
|
|
|
|
|
make sure the user/pwd you use for connectoin authentication have privelages.
you might want to use a UDL (Universal Data Link) instead of UNC.
copy and save this to a .reg file then run, to install UDL in your shell
REGEDIT4
[HKEY_CLASSES_ROOT\.UDL]
@="MSDASC"
[HKEY_CLASSES_ROOT\.UDL\ShellNew]
@="MSDASC"
"Data"=hex:ff,fe,5b,00,6f,00,6c,00,65,00,64,00,62,00,5d,00,0d,00,0a,00,3b,00,\
20,00,45,00,76,00,65,00,72,00,79,00,74,00,68,00,69,00,6e,00,67,00,20,00,61,\
00,66,00,74,00,65,00,72,00,20,00,74,00,68,00,69,00,73,00,20,00,6c,00,69,00,\
6e,00,65,00,20,00,69,00,73,00,20,00,61,00,6e,00,20,00,4f,00,4c,00,45,00,20,\
00,44,00,42,00,20,00,69,00,6e,00,69,00,74,00,73,00,74,00,72,00,69,00,6e,00,\
67,00,0d,00,0a,00,50,00,52,00,4f,00,56,00,49,00,44,00,45,00,52,00,3d,00,6d,\
00,73,00,64,00,61,00,73,00,71,00,6c,00,3b,00,0d,00,0a,00
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Hi All,
I am working on a C# based Windows application.Using the following code
to
create an Excel object.
Excel.Application ExcelObj = new Excel.Application();
Its workin fine for me, the problem is that i want to destroy this
object
when i exit form my method.
I am not able to delete this object.
Calling GC.Collect() Or MArshal.ReleaseComObject() waz not of any help.
Pls help.
Regards
Vitesh
|
|
|
|
|
Well, what is your need to destroy the object. CLR has garbage collection built-in, unless you have good reason you shouldn't explicitly try to delete/destroy. By calling dispose(), you can mark object for garbage collecting.
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Excel is a funny beast.
When you say you cannot delete it, you mean the process does nto shut down.
You may find that if you set the Excel.Application to visible and someone clicked on it, its goes under 'usercontrol', in which case it starts behaving like a naughty com object.
Set the Usercontrol = false, Visible = false, and then try Application.Quit, and see if the process shuts down.
I think the property is usercontrol anyway. Been a while since I last looked at it.
Quote from a clever bloke :
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein
|
|
|
|
|
Hi,
Does anyone know of a way of getting any scolling events from a ListView control ? I want to be able to fill a ListView control on demand (paging) as it can display very large amounts of data. So as the user scrolls down i access and load rows.
Can this be done with the standard .Net Control ? Or is there a 3rd party control that can do this ?
Thanks ... Andy
|
|
|
|
|
It sounds like you want the behaviour of a virtual ListView, where the data to draw each item, is asked for as items are scrolled into view. This is no problem in Win32/MFC, but the stock .Net ListView does not do this.
Even if you could monitor the scrolling events and try anticipating when certain items need full data, the LV's item collection would need to be filled with correct number of items first, else the scroll thumb and behaviour would be somewhat strange. My own experience suggests that adding items, even if they have blank data, is somewhat expensive in itself, unlike with a straight Win32 LV. The .Net LV tracks its own cache of at least certain data for each item, in its own collection.
There might be a 3rd party solution, but unfortunately I do not know of one. Implementing it would have to be largely from scratch, except for inheriting from Control, using delegates to retrieve data to be loaded into the rows. There are some articles on this site about custom drawing LVs, which might be of interest to you. Sorry I couldn't be more helpful.
Cheers
|
|
|
|
|
Is it possible to make submenus when you are adding designer verbs?
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|