Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

SteveL12234

@SteveL12234
About
Posts
7
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • continuing education
    S SteveL12234

    If I saw that you went back to school rather than changing jobs or doing self study, I would interrogate you in a interview. Why would you spend a bunch of money for something that you could probably get by studying yourself - and much faster too. What did you actually learn that will be valuable to your job. Like someone else said, spending 2+ years getting another degree doesn't seem to be an efficient use of one's time and energies. Experience counts way more.

    The Lounge question discussion career learning

  • Poor Man's Diet: Part 1
    S SteveL12234

    The cholesterol in eggs is not supposed to affect blood cholesterol. But if you are super freaky about it, you can always remove the yolk. The yolk has lots of good stuff in it so eating a few shouldn't be that bad.

    The Lounge com json tutorial

  • Poor Man's Diet: Part 1
    S SteveL12234

    How about boiled barley or millet? At just $0.40/lb, it’s hard to beat. If you buy in bulk it is possible to get oats for about the same price. For protein, I prefer eggs or beef heart. Both are cheap. Beef heart is about $1/lb and about $1.50/lb after removing the fat and sinew. Beef heart is a little gamey but its dense and tender.

    The Lounge com json tutorial

  • Portland and Seattle...
    S SteveL12234

    Portland: 1. Tour some of the breweries, http://widmer.com/brewery.aspx, http://www.bridgeportbrew.com/, http://www.ehow.com/how_18346_tour-portlands-microbreweries.html. 2. Watch nutjobs ride in muck, fall over, get hurt, ect., check out one of the cycle-cross races. There are hundreds of competitors, http://www.crosscrusade.com/schedule/2009/index.html. 3. Visit the Spruce Goose, http://en.wikipedia.org/wiki/Hughes_H-4_Hercules, and a bunch of other aircraft at the Evergreen Museum, http://www.sprucegoose.org/. 4. Ski, snow board, sled, etc. check out Mt. Hood; ski, http://www.skihood.com/, snow parks http://www.mthood.info/recreation/mt-hood-recreation-snowPlay.html. 5. Visit the World Forestry Museum, http://www.worldforestry.org/. 6. Visit the oldest art museum on the west coast, http://portlandartmuseum.org/visit/. 7. Watch a Trail Blazers, basketball team, game, http://www.nba.com/blazers/schedule/index.html.

    The Lounge com business

  • Moving from C# to C++
    S SteveL12234

    If you want something more advanced, an option are Herb Sutters books. A lot of the material from those books comes from http://www.gotw.ca/gotw/[^] Also if you want to read more than you ever cared about templates, C++ Templates The Complete Guide by Vandevoorde and Josuttis. To see how far templates can be taken, read Modern C++ Design, by Andrei Alexandrescu.

    The Lounge csharp c++ question learning

  • Windows service + COM STA
    S SteveL12234

    With some help from a coworker, I figured out how to do this. The message loop can be run on the same thread as the COM object using ApplicationContext and Application.Run. Other objects can communicate to the thread via Invoke on a dummy Control created on the message loop thread. using System; using System.Diagnostics; using System.Collections.Generic; using System.Text; using System.Threading; using System.Windows.Forms; namespace TestMessageLoopWindowsService { internal class TestMessageLoop { internal void Start(EventLog eventLog) { if (eventLog == null) throw new ArgumentNullException("eventLog"); this.eventLog = eventLog; Thread messageLoopThread = new Thread(MessageLoopThread); messageLoopThread.Name = "Message Loop Thread"; messageLoopThread.SetApartmentState(ApartmentState.STA); messageLoopThread.Start(); Thread invokeOnToMessageLoopThread = new Thread(Invoker); invokeOnToMessageLoopThread.Name = "Invoker"; invokeOnToMessageLoopThread.IsBackground = false; invokeOnToMessageLoopThread.Start(); } private EventLog eventLog; private void MessageLoopThread() { ApplicationContext context = new ApplicationContext(); control = new Control(); control.HandleCreated += new EventHandler(control_HandleCreated); control.CreateControl(); Application.Run(context); } private Control control; private void control_HandleCreated(object sender, EventArgs e) { okToInvoke = true; } private volatile bool okToInvoke; private void Invoker() { while (true) { if (okToInvoke) { EventHandler method = new EventHandler(InvokedOnMessageLoop); control.Invoke(method); } Thread.Sleep(1000); } } private void InvokedOnMessageLoop(object sender, EventArgs e) { eventLog.WriteEntry("InvokedOnMessageLoop runs on " + Thread.CurrentThread.Name); } } }

    C# csharp com design data-structures question

  • Windows service + COM STA
    S SteveL12234

    How does one receive events in a C# windows service from a COM object that has been instantiated from a background thread whose ApartmentState == ApartmentState.STA? I’ve been able to received events from the COM object in a WinForm app when the thread sits in a loop sleeping and invoking System.Windows.Forms.Application.DoEvents(), i.e. pumping the message queue. The thread that accesses the COM object is responsible for responding to requests by other objects to access the COM object, done through a queue + AutoResetEvent, and for handling events raised by the COM object in response to those requests. Other posts/web sites have mentioned that STA threads require a message loop/pump. It seems like if the thread that accesses the COM object were able to call a method that could sleep + message pump + respond to requests to wake up, I’d be set. Is there such a beast/can such a thing be created? Is this the right kind of design? Thanks, Steve

    C# csharp com design data-structures question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups