Click here to Skip to main content
15,077,265 members

Comments by Jason Gleim (Top 138 by date)

Jason Gleim 20-Mar-19 16:40pm View
   
You should not use buttons to manage the state. When a button isn't visible on screen it isn't updated. So you are tying to set properties on an object which isn't visible... that won't do anything.

You need to manage your state with an object. Update the state in the click handlers then reflect that back out to the buttons. However, you don't say if you are using winforms or xaml for the UI. You may also run into a situation where you can't update the button state from inside the event handler. There are rules around that like you can't raise an event which results in UI changes from inside the event handler for an event surfaced by the UI. You have to decouple one event from another using a timer or a storyboard or something like that which allows the UI thread to exit the current event handler before entering a new one.

The best approach would be data binding the buttons back to a global state object that implements INotifyPropertyChanged. That's easy to do in xaml but much more difficult in Winforms.
Jason Gleim 20-Mar-19 16:26pm View
   
Did you look on their web site and see the address they have published for support?
Jason Gleim 23-Oct-18 10:32am View
   
In your connection string you use AttachDbFilename. That parameter is used to spin up SQLExpress on your machine and attach a database file to it. But you say that you are connection to a local SQL server. I suspect that the issue is you are seeing one thing when the app is running then another DB when the app is not running (because SQL Express will disconnect the file).

The attachDBFile is only for development work. If you need the data to persist you should be specifying the database name in the connection string.
Jason Gleim 23-Oct-18 8:12am View
   
Silly question... have you opened a browser on the server and tried opening the URL in it to confirm you can actually reach the site from the server? The exception is happening inside a task which doesn't do a very good job of surfacing what the real problem is. You might try returning the inner exception and see what you get.

EDIT: I totally missed the missing await! What he said too ^^^^ :-)
Jason Gleim 23-Oct-18 8:04am View
   
I suggest you download and install "Packet Sender" from packetsender.com. It can act as both a sender and listener with flexible setup for UDP and TCP on any port you wish to assign. Use it to see exactly what your reader is sending you then you can use my code from there.

Good luck!
Jason
Jason Gleim 5-Dec-16 10:44am View
   
Did you setup an event reader to get events from the hub and put them somewhere? With the IoT hub, events are placed into the hub with a timestamp. You then need to specify a reader which will copy events from the hub and do something with them... persistence to storage, analytics, etc. You can have more than one reader access the events in the hub.

Events should then expire after some amount of time. The hub itself isn't for long-term storage. Setup a simple reader to move them into a DB instance and then build your front-end against the database.
Jason Gleim 2-Dec-16 9:23am View
   
Does the malicious app make the change then terminate or does it keep running like Notepad does? The FileSystemWatcher won't trigger until the changes have been committed so yeah... if the app makes changes, writes them, then terminates there is no handle to report back.
Jason Gleim 2-Dec-16 9:16am View
   
Instead of binding the listview to the combobox, just bind it directly to the selected student:
<listview name="myStudent" itemssource="{Binding CmbSelected, Mode=OneWay}" horizontalalignment="Left" width="420" height="150">

There is no need to bind to the UI element when the ViewModel exposes the property you want. That is how you should be binding data anyway... always to the ViewModel.

You don't show what your student class looks like but I'm guessing it isn't implementing IEnumerable. Check your debugging output and you *may* find a type casting error indicating the ListView can't cast student to IEnumerable.

I have a feeling you are just using the wrong control. When you choose a student in the combobox, you are just choosing one student, right? That isn't what a ListView is for. If this is true, you should just use a stack panel and textblocks.
Jason Gleim 23-Apr-15 10:39am View
   
Do you understand how in-line styles (or styles in general) work in xaml or how value converters are used? With an understanding of either of these concepts you should be able to create a functional solution. The fact is, I can't write the code for you... I don't have enough information about your requirements and I've got my own work to do.

I've suggested to you two different options; one that would work while remaining on the path you have started down. Another which changes the control you would use but puts more control over the formatting into your hands via a value converter and a property on your view model. Although I suggest the second, you have to make the decision on which path you will choose.

Good luck!
Jason Gleim 15-Apr-15 15:02pm View
   
Your question isn't clear wrt what time interval you are trying to capture? Do you want just the execution time for a block of code (such as the block within the click event) or do you want the time the application is open or do you just want the combined time of several operations? Please clarify.
Jason Gleim 15-Apr-15 13:56pm View
   
You might want to also hook the form closing event and call backgroundWorker1.Abort so that the app doesn't hang when the user closes it.
Jason Gleim 12-Aug-14 11:21am View
   
Have you set a breakpoint and stepped through the validation to see what is going on? I would suspect the values are not being passed in the way you think they are. My initial guess is that you might want to make the functions take the parameters ByRef instead of ByVal. This way they are working with the actual text objects and not copies.
Jason Gleim 12-Aug-14 10:53am View
   
It doesn't look like it. One of the BIG complaints in Windows Phone 8 (and 7/7.1 prior) was the utter lack of support for file system management. Because a "Windows Phone App" is really a Silverlight app (for the most part... there are exceptions) you were limited to Isolated Storage as the only location you could read/write to with very few exceptions.

I'll confess not to be an expert on the file system in Windows Phone 8.1 as it has just recently come out and I haven't really done anything there. I felt the limits as a pain point previously and I know this was something they really improved on in 8.1. That is likely why you are having success there and not on WP 8.

I hate to say it but I'm not very confident you are going to find a workaround for this. The sandbox around apps in Win Phone 7/8 is pretty tight. You may just have to make your app a Win Phone 8.1 and up app. But, keep trying and if you find something, write and post an article. It may help others.

Good luck.
Jason Gleim 8-Aug-14 14:42pm View
   
So go for it... start writing your app. Why do you need us? Are you asking a question or announcing that you are going to do this. Right now this looks like an announcement.

If you have an actual question (Usually ends with a '?') then click on "Improve Question" and edit what you posted.
Jason Gleim 8-Aug-14 14:39pm View
   
Why the hell are you using this architecture? Why not just keep the table in SQL server or something way more simple like an XML file?

At any rate, we need to know how you are connecting to FoxPro. Are you using the ADO.NET OBDC datasource adapter or something else?

Please edit your question and provide that as well as what you have tried to do (I'm assuming you are making the changes then calling the Commit method???) so we know what doesn't work.
Jason Gleim 8-Aug-14 14:20pm View
   
Did you look in your server logs?
Jason Gleim 8-Aug-14 14:19pm View
   
As Sergey notes, you should edit your question and add more details. For example, you don't tell where it is failing. Does the service callback get a full image back from the service? (received image size is the same as the size in the database) Can you confirm that the images are being stored in your app properly after the service call? How are you linking the stored images to the UI for display... Are you directly assigning image properties in code or are you binding them in an MVVM-type structure?
Jason Gleim 8-Aug-14 14:07pm View
   
I never got that. I suspect that your xmlns statement might be referencing the clr-namespace and assembly rather than the more generic http://... format. The toolkit is designed to merge seamlessly into the various namespaces.
Jason Gleim 10-Sep-13 10:23am View
   
Best of luck. I've worked with a lot of machine vision applications before using a lot of different libraries. Unfortunately, we devs are all slaves to the libraries the companies produce seeing as how nobody can come up with a standard for talking to them.

As I said, I'm not familiar with that camera but if they are like everybody else out there, the API is barely documented. Hope you find some success!
Jason Gleim 9-Sep-13 15:58pm View
   
So I just can't get A to equal B. Using what you said I tried all kinds of combinations of big-endian/little-endian, 2's compliment, and even looking at if maybe the parameter was coming back as a double and getting mis-cast. But there is no combination of bit shifting that I can find where we can get 1280 misinterpreted as 8024. Your .net app is getting that value for a reason and it doesn't seem to be a mis-cast. Obviously, there is a factor of 6 difference there but I don't know where to account for that. Maybe there is something in the api docs or you can reach out to the camera vendor to find out what is going on? I'm stumped at this point.
Jason Gleim 6-Sep-13 14:03pm View
   
Bummer... So what does the array look like for the height? {x,x,x,x} Maybe there is a clue in that.
Jason Gleim 6-Sep-13 13:44pm View
   
You might try using the bitconverter class to convert back the byte array to an int. So do the conversion to the byte array that you are doing then use BitConverter.ToInt32(bytes) and BitConverter.ToUInt32(bytes) to see if either value comes back correct. It might be a signing issue. If that isn't it... I'm out of ideas. :-(

The problem is clearly in the way the framework is converting those int values. It is supposed to work automagically but there are cases where it fails and usually with maddening results. I've seen it on complex objects but not on atomic types before.

At least with the BitConverter class you can look at the results at the bit level. If you convert height you would see an array (in hex) of {0,4,0,0}, right? There may be some value in looking at the results that way.
Jason Gleim 6-Sep-13 10:25am View
   
The only other thing that came to mind was a problem with bitness of the result. The camera could be returning the results in little-endian and that is causing them to get reversed. But I didn't see any conversion in the c code so I didn't mention that. You could convert the weird values to bits, reverse the bit order, pad it out, and convert back to decimal to see if that is it. If it is, your result would be the correct number.

Another possibility is the depth. int in c# is really int32... there could be an issue with the bit depth or something like that which is causing weirdness. Maybe the values are being cast from overlapping areas of memory because the function is returning 16 bit int values? You would have to look at the api I would think to determine that.

You could also break on the function call and look at the stack to see the parameters. That would tell you right away if you are getting pointers or values passed back.
Jason Gleim 6-Sep-13 9:46am View
   
As a point of order, what you are seeing in the browsers is NOT the WSDL. The WSDL is the document that describes the service endpoints and what the expect/return. Firefox is showing you the response wrapper from the service with the data contained in-line because it can't decide how to decode the response. IE recognizes that what it received is a service response and so it strips the wrapper and presents the resulting XML response. That is why you are seeing different results.

You might want to look at tools like SoapUI and Fiddler if you are debugging web service calls.
Jason Gleim 6-Sep-13 9:41am View
   
When you import the function from the external DLL, the framework takes care of the type conversion and marshaling. You should not need to de-reference the out values from the external function. When the call returns the values of pointx, pointy, wid, and hei should all be correct without you doing additional work. So you should be able to call:

int iOut = TC_getRoi(out pointx,
out pointy,
out wid,
out hei,
devName);

and if iOut == 0 then pointx, pointy, etc should already be 0, 0, 1280, 1024. The invoke framework should be handling all of that for you.
Jason Gleim 6-Sep-13 9:21am View
   
Serial connections are dumb connections. Device manager doesn't monitor the state of the serial connection. It isn't like a network link where Windows will tell you if a cable is unplugged. There is no supervisor function on a serial port. So if the hardware is there and the driver loaded, it will show in device manager regardless of whether something is actually hooked to it or not. You will never see any kind of state indicator in Device Manager.

You can, in fact, send things to a serial port that isn't connected to anything at all. Your terminal program will be perfectly happy doing that. State management and error detection are the domain of the application using the port. It is very different than a regular network connection.

When you say that data is not exchanged, what exactly do you mean? How are you trying to exchange data? Are you opening the terminal program on both machines, setting them to the same baud and port settings, then getting nothing on the other machine when you type into the first? If this is the case, make sure you are setting both sides to no flow control. Depending on the cable, it may not be properly passing the hardware handshakes between the machines. If the port is setup to use hardware flow control (the default setting), it will not pass data until it sees the CTS signal from the other side. Configuring the port to no flow control will make it ignore all of that and send the data regardless of the status of the other side.
Jason Gleim 5-Sep-13 10:25am View
   
You have to use a terminal program like putty or something similar to communicate over the serial port. Windows supports the ports but doesn't include Hyperterminal in Win 7. So you need to get something that works like Hyperterminal.

You also need a cross-over cable. I'm assuming the link in the first comment noted that but in case it didn't... A cross-over will cross pins 2 & 3 as well as the handshaking pins.

Finally, all serial ports show up as COM ports in Windows. Even if it is a USB to serial port adapter or a Bluetooth to serial port (support the SPP profile). So the device driver for the specific adapter must implement a virtual COM port. Your terminal app will simply need to know the COM port number.
Jason Gleim 5-Sep-13 10:18am View
   
Add a logging framework like Log4Net or something similar to your service and set it to emit verbose messages to a log file or to the event log. It is crashing for some reason and without logging you will never figure out why.
Jason Gleim 29-Aug-13 10:28am View
   
Please... don't post a follow-up to your question as an answer to your own question. Edit the original question or comment on the answer you are responding to.
Jason Gleim 29-Aug-13 10:26am View
   
Do you have any third-party controls or libraries in your project? This type of error usually happens when you have a dependency in a 3rd party control on a specific version of that assembly and your project references a different version of the same assembly.
Jason Gleim 19-Aug-13 14:50pm View
   
Further to Prasad's comment... if you can successfully call the service with SoapUI, install and run Fiddler and then run your program. Fiddler will catch the service calls on the wire and you can see if there is a problem there. A lot of times I find there is a mismatch in the xmlns declarations for parameters. Java assumes the namespace is the bean that contains the service endpoint while .Net will look for the namespace to be in the application namespace. Neither of them will use w3c namespaces for atomic data types.
Jason Gleim 23-Jul-13 16:33pm View
   
... jason runs from the room...
Jason Gleim 23-Jul-13 16:33pm View
   
Agh! You're right! I looked right over that!

Quick! Look! A new Royal Baby!
Jason Gleim 23-Jul-13 16:29pm View
   
This will absolutely work as well! I've used a similar technique before chunking large uploads to a web service. There is nothing wrong with chaining a new call from the completed event.

This should scale well for you if it ever needed to. Assuming there is a break between the call and the callback (which there would have to be), the UI thread will gain back control which would unwind the initial call stack. This means you wouldn't have to worry about "Inception" style recursive callback stacking like you had before when it was all in a single foreach loop.

Glad you hear you found a solution!
Jason Gleim 23-Jul-13 10:15am View
   
Posted as a solution. If you would mark it as the answer good karma will come your way! :-)
Jason Gleim 22-Jul-13 15:17pm View
   
You should only insert the function when the user picks it from the combobox... right? So hook the SelectionChanging and SelectionCompleted events. When the user drops the box down, the selection changing event will fire. Set a flag so you know the user dropped the box down. In the selection completed event, check the flag and if set, insert the function into the text runs collection of the rich text box at the current cursor position.

Also, you don't need to process all the keypresses that can't be pressed... why would you do that? Just check for the ones you are interested in intercepting. Make sure you set the Handled property to true so the keypress doesn't bubble up the event chain. For keys you aren't interested in, just do nothing. They will bubble up and be handled by something else.
Jason Gleim 22-Jul-13 14:18pm View
   
Do you want the user to pick something from the listbox and have that function appear in the richtextbox? If so, data binding is not a good solution unless you know that the user will only ever pick a single function and it will always appear at the same place in the rich text box.

Data bindings allow you to have a backing variable in the data context of the control that is automatically updated on the UI. Meaning if you bind the class property MyCheckMark to the Checked property of a check box control, then when you set MyCheckMark = true; in code, the checkbox will change to be checked. (assuming the property and the data context class implement INotifyPropertyChanged)

It would seem to me that you want flexibility... the user should be able to select multiple functions and have them inserted at the current cursor position. There would be value binding the combobox to a property on a ViewModel but I'm guessing if you are asking about databinding, you aren't doing MVVM anyway. In that case I would say, no... data binding is not a good solution for you.
Jason Gleim 22-Jul-13 13:32pm View
   
I think you could make a few changes to the code you posted that would help but I'm beginning to think there is a practical limit there in the number of simultaneous sessions you can get away with. I know there is an IIS setting which adjusts the max number of concurrent sessions but if that was the issue, you should get 403 errors... not 404s... and we've seen with Fiddler that its not breaking down at the server anyway.

Your improved version of the calling loop is much better. But I think you can go ahead and move the UI stuff out too... no reason to set the indeterminate flag and IsBusy every time you iterate the loop. Better to set the UI stuff before you go into the loop since you already know you have at least one task to process. Avoids the overhead of unneeded thread marshaling.

I see though, in the callback method, a line which checks if the receive count matches the sent count. That is probably bad logic because it would short-circuit processing on a big number of calls. If the service takes any time at all, you could have 200 sent and the callback would not process the inside of that if statement until the 200th response came back. There may be some reason for doing this... without the complete context it is hard to know... but it seems like your contractor was trying to do some session matching or something. You could probably remove that thinking about how the event handler should respond to each callback for each individual session.

But, neither of those thing will fix your problem I think. I don't see anything fundamentally wrong with the revised code that could cause issues 500+ calls out. So we have to look at the concurrency of the calls. I'm going to post my suggestions as an answer... stand by.
Jason Gleim 22-Jul-13 11:31am View
   
This is very helpful... let me digest the code a bit and I'll get back to you. In the meantime, do you have access to the code on the web service side? Meaning, could you redo the service endpoint to accept an array of AssignTaskCriteria? It would be a lot more efficient then sending them one at a time.
Jason Gleim 21-Jul-13 19:21pm View
   
oh yea... if you are assigning the event handler inside the for...each loop I would bet that is the problem. The web client which executes the call is static so there is only one web client for each service instance... ever. This means that if you hook an event handler, you are ADDING an additional handler delegate onto the end of the event chain (unless you subsequently remove it).

If you've ever declared and raised an event in a class you know that you have to check and see if a delegate is registered for that event before you bother raising it. (that is the check where you see if the event is not null) This checks to see if there is a handler registered with the EVENT CHAIN. An event handler is not a one and done deal. Other classes may register to handle the same event. If this happens, .NET just tacks the event handler onto the end of the eventing chain. When the event is raised, the first delegate in the chain gets to handle the event. If the handler doesn't set the 'Handled' property set on the event, .Net will look to see if there is another event handler in the chain. if there is, control will pass to it with that process repeating until e.Handled is set to true or the end of the event chain is reached.

In your sample, setting the event handler in the foreach loop is the same as creating a new class and registering to handle the same event on the service's static proxy class in each class... 2000 times over. Given the rate the loop iterates, if there is any delay in the web service call returning, you could have 500, 1000, 2000 event handlers registered by the time the first service call returns. That will just blow things up.

You should set the event handler once, before the foreach. If you need to match up request with response, then passing userstate is the way to do it. Your event handler will have to be smart enough to handle that if required. However, I bet your event handler is already correct... you probably just need to quit hooking the event inside the foreach loop and your problems will go away.

On a different note, I'm a bit shocked your contractor would do that. Generally speaking, you would never put hooking an event handler in a loop unless you were iterating the objects with the events and hooking them all to a generic event handler. Hooking 2000 handlers to a single instance is the sort of thing that can hard to track down. Especially because it won't fail until fails... it is an edge-of-the-cliff error. There is no degradation (typically) leading up to it. You just pass the limit and bang, it all dies.
Jason Gleim 19-Jul-13 20:13pm View
   
Sorry, just thought of something else...

You might use the conditional breakpoints in Visual Studio to break after so many calls. Add a call counter and increment it's value everytime you call the web method. The set a breakpoint on that line which breaks at some value... say 10 or 100 or something. Then, when it breaks at runtime, look at the call stack to make sure something silly like a recursive call isn't going on. If it is, it will jump out of the calling stack because the top hundred or so entries will have a repeating pattern. Again, running out of stack space because of a recursive call could chew up the app too and it would likely just crash and unwind all the calls rather than throw a helpful exception. (Exceptions on asynchronous methods usually just get swallowed and never reported up to the ui thread because the runtime won't automatically marshal them.)
Jason Gleim 19-Jul-13 20:03pm View
   
That makes me think there is a problem in the app. I've run Fiddler for hours capturing 1000s of sessions with no issues. And the fact you see other traffic tells me Fiddler isn't likely losing track of what is going on.

Two quick questions; Are all of these calls simultaneous? Meaning you see 400 to 500 OPEN sessions in Fiddler. Second, are you only setting the callback handler on your web method once? I suspect you may be hitting a threading limit or the ability of the web client to track active sessions in the first case. If you are setting the event handler for each call (without detaching it) you will end up with a super, super long eventing chain. Which, by the way, I've found in practice crashes somewhere around 500 entries. The webclient is static so if you call the proxy method and pass an event delegate in each call, you are loading up the eventing chain.
Jason Gleim 19-Jul-13 15:28pm View
   
I think we are talking the same thing. I assume you are calling SomeWebServiceClient.SomeMethod(param1, param2, callback); or something similar. In that case then yes, you are using the async that is already built into the proxy objects.

Some people read that all web services in SL have to be async and think they need to wrap the method calls in async code. I was afraid you had gone down that path.

I think you'll find Fiddler an amazing tool for debugging those calls. I don't leave home without it! :-)
Jason Gleim 19-Jul-13 14:59pm View
   
Technically speaking, the line output of a sound card is 1 volt peak-to-peak. Assuming the D/A (digital to analog converter) is perfectly linear, then your internal setting would roughly equate to a proportional output voltage. However, in practice, there is no such thing as a perfectly linear D/A and measuring values on transient sound waveforms can be an exercise in futility. That is why averaging functions like RMS are usually applied in these cases.

But as the others have noted, there is an amp between the output and the speakers that really determines the SPL. (Sound pressure level) I could set the output volume at 20% and still generate 100dB SPL at 10ft with proper amps and speakers.
Jason Gleim 19-Jul-13 14:22pm View
   
Are you specifically calling the async invoke passing in the web service proxy methods? If you generated the proxies from WSDLs, the proxy objects already have the async harnesses in place... you don't need to further async the call. (There is no such thing as a sync web service call in SL.) That's just an extra layer of indirection for no performance gain.

I've seen this before when the server gets overloaded with simultaneous calls. Depending on what you are working against, it may just silently drop the service request with an unhelpful error code. One thing to do is to use Fiddler instead of Wireshark. Fiddler will intercept the calls to and from the service rather than everything on the wire like Wireshark does.

If you make a Fiddler capture and need help looking at it, PM me and I'll send you my e-mail address.
Jason Gleim 27-Jun-13 11:20am View
   
Really, you would probably be better off throwing all of the data lifting and those properties into it's own class (which implements INotifyPropertyChanged) and setting that class as the page's DataContext in the constructor of the code-behind. That is really how it is all designed to work.
Jason Gleim 27-Jun-13 11:10am View
   
crap... it stripped my witty "sarcasm" xml tags. :-(
Jason Gleim 27-Jun-13 11:08am View
   
<sarcasm>
I would like to invent a program that makes me a billionaire. Can you guys tell me how to do that? Or even better, write it and post the code as the answer?
Jason Gleim 27-Jun-13 10:42am View
   
The exception is being caused by the individual element removal and addition to the listbox item collections. Those collections fire events EACH TIME he removes or adds an item. The UI will receive those events because they are bound to the collections in the control's code. Since all of that is async, you can get a situation where the item count of the underlying collection can change as the UI is iterating it and populating its display elements. That is a big no-no... you can't change a collection while it is being iterated or you will throw and exception.

What he should really do is work with an observable collections in the background and never mess with the listbox items collection directly. If you .Clear and .Add the backing collection, the listboxes will automatically update via the binding events.
Jason Gleim 27-Jun-13 10:33am View
   
I think you missed my point about sockets... sockets are NOT language specific. A socket is an endpoint defined on a network interface. (http://en.wikipedia.org/wiki/Network_socket) They are providing a socket interface and examples to consume that in Java and C++. There is a whole namespace in .NET for dealing with socket communications. My point was that you don't HAVE to use ActiveX... you can connect to the socket(s) just as easily in .Net as you can in Java. The only downside is that you would be on your own from a support issue WRT Interactive Broker.

If you are more interested in getting it running and then iteratively improving it rather than designing something from the ground-up to be high performance, then take their ActiveX sample and start there. At least you would have a working framework and you could adapt it to run your own logic. I can't tell you what to do and how to build your app. I can only advise you that connecting to sockets from .Net WILL be better than going through ActiveX and it CAN be done from .Net. But, if you aren't comfortable doing it, then don't do it.

The other option is to look at MetaTrader. You can program it directly within the MT platform and it will execute your algorithm rather than you writing a stand-alone app. It might be a quicker and easier way for you to get your custom trading logic up and running.
Jason Gleim 27-Jun-13 10:24am View
   
What is the actual sum of the two fields? Does it exceed the limit of the int or double you are trying to put it into to? Are you doing something silly like trying to add the values of two string columns without converting them to int or doubles first?
Jason Gleim 27-Jun-13 9:56am View
   
Your question is like asking how many ways you can use a stick. It is only limited by your creativity and your need.

Grid and List views provide ways to display tabular or hierarchical data. The way you visualize that through these controls is entirely up to you.
Jason Gleim 27-Jun-13 9:49am View
   
That is nearly impossible to predict. It depends on so much... how fast you process events, the specs of the machine it is running on, what else may be running, etc. There are some things you can do to help avoid problems such as making sure your loop which receives the data is fast and tight. So maybe all you do in it is grab the data and push it onto a queue for later processing by a background thread. That way the data exchange is as fast as possible and you push the heavy lifting out of the data exchange.

The same sort of principle applies for any high-data rate application. If there is a risk that it will take longer to process the data than the interval in which the data could arrive, then you have to decouple the process of getting the data (making it high priority) from processing the data (making it low priority). For example, if it took two seconds to process a data packet and the packets arrive every second, then you need two processing threads to handle the data as it arrives. Anything less and your queue would eventually overflow and you would lose data. If setup properly, the issue then boils down to an issue of managing the queue.

If your data rate became too much for regular threads on a multicore processor, then shifting data processing over to a GPU may provide a solution. But at your proposed data rate that doesn't seem like something you would need to do. (Unless you are doing something like a FFT on the data.)

Of course, the complexity of the solution increases as the demand for speed increases. I can only advise you on what the options are, you have to make the evaluation for your project. I do think that if you aren't doing a bunch of heavy processing on a chunk of data, a simple mechanism to receive the data via ActiveX, push it onto a queue, then have a background worker pop the data off the queue and process it would probably work very well for your app and easily handle your proposed data rate. If you are concerned, you can profile your app while it is running and get an idea of actual execution times for each part as it runs.

Hope that helps!
Jason
Jason Gleim 26-Jun-13 10:08am View
   
You're right... they make no mention of .Net. But considering they note VB & ActiveX as a way to connect to the service, I get the feeling they haven't really kept their public API up to date.

That being said, my point (that I didn't make clearly) is that if they support socket connections via java and c++, then a socket connection from .net will work just as well. There is no magic sauce to socket communication that makes it language-specific. They may not give you any help troubleshooting a problem if you are building something on .net, but there is no technical barrier preventing you from making the socket calls from a .net application. The Java samples should provide enough information that you could port them to .net.

Ultimately, it probably comes down to what you are most comfortable with. If you are a Java whiz, write it in Java. If you know .Net, you can probably use the Java samples as a basis and go from there creating something amazing. But I would avoid VB & ActiveX not just because they advise against it but because it is a bad choice for a custom app. Especially if you are micro-trading with your solution.... you need responsiveness and sockets will give you the best performance.
Jason Gleim 26-Jun-13 9:48am View
   
The VitaminCtrl control is likely changing it's size and bringing itself to the top of the z-order when in full-screen mode. You may have to hook the resize event on the VitaminCtrl and use it to resize the overlay as well.. You may also need to set the z-order of the overlay control so it is always topmost. Both can be done in that resize event handler. Just make sure you call the base event handler for the VitaminCtrl first so that the control resizes then you should be able to get the new length & height values to set the overlay control.
Jason Gleim 26-Jun-13 0:50am View
   
How you do it is dependent on the app technology. Winforms is different than the xaml-based stuff but the gist is the same. You position a container control, like a panel, over the VitaminCtrl and set the width/height to match. You set the background of the control to #00ffffff which makes it invisible. The user can't see the overlaid control but when they right-click, the event will be routed to the overlay control....not the underlying VitaminCtrl. Just make sure you set e.handled=true in the event handler or else the right-click will bubble up the event chain and trigger the joystick menu too.

Hope that helps!
Permalink
Jason Gleim 26-Jun-13 0:29am View
   
I'm giving you my reply: You have not sufficiently defined the problem. Please edit the question to tell us more. Is this winforms, wpf, winrt... Is the problem simply how to add questions? What storage methods have you looked at?
Jason Gleim 9-May-13 15:28pm View
   
Hii,
You haven't told us what the error is or what you have tried using the above code.please help us out as soon as possible.

And DON'T post the additional information as a solution. Edit your question please!
Jason Gleim 9-May-13 15:25pm View
   
And I'm curious... is this a homework assignment? Because it sure smells like one. Nobody writes a garbage collector for languages that already have garbage collectors like Java and .Net. Your program seems to have no practical purpose beyond teaching someone how to implement a GC.
Jason Gleim 9-May-13 15:17pm View
   
Don't edit your own question by posting it as a solution. Besides annoying everyone, you bump your question off the 'unanswered' page when it isn't, in fact, answered.
Jason Gleim 9-May-13 15:10pm View
   
Do you have a reference to the FarHangii library in your project? And, more importantly, is that library a .net assembly?

You should also check to see what your startup object is in the project properties. It needs to be either Main in a module or a form. If you are pointing to something else it won't work.
Jason Gleim 26-Feb-13 14:18pm View
   
I'm curious why you would get a stack overflow filling the data adapter. Do you have a huge number of rows in the database? Are you sure da.Fill isn't being called recursively?

You might try using a SqlDataReader rather than the SqlDataAdapter since it looks like you are only reading the data from the DB and not updating anything. The DataReader is more efficient in these situations. Although I don't know if that will fix it or not. I'm not a data guy so that is a bit out of my expertise.
Jason Gleim 26-Feb-13 9:55am View
   
Set a breakpoint at the top of that method and step through it using F11. Make sure that it isn't being called a bunch of times. It could be that when you populate the first grid, SelectedItem is being set to each row as it is being inserted into the grid. (You could test this by putting a breakpoint in the SelectedItem property setter and running the app. If it breaks there when the first grid is being filled in, then that is the problem.) This could be causing GetDetails to be called for every row in the top grid (recursively too I believe). That would definitely cause a stack overflow.

If this is the case, you may need to add some logic to inhibit getting the details while a grid is being updated. Since you have methods to get the data for a grid, set a flag at the beginning and use that in the lower grid GetDetails methods to skip over getting the details if the flag is set. Really, you don't want to get the details until a user selects a row anyway so it won't hurt doing this.
Jason Gleim 25-Feb-13 16:04pm View
   
The grid might be the issue... I've had problems with the rows in grid controls not being walked when searching for UI Elements. For some reasons the element finding methods don't like to walk down the control hierarchy of rows and cells. Probably because the cell content presenter has to be so generic... If I had to hazard a guess, that it where it might be.

It can be very tough to track this down if that is the case. You might have to go at it from a different angle. I would suggest you set a break on the if statement in the button handler and expand out the gr.children property in Quick Watch. See if you actually have the desired button in that collection. You might also unroll some of those statements (like add a line Button target = (UIElement)this.FindName(s);) to see if you actually get an object back and to try to expand out some of those collections.

I also STRONGLY recommend XAMLSpy. It will allow you to walk the visual tree at runtime so you can see where these UI elements are living. I imagine it is a case of the button not going where you think it is or that FindName is not recursively walking the controls collection of the row/column. XAMLSpy will break all that out for you. There is a free trial so maybe it will be enough to get you past this.

Good luck!
Jason Gleim 25-Feb-13 15:10pm View
   
The picture isn't that useful as it is a diagram you have drawn rather than a screen-shot of the actual problem. Even referencing your diagram it still isn't really clear what exactly you are trying to do. You suggest the method is working but the body of your question leads us to believe it isn't. You, obviously, have a much better understanding of what you are trying to accomplish... you just haven't conveyed enough of that idea to us to understand where you are going.

To maybe address your question more directly, there is no difference between a button created in code and one create is xaml... they are both instances of the Button class. When a button is created in xaml, it is inserted into a specific spot in the visual tree based on how it is declared in the xaml. When you create a button in code it isn't present in the UI until you insert it into the visual tree as part of a parent control's children collection. You seem to be doing that although there are obviously big chunks of code missing from your post.

From the code you posted it also looks like you are sometimes assigning a value to the tag property and sometimes not. However, again, I can't really be sure if that is the case.

You might want to consider editing your question and maybe clarify a bit more for us. Everyone seems to be a bit confused by what you are describing and what the actual question/problem is. If you could better define that we will be able to more directly address the issue for you.

Thanks
Jason Gleim 21-Feb-13 16:46pm View
   
Using your example and extending it to your other problem, the issue that we are facing is that we need to update the data on a regular basis. So let's assume person 1 gets a new address every 2 seconds, you want the lower grid to update every 3 seconds to show the new data. This isn't difficult, you just need to understand the relationship between the selected person in the top grid and the address data in the lower grid. You have correctly bound the selected item (selected person) to a property on your view model. That is where it all starts...

If you set a breakpoint on the setter for the Selectedperson property (on the view model) you will see that the grid passes an object of type Person in as the value when the user selects a row in the top grid. I'm assuming that in that setter you are assigning the results of Person.GetDetails to the Details property on the View Model. This, in turn, would update the rows in the details grid. You say that all of this is working, which is good, so now we simply need to build off of that.

When a user selects a new row, it fires off the method to get the details for the selected person. You essentially want the same thing to happen but on a regular interval. So create a timer in your view model. When the selected row is changed (and the setter is executed), after you assign the details to the Details property, start the timer.

In the timer's callback (for the tick event), disable the timer then simply replicate the code you are already using to set the details. So it would probably be something like:
Details = Selectedperson.GetDetails();
Then, re-start the timer. This will cause the Details property to be updated each time the timer ticks pulling in any new rows that you would have for that person. (... or host) Make sure you check that Selectedperson is not null before you make that call and restart the timer. If it becomes null, you don't want to keep firing the timer.
Jason Gleim 8-Feb-13 9:51am View
   
>> If you want to speak for Microsoft keep going, but when you say "While java was published and microsft was already underway" it tells a lot.

How so? Are you suggesting that when Java was released Microsoft should have abandoned its work on .NET? Further to that idea do you think that anyone should abandon their ideas if someone else comes out with something similar? If so I guess we could make the point then, that since I am right and you are wrong you should shut up.

>> For me both of them commercial product. Both of them will do their best to promote their applications.

Yes... they are both commercial products.. and C# is also an ISO standard (ISO/IEC 23270:2003) just like C++ is (ISO/IEC 14882:2011). And yes... the respective companies will promote their products... that is what companies do so people get interested in them and spend their money on those things. I'm beginning to get the idea that you are one of those OSS snobs that thinks anything released for profit is evil.

>> Where as only few is out their to speak for compiler like c/c++.

Yea... because nobody knows who Dennis Ritchie and Brian Kernighan are or what GCC is.

>> I saw thousands words for VB while I was student, after release of C# it become a piece of crap for every one. C#, Java both are bullsh*t.

Not sure what your point is here but you've proven you can use big-boy words. Are you disappointed that C# effectively killed VB5/6 development? Why all the anger at C# and Java? Did they gang up and molest you in a bathroom somewhere?

>> Corporation employed so many hours to make it easier for the programmers.

Yea... because if it is easier for programmers the company makes more money and they pay the programmers better. It is the circle of life. Learn how the world works.

>> What I see with about C#? you can drag and drop your button on the form.

You should probably try creating a Hello World program in C# before you go off claiming that the best you can do in C# is drag a button on a form. I'll write a desktop app in C# that will look better, run better, and will take a quarter of the time than what you can write in C/C++.

>> If you compare with C# and Java, all C# programmer use Win32 API in their application. When you use win32 api in the application, its not comparable with JAVA anymore, JAVA speaks about portability, C#????????

You are, once again, wrong. C# and VB.Net run on the .NET framework. Although they can call system API's, they don't run directly on the system... they run in a JIT compiled framework. Just like... wait for it... JAVA!!!! Oh yea... there is the Mono framework for running .net applications on Linux. Does knowing that piss you off too because the purity of Linux is being polluted by Microsoft?

Further, nobody is claiming .NET is designed for portability. Objective-C isn't portable... even the various strains of Java have their limitations and ties into the underlying platform.

>> You can try to explain the power of C#, but I am too stubborn to understand or accept, that speaking for C# is nothing but promotional talk.

You misspelled 'ignorant' there...
Jason Gleim 8-Feb-13 9:29am View
   
I'm not sure where you make the claim that the concept and structure of C# is from Java... the concept and structure of C# is from C/C++. (Try looking it up on Google or Wikipedia) Java, also, bases its syntactic structure mostly on C/C++. (Again, look it up before you run your mouth) Claiming that C#'s lineage is based on Java is like claiming that apples and oranges taste the same because they are both round.

Further... I have no idea what you are talking about when you say I can prove my point by finding a "customize class" because I don't know what the hell you are talking about. Any class can be considered a custom class and if you are suggesting VB.Net doesn't have classes, I laugh at you for being so totally misinformed.

You people are chiming in without any clue what you are talking about. Mohibur doesn't even realize that this thread is about C# and it's relation to Java/VB... in his world apparently no other language is valid but C. Must be a small world...

And you, Aweiwei, think you can toss around some words and put it back on me to prove my point... well... I can do that:

Here is why C# is closer to VB.NET than it is to Java:
- C# and VB.Net were developed in parallel specifically for targeting the .Net Framework. VB.Net was developed to allow programmers familiar with the Visual Basic syntax to quickly convert and write applications for .NET. C# was developed to allow programmers familiar with C/C++ to quickly write applications for .NET
- Syntactic sugar are where the differences in the two languages end for all intents and purposes. They both compile to MSIL and they both run on .NET. Save for a few differences (lambda expressions for one), the languages support the same set of features.
- There are many code converters which translate C# to VB.Net and back again. Why can they do this? Because they are the same beyond the syntax and rely on the same base class libraries. I'm not aware of a Java to C# converter.

And... just to rub salt in... if C# was so close to Java, why does J# exist? Oh yea... to ease Java developers onto the .NET platform. Although J# never really took off, the question still has to be asked... if C# came from Java then why would MS write J#?

Finally, if either of you were informed you would know that there are significant differences in application execution, especially around performance, memory management, and how the garbage collectors work. One could argue those are runtime differences rather than language differences, which is true, but provide more circumstantial evidence that C# does NOT owe its existence to Java.

Sorry kids... C# did not come from Java and you have done nothing but reinforce my belief that there is a group of elitist Java people that think computers and modern languages didn't exist until 1995 and that everything which has come since owes its adulation and very existance to Java. A language is a tool... just like a screwdriver or a wrench. And there is a proper one for each problem. (Are you reading this Mohibur?) Arguing about which is better is silly and can left to the young children.
Jason Gleim 7-Feb-13 10:30am View
   
- The load data method in the log data model takes the unique key and fetches the log records for the selected host. It, in turn, sets the logData property to the resulting data set.
- The log grid's datasource property is bound to the logData property on the log model via the exposed property on the view model (viewModelLogDataModelProperty.logData). It detects that there is a new set of data exposed on that property and it updates its visual to display the new record set.

It may help too, to visualize it like:

/- HOST MODEL
VIEW <-> VIEWMODEL
\- LOG MODEL

Long answer... took two replies... sorry if you got 20 e-mail updates while I was trying to compose this... I hope it helps!

Jason
Jason Gleim 7-Feb-13 9:59am View
   
Your viewmodel is the datacontext for the entire view... not just the datagrids in the view. The view model needs two properties which expose the data tables... one for the host grid and one for the log grid. You would have one for the log as well that exposes the log model on the view model. I used an Observable collection to hold the host records in this example but you can use any type which implements IEnumerable. (Colection, Array, DataTable, etc)

Note that you can expose as many data models on a single view model class as you need to... in your case it would be one for each grid. But it could be 20 if that is what the view called for.

Since these properties on the view model expose the records (your data models), and the viewmodel is the data context for your view, the grids will bind to the data via the model properties exposed on the view model. Because your view model implements INotifyPropertyChanged, the grids will, behind the scenes, hook the PropertyChanged event on the view model and look for the property they have bound to (hostData or logData for example) to change. When they detect that event, they know to re-populate the grid with the contents of those data objects. You don't have to do a thing... it just happens.

Each grid then, exposes a property called 'SelectedRow' which will be set to the instance of the record which has been selected by the user. You bind that to a property on the viewmodel using a two-way binding (SelectedRow="{binding hostSelectedRow, mode=TwoWay}") which will tie the property on the view model to the selected row on the grid. The selected row on the grid and the property value on the viewmodel automatically stay in sync because of the binding engine. You can, therefore, know that the user selected a new row when the property setter for the selected row property on the view model changes... the grid is the source of that change and it is in response to the user selecting a new row.

You should consider changing the data model as well. I typically use the model to encapsulate everything to do with the data. I usually put a LoadData and a SaveData method on the model (as appropriate) as well as a property that exposes the current collection of data records. The data source for a grid is then bound to that property on the model via a property on the view model. To unwind that, the view model has a public property of type data model. The data model has a public property which is a collection of the data rows. The grid's datasource property is bound to ViewModelDataModelProperty.DataModelDataProperty. Then, in the setter for the selected row property (on the host grid) you would call something like _logDataModel.LoadData(value.uniqueKey).

The event flow then would look something like this:

- View loads and initializes an instance of the view model. The view sets its data context to that instance.
- The view model creates instances of the data models.
- The view model calls LoadData on the host data model.
- The host data model fetches the host list from whatever and sets its hostData property to the resulting data set.
- The host grid's datasource is bound to the host data model's hostData property via the view model. (viewModelHostDataModelProperty.hostData) It detects that the hostData property has changed (it is now populated with the host list) so it updates its visual displaying the list.
- The user clicks/touches a row in the host list.
- The host grid sets its SelectedRow property equal to the instance of the selected host record. The SelectedRow property is bound to a corresponding property on the ViewModel.
- The property setter for the SelectedRow property in the view model class fires. In the setter, you call logDataModel.LoadData passing the unique key from the selected host record.
- The load data method in the log data model takes the unique key and fetches the log records for the selected host. It, in turn, sets the logData property to the resulting data set.
Jason Gleim 7-Feb-13 9:27am View
   
Doesn't matter if you agree or not, it doesn't change the facts. Remember that Java wasn't released until 1995 and Microsoft was already well underway with the .Net framework and the new language just as Java was being released. So you are going to try to tell me that MS, who did everything their way, thought Java was so brilliant they copied it for their new language? That's laughable.

And if you are so convinced c# came from Java, then you should be able to backup your opinion by quickly identifying 5 or more features of c# that are shared between it and Java that aren't present in VB.Net. And if you can't do that, then you should stop posting your opinion in places where you can't back it up.
Jason Gleim 6-Feb-13 22:18pm View
   
Not to troll (ok... maybe a little), but C#'s lineage identifies much closer with VB than it does with Java. I know that makes the c# purists go batty but it's true. Wrap VB in curly braces and you've invented c#.
Jason Gleim 6-Feb-13 22:11pm View
   
Yea... especially since this is in asp according to the op. You can quickly make the web server cry if you are spinning a bunch of threads off of a session thread as you'll hold all the server resources until every thread completes and gets released (even using the thread pool). Scalability becomes a problem quickly.

I don't know how much support there is or isn't for parallel tasks in asp.net apps but that might be a better route. The parallel task libraries know how to break up the task according to the server architecture optimizing for number of cores and such. Much smarter than the thread pool and, IMHO, easier to write against.
Jason Gleim 6-Feb-13 21:37pm View
   
Are you targeting WinRT or full on Windows 8?
Jason Gleim 24-Jan-13 19:52pm View
   
Yes... that will happen. When the code you wrote hits a key that it can't read because of an exception, execution will break out of the loop and hit the catch block. No further processing will take place. This is how exceptions are structured... they are exceptions to the normal flow of the code.

That is why I suggested you test the permissions before you attempt to read the value of the key. Then you can gracefully handle the issue by not ever reading the key and generating an exception thereby staying within your loop and moving onto the next key.

Look up the security classes on MSDN and educate yourself on the proper way of doing this. I gave you the namespace and the classes you need to look at... you should be able to take it from there.

Good luck!
Jason Gleim 24-Jan-13 11:58am View
   
If you write the function CreateNodes as

Try
For Each vSubKeyName As String In vRegKey.GetSubKeyNames()
...
Next
Catch ex as Exception
End Try

... you are getting a runtime exception in the application? Or is it breaking in debug mode (because you have 'break on exception' turned on)?

Jason Gleim 24-Jan-13 11:42am View
   
No worries Jake! Everyone is a beginner at some point and we're all here to help each other get better! I hope your project goes well.

Fortunately, there is a lot of documentation out there on the things I suggested... some of that stuff is just in the 'corners' of the framework that people don't generally come across. I did make a mistake though... I referred to the DirectoryWatcher when in reality it is the FileSystemWatcher class in the System.IO namespace. Since it seems your app is mainly working with files, I would suggest going through that namespace and becoming familiar with the classes in it and what they offer. There is LOTS of really useful stuff in that space.


If you find yourself in a corner, shoot me a PM, I'll see if I can give you some help.
Jason Gleim 16-Jan-13 14:59pm View
   
Yea... eff the code police... too many people willing to tell you that you shouldn't be doing this or that when it does nothing to address the problem you really have. When it comes down to it, you need to do something that makes the most sense for the project even if it doesn't "follow the rules".

You are right, OOP is designed for reuse but there are no hard and fast rules there. You have some natural encapsulation around a 32-bit dword because you can easily represent a node of system memory. Ideally, that is your atomic unit which has properties and methods on it and can be re-used by extension throughout your application. Sometimes that just doesn't work out. I looked at your solution you posted and it will certainly work. It is straight forward and self describing. If I were you I'd walk away knowing what you have done will work.

If I'm ever in KC I'll have to look you guys up. In in Columbus, OH and don't get that far west too often. Best of luck!
Jason Gleim 16-Jan-13 11:13am View
   
Is SQL Server running on your development machine or on another machine? If it is on your machine you aren't doing something silly like trying to run both versions (2010 and 2012) at once? If it is on a remote machine, have you tried using WireShark to look at the traffic between the two systems?
Jason Gleim 16-Jan-13 10:12am View
   
OK... I think I understand what you are going for. I'm not aware of a means to do exactly what you are looking to do but I think there is a workaround that would reduce the amount of work you would have to do but still allow you to work with friendly names in derived classes.

So if I understand you correctly, you want a base class (something like "BitBaseClass") with properties bit0 thru bit 31. You would like to inherit that class creating an instance for each block of memory, for example "Station1", "Station2", "Station3", so that you get all of that storage and bit mechanisms in those derived classes for free. But rather than address bits as Station1.bitX, you would rather address it as Station1.EndOfTravelPositive but use bitX in the base class as the storage bit. The problem here, of course, is that to expose "EndOfTravelPositive" on the derived class means manually creating that property and getting/setting bitX as the backing store for that property. If each "friendly" bit in the project has to be done this way then what is the point of the base class?

The bad news is that there is no way to alias a property in the way I think you want to do it. If would be nice if you could markup a property with something like:

[PropertyAlias="EndOfTravelPositive]
Public Property Boolean Bit0

... but alas, there is no such thing.

That being said... there may be a method that would get you close to what you want. It is possible (and not that hard really) to use reflection to get and set property values at runtime BY NAME. Therefore, in a derived class such as "Station1" it would be possible to get and set the underlying "bitX" properties in the base class simply by name. Your derived classes would then have a method, such as "SetBit(bitName as string)" and GetBit(bitName as string) where you would match up a friendly name like "EOTPositive" to a backing bit property (say bit7) and then use reflection to get/set the bit7 backing value. You would maintain these mappings (between friendly name and bit location) in a dictionary (which is a key/value pair collection) allowing you flexibility in naming the bits. The only drawback is you would NOT get Intellisense for friendly names in this case. The Station1 class, for example, would show bit0 to bit31 properties and the GetBit/SetBit methods, but since the friendly names exist internally in the dictionary, they would not pop-up... you would have to know the names when working with them in the class. (Although if you wanted to hard-code them into an enum, you could work with that and it would give you Intellisense)

Since the mapping dictionary gives you the ability to easily change the friendly names/bit mappings, you can persist that information in a data table or an XML file. You could even go a step further if you had multiple 'station' classes by creating a dictionary of stations driven from a similar config. Then your machine configuration is completely dynamic and could be changed with a simple configuration file. Of course, the logic for each station would likely be different but there are some schemes which could address that as well.

While this wouldn't fit exactly what you want, I think it would give you the flexibility you would want without too much hard-coding or a lot of extra copy/paste/change work.
Jason Gleim 15-Jan-13 16:31pm View
   
Have you checked the .pst files? By default (starting with Outlook 2010) Outlook creates a pst file for pop or imap accounts and delivers the mail there. You actually have to go through a lot of hoops to get Outlook to deliver the mail into the Exchange folders/ost file and I'm not even sure you can do it without a live connection to an Exchange server. The .ost file, by default, only contains messages that really live on a server.. Exchange or Windows Live Hotmail... so Outlook considers it disposable. See http://office.microsoft.com/en-us/outlook-help/introduction-to-outlook-data-files-pst-and-ost-HA010354876.aspx for information on the file types.

Have you looked in the default data file location for a pst with the same name as the server account? If you created the pop account MyPOPAcount, you would find a "mypopaccount.pst" file in the default data file location. You can load these through the open -> outlook data file menu option.

What you describe leads me to believe that you added a pop account into Outlook, it connected to the server and downloaded all the messages (default setting), and you are now trying to recover them on the client. According to my experiences, if you didn't make any explicit changes to the pop delivery method, the missing messages should be in a pst file in the default data location. I hope this is the case for you!
Jason Gleim 15-Jan-13 14:56pm View
   
Just a word of warning... you should hook and unhook those events as-needed. Obviously, MouseMove generates a crap-load of events so you should only hook your event handler just before you need the data and then unhook it when you are done. And you should keep your event handler short and sweet. If your handler takes longer to execute than it takes for the next event to arrive, you can fill the event queue and bog down your app and/or start dumping events.

Processing events is one thing, processing events that generate hundreds or thousands of interrupts per second is a whole different beast.
Jason Gleim 15-Jan-13 14:50pm View
   
Do you have access to the WCF service & associated source code? Are you able to debug both sides of the call? (I ask because I'm wondering if there is an unhandled exception in the service which may be causing the abort.)

Also, have you tried WCF Storm or WireShark to manually test the call and/or sniff the traffic in-flight to see if you can get an idea of where it might be failing?

I would start with WCF Storm and try making the WCF service call to see if that part of the equation is even working. At least you cut in half the locations where the problem can be.
Jason Gleim 15-Jan-13 14:45pm View
   
Is your Outlook connecting to an Exchange server or a pop/imap server? It makes a big difference.
Jason Gleim 15-Jan-13 12:54pm View
   
Where are you trying to put the new .ost file? And, why are you trying to relocate it? The .ost file is just a local copy of the Exchange data so Outlook can start up faster. Everything is on the Exchange server so even if you blow away the .ost file, nothing in the user's inbox changes.
Jason Gleim 15-Jan-13 12:21pm View
   
We are here to help but the request needs to be specific. Your plea for help is way too general and we are not in the habit of doing projects for people... especially ones that are clearly homework. Most all of us went through university ourselves and had to do these projects on our own... many before CP existed... so we won't just hand over the answers to you. That would be dishonest if you turned in our work and represented it as your own.

Further, if there is a sample on the site that will meet your requirements, why are you not searching the site yourself? We are not here to type your search query into the search box and filter the results for you. We can't read your mind and know where you are having problems so we can't do the searches for you.

If you are having specific issues... for example, you don't know how to link up an event to an event handler... we can help with that. But before you come to us you should search for the information yourself.

Lastly, I'm really worried that you are in above your head. You are faced with a big project and just now you are looking for samples to learn from? A professor would not give you a homework assignment that you have not been equipped through class to deal with. So either you have not paid attention in class and now you are in big trouble, you are lying to us about your situation to cover your real goals, or quite frankly, you have no business studying software development because something is clearly not clicking. I'm not trying to discourage you, but if you get to this point in your education and you really have no clue how to write the program you have been assigned, then you should seriously re-think whether you are on the correct path.
Jason Gleim 15-Jan-13 12:10pm View
   
It isn't likely there is anything to block to HTML returned by the site when you try to get it from a web client versus a browser. I suggest starting with Fiddler. Download it, follow the directions on intercepting the web request, and see what the server is returning. Right now you don't know what is wrong... if you are behind a proxy, that could be it... or there could be something else causing problems... Start with Fiddler to see the traffic and figure out if the request is even going out and actually coming back to you.
Jason Gleim 13-Dec-12 10:27am View
   
Why make it so difficult? You could do this with a Firecracker X10 Interface and an appliance module. Write code in the language of your choice to send the serial commands to the firecracker. You could have it all done in a couple of hours.

Sorry ryanb31... just realized I replied to your comment instead of the OP. plz forgive :-)
Jason Gleim 10-Dec-12 14:21pm View
   
When you launch an application, if the .net framework isn't running, it must startup. Then, it must load your application's manifest file and parse it. Then it loads your main assembly, compiles it, and starts running it. If it has to jump to another class it will stop and compile it. Remember that .net apps are JIT compiled on-the-fly from MSIL to the binaries as the app is run.

You can improve initial startup with some tricks like delay-loading assemblies your app relies on but which may not be needed till later and avoiding things like initializing classes outside of a constructor (at the class level) when you declare the object. (declaring private myClass myObject = new myClass(); will initialize and create myObject as soon as the class which contains that call is initialized whereas if you do:
private myClass myObject;
void MyContainingClass()
{
myObject = new myClass();
}
The myObject doesn't get explicitly created until the containing class is explicitly created. Which if you do the same thing for the MyContainingClass object, you would put the new MyContainingClass() call after you have displayed the splash screen. Make sense?

Also, are you using the static Main() function as your entry point or is it Form1.Main()? If you use the static one, you have much more control over your application start up. If you use the form-based one, then everything behind your form must initialize before that function is called.
Jason Gleim 10-Dec-12 13:51pm View
   
Your public class Converter is correct... although I wouldn't call it 'Converter'... something less likely to collide with a keyword is probably a better idea... like "myConverter".

So you have MyConverter.cs and in it you have:

namespace BlinkApplication.Converters
{
public class myConverter:IValueConverter
{
...
}
}

After you add that to the project (as it seems you have done) build the project. You should build successfully. This adds the class into the project at the correct namespace for the xaml interpreter to find it. If you don't do this, you won't get intellisence in xaml and VS will tell you the class doesn't exist.

In MainWindow.xaml, you'll add the converter namespace at the top..
xmlns:local="clr-namespace:BlinkApplication.Converters"
Notice that it matches the namespace as declared in the Converters.cs file? That associates the "local" tag with the BlinkApplication.Converters namespace.

Once you have done that, you can declare the converter in the page/window/user control resources:
<usercontrol.resources>
<local:myconverter key="myValueConverter">


Finally... use the converter in the code:

<textblock text="{Binding" somebinding,="" converter="{StaticResource" myvalueconverter}}="">

You should not do anything in the code behind (MainWindow.xaml.cs). Although you CAN assign this stuff in the code behind, it is meant to be declaratively defined in xaml.
Jason Gleim 28-Nov-12 16:59pm View
   
Did you read the message thread on StackOverflow that I referenced above? There is a discussion there of how to do this... but in a nutshell, GetType("type name, assembly name").
Jason Gleim 28-Nov-12 16:06pm View
   
Are you asking me why it doesn't work or are you just telling me thanks for answering that question?
Jason Gleim 28-Nov-12 15:27pm View
   
Ok... so now that I look a little closer, I think you might have a problem. You can't GetType a class that is defined in a different assembly without including the name of the assembly in the string that you pass to the method. Have a look here: http://stackoverflow.com/questions/1825147/type-gettypenamespace-a-b-classname-returns-null

This might be a problem for you because it seems you are trying to use the class as a handle to find the assembly. So you are in a catch-22... you can't resolve the class type without the assembly name and you can't resolve the assembly name without the class type. You might have to approach this differently.

There are a couple of articles about locating and loading assemblies at runtime here on CP that might be a help. I have used an interface library before with a static class that would locate an assembly which implemented a given interface, load it, and instantiate concrete objects from that assembly. You might have to do something similar.
Jason Gleim 28-Nov-12 14:38pm View
   
Looks like if you change Type.GetType(className) to typeClass (so you are passing in the type you already resolved) it should work.
Jason Gleim 22-Nov-12 22:59pm View
   
Two things... make sure your REST service is up and running before you try to run the app. If the service was also part of your solution, then VS is starting the built-in IIS server and launching the web service for you when you are debugging. It won't be that polite when you run the app independent of VS. As a test, you should be able to enter the service endpoint URL into a browser and get back a WSDL or xml response or something. (other than a 404 or 500 :-) )

Second, download and install Fiddler. It proxys your web calls so you can 'insert' it between your app and the web service. You can see the calls on the "wire" to figure out what is going on. It should be standard equipment for anyone working with any type of web service.
Jason Gleim 22-Nov-12 22:54pm View
   
Anytime you use a class from a DLL it must be referenced in your project. Start by making sure that when you expand the references node, you see the DLL listed. If it has a yellow bang on it, there is a problem. Right-click and select properties to see the info on the DLL. There is a property, Use Specific Version, that may be set to True. If so, and you have linked the DLL in from the other project's bin directory, that is your problem.

Alternately, you can add the DLL project to your solution, delete the reference to it in your service project, and then add it back as a project... (it will list it on the projects tab in the DLL chooser) not a dll. When you do that, VS is smart enough to deal with the builds.

HTH
Jason Gleim 22-Nov-12 0:20am View
   
It's probably because an exe suddenly appeared in your AppData path. The bad guys like to download their trojans into AppData so they avoid the temp internet location and because they don't (yet) have elevated permissions to install to %windows& or program files. AVG probably just tripped on its heuristics filter when it saw the exe appear. Assuming you did a fresh build it would seem to be a false alarm.

I'm not familiar with AVG but most of them have the ability to ignore specific folders or files. You might also try putting your projects in the documents branch... the scanner won't get so mad at exe's popping up then.
Jason Gleim 22-Nov-12 0:14am View
   
When you say 'vps' do you mean VPN? As in a Virtual Private Network?
Jason Gleim 20-Nov-12 15:11pm View
   
Sounds like you should write a program to do that. I bet with a little research you could probably put together something nice.

Now... if you need someone to write one for you, well, I can be bought.
Jason Gleim 20-Nov-12 13:46pm View
   
Is the class lib is a separate project? If so, how did you add a reference to the DLL in your service project? Did you reference the actual DLL or did you add it as a linked project?

If the DLL is a different project, and you linked to the DLL, you may have that link set to use a specific version of the DLL in the service project. In that case, if you change the DLL, and rebuild it, the versions won't match and your service project won't be able to resolve the specific version of the DLL it is looking for.
Jason Gleim 19-Nov-12 11:10am View
   
Earloc is right... Web Service calls are made on another thread to achieve the async nature of the call. Awaiting the call doesn't eliminate the extra thread... it just makes the whole thing synchronous without all the crappy workarounds. When the suspend event is raised, the runtime won't allow you to spin up additional threads... you are supposed to be suspending... not starting new work.

Suspend gets called whenever your app is no longer the focus. So if the user switches app via the charms flyout or the windows key, opens the start screen, closes the lid on the Ultrabook, whatever else... Windows will raise the suspending event to let you know. The idea there is that your app will QUICKLY persist any state information that it needs before being suspended. (as memory may get erased... object state is not guaranteed in the suspended state.)

Earloc is also correct that you can ASK for a deferral but it does NOT guarantee you will get one. I think there is a limit of either one or two deferrals before Windows will just suspend you anyway.

There is not a lot on this wrt Win 8 yet. But the same functionality has been around in WP7 since the beginning. There is a LOT written on it, the thinking behind it, and how to handle it. It should all be applicable to Win 8 as the mechanisms are very similar. I would suggest looking that direction for more information.

For Win8 RT apps though, you generally need to get away from the always-connected paradigm. Win 8, RT especially, runs much more like a mobile OS. A user could spin up your app, use it for 5 seconds, then task switch and you would get dehydrated. You could spend the next week that way before the user comes back to your app. You HAVE to be able to handle that situation. If there is a login component to your database, you may wish to consider an identity provider in between your app and the DB. Databases aren't good at user management and login sessions... identity providers are... and can marshal the security requirements of a call to a DB web service before it is made. A lot of web sites use OAuth 2 as a means of providing a renewable login token (persisted login) for API calls or web interfaces.
Jason Gleim 19-Nov-12 10:40am View
   
Yes and No. If you give us more information we can give you a better answer.
Jason Gleim 13-Nov-12 14:58pm View
   
Add the file to the project and then open its properties. Change the file type to Embedded Resource.
Jason Gleim 12-Nov-12 16:05pm View
   
Some more information is required. What is happening and what do you have installed? Are you on a 64-bit system and if so, did you setup the 32-bit install and TNS file(s)?
Jason Gleim 11-Nov-12 16:14pm View
   
Each control has a bounding box property which gives you the top-left corner of the control as well as the length and width. You simply need to walk through your nodes collection each time you update the ball's position and test it the ball is within the bounds of one of the nodes. If so, change the color of that node. Remember, by using a for..each over the nodes collection, you get a reference to each node you can do the math against then change the color.

More generally, this is called collision detection. If you look at some of the game development tutorials, they all address collision detection and talk about implementing an algorithm that will work for your approach. You might dive into some of the XNA tutorials especially will cover this and might help you improve your structure.
Jason Gleim 10-Nov-12 22:24pm View
   
I can't speak to Amazon but I just wrote an article on using Google Drive. I imagine must of the process is the same once you get past the authentication specifics. So I would suggest looking at the amazon API documents. The google api docs were a huge help. And, In the case of Google, there was a .net library that implements all the functions.

Second, you don't have to convert everything to vb. You can add a second project into your solution, make it a c# library, then add the code files for the 'overhead' stuff. Add a reference to it in the vb project and all those classes become available in vb for your consumption. You don't need the source code for opensslkey... just the classes it exposes. So wrap them as-is and just use the resulting dll. Don't be afraid of c#... it is just vb with semi-colons. :-)
Jason Gleim 10-Nov-12 22:08pm View
   
Overflows almost always come from loops in the code or adding large numbers and trying to put the sum in a register that is too small. If you run the app with small numbers and it still overflows, it is probably a loop. (hint... hint)

Since this looks like a homework assignment though... don't expect anyone to tell you where the error is. We don't do homework assignments... you don't learn anything that way.
Jason Gleim 10-Nov-12 22:01pm View
   
Can you tell us what it is or isn't doing? Just saying you are having problems and posting the code isn't much to go on. Unfortunately the batteries in my hand-held mind reader are dead so you'll have to tell me what error you are getting.
Jason Gleim 10-Nov-12 21:58pm View
   
Given that the data won't change very often, you might want to put it into an XML file. Then you could read it into a collection of objects in code and use linq to search the data very fast. You can include the xml file in the application setup.

You could also do a web request on a background thread to check for an updated file at a given URL and pull it down if it finds one available. Or, pull down the original file that way... that way each client starts with a current copy... IF you can count on Internet access.
Jason Gleim 9-Nov-12 14:05pm View
   
Why don't you make each access point an identity provider then tackle it as a federated identity issue? So Client A would authenticate with AP 1. When client A roams to AP 2, it would present the authentication token from AP 1 (which includes the fact that it came from AP 1). AP 2 would look to see if it trusts AP 1 (which it would) and if so, it would check with AP 1 to see if Client A's token is still valid. By doing this, each access point only has to keep track of the clients it has authenticated and which access points it trusts. If a client presents a token from an AP that is trusted, and the token is still valid, then the new AP can accept the client as trusted because of the federated authentication.

In terms of scalability, this is the only way to do it. Trying to build and maintain tables of what clients are authenticated to what access points would become a maintenance nightmare. (Imagine a large building where there were over 1000 access points!) Not even considering how to add and remove trusted access points from every other access point. You would quickly end up in circles and the whole protocol would become too bulky. The federated security model is used by web sites all the time. Even CodeProjects accepts Google, LinkedIn, and Facebook as third-party authentication providers. You can apply the same concepts at the AP level and, I think, solve your problem.

Good luck!
Jason Gleim 9-Nov-12 12:55pm View
   
It isn't Silverlight. The Silverlight runtime runs on the client computer... not the server... the only thing the server does is provide the .xap file to the client. Therefore your problem is in your WCF service. I would start there. You might want to instrument it with the ANTS Memory Profiler from RedGate software. You can download a trial and give it a go. Should be able to help you find the leak.
Jason Gleim 9-Nov-12 12:45pm View
   
It sounds to me like you are interested in mesh networking. That is a newer area and so information might be harder to find. Plus, there are a BUNCH of competing implementations, some open, some closed. I'm not sure you will be satisfied with what you find.
Jason Gleim 9-Nov-12 12:30pm View
   
Why do you have a server for each client? That is probably your issue... I don't see how your servers are talking to each other (that isn't jumping out to me at least). If you create more than one server, you have to deal with cross-process communication and I don't see any of that framework in your app.

Plus, just as a general point of design, wouldn't it make a lot more sense to have a single server that all of your clients talked to rather than having each client talk to its own server just to have the servers talk? Seems like a wasted extra layer there.

Fiddler is a debugging tool. You use it while you are working on your program and change back the service references when you are done. You can't (and wouldn't) ship it with your program. It is sort of like WireShark but it is designed to spy on http traffic and not packets on the wire like WireShark. You may want to look at the fiddler web site to learn more about it. For anyone doing any type of http stuff, they should have it installed.
Jason Gleim 9-Nov-12 12:21pm View
   
Let me add too that you might just want to start with the basics of how wireless network works before you try to get into the tough stuff. For example, do you know the differences between the different standards? (a/b/g/n) Do you know what the hidden node problem is? Do you know how a device associates with an AP to establish a connection? Do you know how congestion control is managed and what a back-off signal is? Do you know how roaming clients are handled in a network with a centralized controller versus one without? All of these are probably questions you should know and understand before you try to jump into complex topics like encrypted bridges and mesh networking. Again, there are lots and lots of resources out there you can find on Google and in books. There is no shortcut though...
Jason Gleim 9-Nov-12 12:15pm View
   
The protocols are not typically mathematical as they are really functional implementations. Remember that network communications rely on the 7-layer model to provide different levels of service. None of that is really mathematical in nature. The encryption, of course, is a different story. It is all mathematical.

But to answer your question, no... there is no easy path to understanding and becoming familiar with all of this. It takes a lot of time and a lot of understanding... and in many cases not just with software but also with hardware, electrical, and cryptography. It is all very complex in nature and while the specifications aren't written to promote understanding (as they have to be very precise) there are many people who have written on these subjects to try to make them more accessible and understanding. You will have to do the research yourself to find the areas you are interested in and to become an expert in those areas.
Jason Gleim 9-Nov-12 11:39am View
   
https://www.google.com/webhp?q=ansi+802+standards
Jason Gleim 9-Nov-12 11:37am View
   
My suggestion would be to split the server and the client out from each other. Make the server it's own application and launch it prior to launching your test clients. Isolating the components will help figure out what is going on.

Also, since you are using http, have to tried instrumenting it with Fiddler? You can proxy apps like this through fiddler (even if they don't support a proxy) by setting the service endpoint to http://ipv4.fiddler. (instead of localhost) You should be able to see the calls between the client(s) and the server that way.

Jason Gleim 9-Nov-12 11:17am View
   
Just curious... do you have Windows Firewall disabled on your test machines?
Jason Gleim 9-Nov-12 10:57am View
   
You can manually create a right-click pop-up menu using the ContextMenu class. You'll have to declare the items in the menu, link their events, and then add them to a ContextMenu instance. Do this for each of the two menus you want to have. Then, when you type-cast the node as in the answer above, just call the show method on the appropriate menu in the appropriate try/catch block. If you can successfully cast to a TreeViewNode object, show the menu for that. If that fails and you end up in the catch block, show the other.

Note that if you implement this logic you will probably want to use the Mouse Right-click Down event rather than the up. And be sure to set the 'handled' property on the event args parameter to true so that further right-click processing isn't done by the treeview itself.
Jason Gleim 7-Nov-12 12:19pm View
   
Why do you want to use a service? It seems you are creating a job execution engine... are the engine and the DB separated by something that requires a web service?

It seems it might be a lot easier to write a regular app that just connects directly to the database, runs the query, then passes it off for processing before it exits. Then set it up as a scheduled task on the database server itself to run every minute or whatever.
Jason Gleim 7-Nov-12 12:13pm View
   
Are you trying to upload the images to a storage location or just load them into a C# project for viewing? Also, Access is a terrible choice to store the images in. I'm assuming they are pretty high-resolution which means they are probably big... access files have a tendency to corrupt if they get big or get accessed a lot in a shared way. Blob storage in the cloud or storing them in SharePoint or even just a directory and keep metadata about them in a separate file or DB would be a better idea.

As for the viewing, your zoom will never be better than the image resolution itself. Microsoft has some controls and information around "Deep Zoom" that you might look into and consider. It might help you project run better from a user point of view.
Jason Gleim 7-Nov-12 12:06pm View
   
Wouldn't it be a better idea to use a Kinect and the associated libraries? The skeletal support and tracking is very good and very fast. Why re-invent all of the image processing work?
Jason Gleim 7-Nov-12 11:47am View
   
Not very clear what you are looking for... you might give us some more information.

Are you looking to pull a word list from a web location and bring it into your application? If so, it would depend on how the endpoint is providing the information. The approaches are different depending on if they are on a web page (you have to request the page then scrape the results), a downloadable text file (you have to download the file then parse it), an XML file (again, parsing), a web service (does it return the list in SOAP, JSON, etc), or some other method? (It could be something exotic like Web Sockets) Each approach has strength and weaknesses and very different implementations.
Jason Gleim 7-Nov-12 11:38am View
   
Is this a WinForms application or a WPF application? What error(s) are you getting? You've brought your car to the mechanic but said, 'something is broke' without telling us what it is.
Jason Gleim 7-Nov-12 11:05am View
   
I can only speak for myself but I imagine most everyone on here will agree... when I went through school one of the things I learned was to think about the problem and develop a solution MYSELF. If I had a deadline, I kept that in mind and DID THE WORK AHEAD OF TIME. There was more than once where my team was up most all of the night working on a project to hit a deadline. That is all part of the learning process.

While there are many of us that can do what you ask, I doubt you will find anyone that will. This is YOUR project... not ours... we won't do your work for you. I suggest you brew a big pot of coffee and get going. If you have a problem and don't understand something about the technology you need to use, then come back here and we will help you understand. But we're not going to do a part of your project for you.
Jason Gleim 3-Nov-12 13:57pm View
   
Without some code it is hard to figure out what is going on. However, if I were to guess, you will find that the data grid and the button are now in two different data contexts. Use a tool like Snoop, XAML Spy, or WPF Spy to look at the tab items when your app is running and you will likely see they are not in the same data context. You will probably have to explicitly set the binding to your view model either in code or in xaml with DataContext="{Binding yourViewModel}"
Jason Gleim 3-Nov-12 13:19pm View
   
No worries... glad I could help. I had to figure a lot of this out when I first started with SL back in the day.

Signing probably wouldn't have given you many advantages. It would allow for the publishing but you would have to have a compatible web server with WebDav or something like that.

If your app required elevated trust settings.. for example if you needed to access the hardware on the machine it was running on or access files outside of Iso Storage... then you would have to sign it to run as a full trusted app. But really, all of that just complicates things for little benefit. I wouldn't worry about signing it unless you have to because of some other need.
Jason Gleim 3-Nov-12 9:22am View
   
You should be able to find your compiled xap as /my app/bin/release/my app.xap. If you found it under my app.web, it is probably the version copied over when you run your app in Visual Studio.

You probably can't publish it directly from VS because it isn't signed. I wouldn't worry too much about that.

The Testpage.aspx, TestPage.html, and Silverlight.js files make up the local test deployment. You could use those as the basis of a web deployment but since they are designed for IIS it may be more trouble than it is worth. It might be easier to follow the directions in that MSDN article I referenced.

As for 'downloading' your Silverlight app, I think we might have gotten confused over the technicalities. To run a Silverlight application, at a minimum, you must have a hosting page (html, asp, etc) and the xap file on a web server. Your app gets opened when someone visits the page that contains your application. This is the same as Flash content or any other embedded add-in. They are all included in the page via an embedded object. Again, the MSDN page goes over all of that.

When someone opens a page in this manner, their browser downloads the xap file, just like it downloads pictures, media, or other page elements. That isn't easily accessible but it can be found because it all goes into the temporary internet files location. But... you can't directly run the xap from there. Even if someone found the downloaded xap, if they double-clicked it, it would not run. It MUST be hosted in a web page.

If you marked your project as an OOB application, an extra menu item shows up when the application is right-clicked in the browser window. That is the "Install Out of Browser" option. Users which select that will "install" the Silverlight app into their machine. It is still possible for that user to run the Silverlight app from the web page but it is also possible for them to run it without the browser. Don't confuse marking a Silverlight app as OOB with turning it into a desktop application... that is not the case.

There are some great articles out there on deploying SL apps to a web server and on enabling OOB. If I were you, I would concentrate on getting the app deployed to an Internet web server first. Make sure all of that is working and you understand the process. THEN move on to making the app OOB. Even if you want the application ONLY available as OOB, you still have to do the first part and get it deployed to a server.

Let me know if that helps!
Jason Gleim 2-Nov-12 19:59pm View
   
You can publish directly to a server and you set that up in Visual Studio. I believe it is part of the build menu but please don't quote me on that. However, there are only two pieces you actually need to deploy the solution on a web server. You need a HTML page that includes the Silverlight runtime object and you need only the .xap file. You will find the .xap in the output of your Silverlight project. There will be a bunch of files and folders in that location but you only need the .xap file, that is your entire Silverlight application wrapped up into one.

To get it on the web, you need to copy it to a location on a web server... it might something like http://contoso.com/silverlight/foo.xap. An FTP client or some other means of getting it uploaded will work here. You should be able to enter the URL into a browser and get prompted to download the xap. If you do, then the xap is ready to go.

As for the html page, you could create that in notepad or use the one in the web project as a basis. It can be a very simple file and instructions on what is should contain can be found here: http://msdn.microsoft.com/en-us/library/cc189089%28v=vs.95%29.aspx Once you have that file, upload it to a web server in the same manner as you did the xap. You should then be able to enter something like http://contoso.com/silverlight/mySLpage.html to open that page (obviously with whatever name and URL you gave it.) If you follow the directions on that MSDN page and adjust your xap path accordingly, it should open the page, load the SL runtime, and start your app.

Understand... this will run your app in the browser... which is how all SL apps MUST start out. ALL Silverlight apps are ALWAYS runable in the browser. If you want to run it OOB, you must right-click on the app in the browser, and select 'Install' from the pop-up menu. When you do that, your machine will download the xap and enable it to be run OOB. The advantage is that it doesn't have to check the server to run the app if it can't reach it. Of course, if you have any web services that depend on a live server, that is a different problem. ;-)

You can detect whether your app is being run in-browser or OOB. If you want it to be an OOB ony app, you have to detect that it is running in-browser and put up a different page that instructs the user to right-click to install it. In this case, it is still running in the browser... you just don't provide any functionality in that mode.

HTH.
Jason Gleim 19-Jan-12 8:52am View
   
I'm assuming you wish to communicate with the service while it is running... you can't do that by just linking against a COM object. You would have to use some method of inter-process communication like named pipes or a socket or something. You could create a class library wrapped for COM that handled the interaction with the service then link against and call into that class.

If you look at services that have a UI component to them, they are done in this manner. The UI part is separate from the service and communicates with it for the interaction. You have to do this because the UI part must be able to spin up/down independent of the service.
Jason Gleim 18-Jan-12 13:48pm View
   
If you are referring to the Ascend library on CodePlex, you would be much better served by asking the question over there. More generally, with a third-party control, there is nothing you, as the control consumer, can do to limit memory leaks or the amount of resources it is using. You will have to find a different control library or write the functionality yourself.
Jason Gleim 18-Jan-12 10:17am View
   
Do yourself a big favor... go out and buy one. It will cost you less and it will work better. Don't try to reinvent the wheel.
Jason Gleim 18-Jan-12 10:00am View
   
Uhh... please tell me those aren't your real tokens...
Jason Gleim 18-Jan-12 9:03am View
   
If you wanted to avoid registration because you needed to swap out different versions of the libraries and let the target app 'find' the latest version by loading it locally, you could write a helper library that did that for you. It would expose your classes as interfaces that VBA could work with but contain logic to locate and instantiate the non-registered dll(s) at runtime. The helper library would, of course, have to be registered so VBA could bind against it but by doing this you can uncouple the VBA and the .net. A lot more complicated but very doable.
Jason Gleim 18-Jan-12 8:58am View
   
I didn't see a code sample. However, the error message looks like a xaml namespace problem. Is the 'r' namespace defined at the top of the xaml in the usercontrol or resource dictionary opening tag?

You can also open the RibbonControl library in the object browser to see all the properties, methods, and classes exposed in that namespace. that might be helpful as well.
Jason Gleim 2-Sep-11 10:14am View
   
If the key doesn't exist, add it. Copy and paste this into a file and name it "linkedconnections.reg" Then run it from an admin account.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]

"EnableLinkedConnections"=dword:00000001
Jason Gleim 2-Sep-11 9:25am View
   
Glad to hear you got it working! Good luck!
Jason Gleim 1-Sep-11 15:41pm View
   
When I've seen this it is because of an issue with SQL Express running on x64. Make sure your project's target CPU is set to x86 rather than 'ANY CPU' or x64. The SQL compact libraries have to run under WOW on 64-bit systems and you have to force the project to target x86 (32-bit) to make that happen.

I *think* there is a service pack for SQL Express 2005 that addressed this... don't exactly remember. You may want to look around for that... not sure on SQL Express 2008 as I haven't run into this using that.