|
Hi,
I'm using MSHTML in my project, as wrapped in Microsoft.mshtml. Does the .NET garbage collection automatically take care of these resources? Can I explicitly dispose of them somehow? I'm a bit concerned that there might be some memory leaks if I create a large DOM tree and then don't dispose of it somehow.
Thanks,
Arun
|
|
|
|
|
1. If you are concerned about memory internals anyhow, may be managed code is not the most adequate language.
2. Marshal.ReleaseComObject(...)
|
|
|
|
|
1. If you are concerned about memory internals anyhow, may be managed code is not the most adequate language.
Yes, that's true, but it's the best language for my task right now.
2. Marshal.ReleaseComObject(...)
Well, I tried that, and I see no indication that the memory is being deallocated.
I also have this code before that -- myObject is IOleObject for the HTMLDocument object I'm using.
const int OLECLOSE_NOSAVE = 1;<br />
myObject.Close(OLECLOSE_NOSAVE);<br />
myObject.SetClientSite(null);<br />
Thanks so much for your time, you are a true Samaritan.
|
|
|
|
|
Arun Bhalla wrote:
Well, I tried that, and I see no indication that the memory is being deallocated.
The best I can do for you is point the url[^] to one of the horses behind the CLR.
Arun Bhalla wrote:
I also have this code before that -- myObject is IOleObject for the HTMLDocument object I'm using
Internet Explorer is known for having leaks. Welcome to the club!
|
|
|
|
|
The subject pretty much says it!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
What's the question? How? Can?
|
|
|
|
|
As a general rule,
If the .NET API for a given control does not seem to expose the method you are looking for, then make sure to give a look at the WIN32 API for the underlying control.
In the case of RichText controls, you'll find that there is no direct way of selecting a row either.
Which brings to the point you have to build this selection somehow.
The Find methods exposed by the RichText control both search then select text.
Since none of these methods take a line number as parameter, I am afraid you have to build a char range yourself then call
[C#]
public int RichTextBox.Find(
string str,
int start,
int end,
RichTextBoxFinds options
);
The char range can be obtained by doing preliminary Find (with no selection flag) searching the carriage returns or whatever info you might know.
|
|
|
|
|
Hi,
I need to a pointer to an article or web page or something that will help me get started in developing a certain app. Basically, I need to send an email that as user has written and the email message has to show up in the user’s Sent Items folder in MS Outlook. The program is to be deployed on computers with Win2K using Outlook 2000.
I would like to do this in C# but since its Outlook 2000 would I be better off sticking to C++? Any pointers to creating an Outlook 2000 object in C# would be greatly appreciated!
Thanks!
Kevin
|
|
|
|
|
Outlook object model[^].
As said in the pointed page, you have to import the MSOUTL.OLB type-library to bring the wrapped object model into the .NET world.
|
|
|
|
|
Try to search MSDN
http://msdn.microsoft.com
|
|
|
|
|
V. useful outlook resource.
http://www.slipstick.com/index.htm
|
|
|
|
|
I have installed Visual C# on my windows 2000 machine and everything works fine. But when I install it on my Windows XP machine I keep getting the following error. Data Source Locator missing. Re-Install Visual Studio. Now I have gone through this re-install about 5 times and I still get the same error. Do you know of any issues that exist for windows xp that would cause this?
thanks,
William O'Malley
Systems Programmer
|
|
|
|
|
The "MS data source locator component" is the msdasc.dll file. It is installed by both : MDAC run-time, and Windows OS service packs.
If you have installed VS.NET using the appropriate procedure, ie have used the Windows Component Update CD first and still don't have it installed on your system, then my recommendation is to get this file from the net, and copy it in your "program files\common files\system\ole db" folder. Once installed by hand, don't forget to register it (regsvr32 msdasc.dll).
|
|
|
|
|
Hi, my project builds a DLL (for an Explorer Bar), and I'd like to embed a couple icons in it so that I can add it to the IE toolbar. I'd like to be able to access those icons via the standard reference way: "c:\programs\browser.dll,101" refers to the icon in that DLL at that resource slot.
I've created a resX file, and I know the icon resources get packaged into the DLL, but I can't access those icons from an icon editor or elsewhere in Windows, so I don't think the icon resources are being packaged in the usual way that windows expects for Win32 (unmanaged) applications. How can I package Win32 resources in a (managed) C# assembly?
Thanks,
Arun
|
|
|
|
|
This is a tedious task, at least with VS.NET 2002. Don't know if this changes with 2K3 though.
You have to create base64-ed resources and add them in your .resx file.
Then the compiler usually takes the .resx, migrates it to a .resource file and embed it in the output assembly. All this is automatically done unless explicitely told not to.
Amazingly enough, the only way I have found to add base64-ed resources in the .resx file, other than resources explicitely referenced in Form controls, is to do it by code. See the Resource section in MSDN.
|
|
|
|
|
Hmm, I've downloaded a few resource editors, including a couple on codeproject. I'm also stuck with VS.NET 2002 -- I hope 2003 improves some of these things, and I look forward to trying it out.
I know that I've added resources (icons and otherwise) in a .resx file which is then later part of the assembly. However, I don't know a way to refer to that resource in a way that IE might understand when it's reading a registry entry.
IE expects a format like
Icon => "C:\Program Files\BrowserBar\browserbar.dll,101"
in the registry, but as far as I can tell, I can't access the resources in my current assembly that way, but I can browse through the resources using Lutz Roeder's Resourcer, and it's all packages away neatly by class.
|
|
|
|
|
In fact, you need to add the /win32res:xxxx switch in the cmdline when you are using either csc.exe or al.exe. xxxx is the name of a win32 .res resource file (that is, a compiled WIN32 .rc file). This will embed both icons and bitmaps, and icons will appear as standard icons in windows explorer and shell32.
If you need to embed only one icon, then you can use the /win32icon switch instead.
|
|
|
|
|
Thanks, it looks like that will do the trick... once I convert my project files to BAT or Makefiles.
It's frustrating that the win32res switches can't be configured within VS.NET 2002, so it looks like I'd have to scrap my project files and move towards using a batch file for builds?
I hope VS.NET 2003 fixes these shortcomings in dealing with resources, particularly Win32 resources.
Already it seems that I need to run RC on a .rc file that VS.NET 2003 allows me to create but doesn't seem to compile automatically in my solution.
It'd be nice at this point if I could easily add a win32res to a DLL assembly... or if I could easily compute the CSC commandline that VS.NET is using, but alas.
|
|
|
|
|
I believe the cmdline is the only way to go, for the foreseeable future.
Ironically, may be those features get integrated in the free iSharpDevelop IDE sooner than VS.NET.
|
|
|
|
|
I suppose this is a C# question.
Do you know if there are any code templates out there for outputing the XML Documentation tags when you generate C# code from Visio? Ideally it should support:
<summary>
<example>
<param>
<permission>
<returns>
And maybe even <remarks>, <see> and <seealso> through adding an extra tagged value to the object, if that can that be detected/used? (I really don't know, maybe through an addin?)
I could write my own for the basics, but it would be nice if there were some already out there for simplicitys sake, and if it offered some of the other stuff it would be great.
David Wulff
Hanging on this wire
Waiting for the day where I'll have to choose
Cursed by love so dire
|
|
|
|
|
Well after adding <summary> and <returns> tags to the appropriate object templates, it has become apparant that code tempaltes where added to Visio five minutes before it shipped. Not very customisable at all, and they insist on prefixing comments with // !
Please Visio team - allow us to do something like %tag[name=Documentation]% in our templates, or ever better provide some form of XPath approach to navigate XML data representing the object. Please! That would make the code generation really useful.
Looks like it's going to be lots of tweaking in VS.NET after generating for me.
David Wulff
What the hell did I ever do to anyone?
|
|
|
|
|
I have a small ActiveX Control in C# (Windows Form rendered as ActiveX using OBJECT tag) and rendered in IE.
How can I refer the document loaded in IE from within this ACtiveX Control instead of redundantly downloading it again using WebClient.
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|
|
Chances are the IE address bar is visible, then the easiest thing I think of is to use Spy++, get the control ID of the address bar, then used standard windowing to retrieve the content of it.
Namely, get the window handle and/or control id of the underlying
editbox, then a mere ::GetWindowText(hWnd, str) will get what you need. (I am speaking in C++ terms but I guess you'll find out easily how to translate the words in C#).
|
|
|
|
|
How are you downloading it, and to where? A WebBrowser control?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
Can anyone tell me syntax to filter on child rows of a dataset or DataViewManager
I want to display in a datagrid, all the parent rows who have a particular text value in a column in the child table.
So far I have tried:
dataset.Tables["client"].DefaultView.RowFilter = "Child(relationName).category = 'TextValue'";
and
dataset.Tables["client"].DefaultView.RowFilter = "Max(Child(relationName).category) = 'TextValue'";
The first one returns all parent rows regardless of the child column value and the bottom one only returns the parents who ONLY have one child row that matches the 'TextValue'... parents that have one matching row and other child rows with non-matching rows do not show up...
Any help appreciated
Cheers
|
|
|
|