LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel focus problems with custom RTD server (real time data)

I've gotten several emails regarding this post, so I figured I'd just
post my current work-around.

The general idea of the work-around is to set up proxy subscriptions.
For every dynamic topic that you want to have, you set up a proxy. To
do this, I had to add a couple of extra calls to my dll.

int GenerateProxyId(unique id) - This function generates a proxy id and
binds it to some unique info. For my unique info, I use the workbook
name + cell name of the thing that is calling GenerateProxyId. You
need to do this so that when you open multiple workbooks in the same
excel instance you don't get id conflicts between workbooks.

DateTime AttachData(proxyId, data) - This is a call that I use to
attach dynamic data to proxy ids. I return a DateTime because it is
kind of useful to know when the last time your dynamic topic changed.
I keep a hash of proxyId-last change time so that if AttachData gets
called and it is the same data or there is an error condition or
something, I can just return the last good date.

I also added a special branch through my code to look for a special
topic "proxy". So when I get a call like
=RTD("My.RTD",,"proxy",3,"#bar") In this case, I would see that it was
a special "proxy" topic using the proxyId 3. I would look up the proxy
data 3 and find something like "dynamic-foo" and then attach it to the
static part of the subscription "#bar" and get something like
("dynamic-foo", "bar"). By having the ability to combine static data
with dynamic data, you can save some proxy/attachData calls. For
instance, if you wanted to have 2 subscriptions (stock, "BID") and
(stock, "ASK) where stock was a dynamic value, you would just have the
following:

=GenerateProxyId("my workbook.xls", "A5") -- 3
=AttachData( 3, stock) -- 12:03:05
=RTD("My.RTD",,"proxy",3, "#BID")
=RTD("My.RTD",,"proxy",3, "#ASK")

* I use the # symbol to indicate weather the proxied data should go
#before or after# the static data.

That's about it as far as the solution goes. It's a very painful way
to do something that seems like it should be there out of the box. The
code gets pretty ugly too. With the static data + dynamic data
combining, you have to do several one to many mappings and reverse
mappings.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Capturing Real Time Data Rob Excel Worksheet Functions 2 February 24th 10 04:44 AM
creating dataseries from real time data Maurice Excel Worksheet Functions 0 April 10th 07 02:54 PM
storing real time data Meng Excel Discussion (Misc queries) 1 September 15th 06 04:58 AM
Excel 2003's autosum does not update data in real time KokWoei Excel Worksheet Functions 2 April 4th 06 05:12 AM


All times are GMT +1. The time now is 02:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"