Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / February 2006

Tip: Looking for answers? Try searching our database.

Not enough storage... error when instantiating ShellWindows (shdocvw.dll)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SkylineBlvd - 15 Feb 2006 20:13 GMT
Hi all, I'm trying to create an instance of ShellWindows in a Windows
Service I've written in managed C++ so that I can enumerate the running
instances of Internet Explorer and later do some other things via
IWebBrowser2.  I'm having trouble right out of the gate, however:

shdocvw::ShellWindows* pSW = new shdocvw::ShellWindowsClass();

causes the following exception:

"Not enough storage is available to complete this operation."

This took me by surprise.  Is this class so large? (I've got hefty
amounts of memory available.)  Should I be doing something else
instead?  (I'm creating an instance of this class in order to use the
add_<handler>( ) methods to register the Delegates I've created for the
Registered and Revoked events that ShellWindows sources.)

Many thanks in advance,
SkylineBlvd
SkylineBlvd - 24 Feb 2006 18:23 GMT
Hello again folks - first, in hindsight, perhaps this post could have
been better placed (someplace other than the Interop group?)  Having
said that, I am posting the observations that Microsoft Support made
regarding the above problem, so that if anyone else has this happen
they might find their answer here.

Seems the exception being thrown is very likely to be one of those
misleading errors - the issue is not with lack of storage, but rather
with the way Windows prohibits interaction with the Shell from Windows
Services.  To do what I wished to do (using ShellWindows to enumerate
running browser instances, apparently the best bet is to create an
agent as a desktop app, hidden if desired, that creates an instance of
ShellWindows, does the desired work, and communicates with the service.
A little kludgy, but according to the "powers that be", the best one
can do.  PS - the reason I'm not using a more "Windowsy" approach of
enumeration, such as looking for top-level windows and picking out the
ones that are of the class used by IE (which I'm sure WILL work in a
Service if one checks off the "Allow service to interact with desktop"
box in the service properties) is that I subsequently need to do stuff
that requires using the IWebBrowser2 interface.

Hope this helps someone; cheers!

SkylineBlvd

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.