Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. What currently happens if the user attempts to save files to the %windir% folder? Are you catching any errors thrown when attempting to save files but not relaying the information to the user?
  2. If the child class implements the ISerializable interface then you would save / load the required bits but just don't save anything regarding the event.
  3. This would be a pretty unusual use for a menu - normally the do not behave in the way you are asking. Could you not have the various options also available through a tool strip - that way they would be available all the time.
  4. The only problem I could see is if the local bin directory contains newer versions of existing components.
  5. It looks as though the automatic serialization support is attempting to serialize the target of the event (i.e. Parent) as this also happens if you don't declare it WithEvents but use the AddHandler statement instead. If you implement the ISerializable interface however you have control over what does and doesn't get serialized - that should avoid this problem.
  6. If you delete the bin folder on the target server before publishing does that make a difference?
  7. Welcome!
  8. You could either have the add ons raise an event that the main program handles by simply re-raising the event or provide a callback routine to the add on as an alternate means of notification.
  9. Perhaps I'm being a bit thick but I'm still not sure exactly what you are after. Are you wanting the main program to raise the events on behalf of the add ons or are you wanting the add ons themselves to raise the event?
  10. The likelyhood of the order being changed is going to be virtually nil - this could break far too many things. Personally I would use readability as a guideline - is it obvious what the line is doing? If so leave it alone, otherwise rewrite it to be more obvious.
  11. Have you tried Private Delegate Function MessageBoxHandler(ByVal Message As String, ByVal Style As MessageBoxIcon) As DialogResult Private Function ShowMessageBox(ByVal Message As String, ByVal Style As MessageBoxIcon) As DialogResult Return MessageBox.Show(Message, My.Application.Info.AssemblyName, MessageBoxButtons.YesNoCancel, Style) End Function ... aa = Me.ShowMessageBox("a", MessageBoxIcon.Question)
  12. You change the delegate to return a DialogResult rather than being a sub, then have the ShowMessageBox routine return the MessageBox.Show response.
  13. An interface can contain event declarations, could you not just includse the event(s) as part of the iAddon interface?
  14. System.Drawing.Imaging.Metafile is probably the best option, msdn has some information however it does look a bit of an odd class to work with at first glance. Edit: Ignore me, as usual marble eater is talking sense and bothering to do real research...
  15. Creating a new string builder is perfectly fine when you need to start again. Regarding checking if the string builder is empty or not depends on what you are doing - checking if it is equal to nothing simply says if the variable is initalised or not. You may also wantto check the Length property to see if you have a valid string builder but no content.
  16. Can't remember where I read it but I'm sure Microsoft never actually produced a 64 bit version of the Jet provider. You would probably need to convert the data base to something else (SQL Express for example) to take full advantage of a 64 bit environment.
  17. Could you not just display the relevant images next to the menu items, that way the button image would match with the menu item.
  18. Depending on your needs the two easiest ways are: 1) Pass a callback function to the thread so the thread can call this method as a means of signalling the parent. 2) Declare an event the thread can raise to signal the parent. Another possibility is if the parent thread has a message pump (normally means it is a UI thread) the background thread could use either the SendMessage or PostMessage APIs to signal the parent. Personally I would choose either the callback or event based methods though.
  19. AcceptTcpClient is a blocking call anyway - it waits for incoming connections before proceeding (hence the reason it isn't run from the main UI thread). The comment was really aimed at the while true construct - normally I prefer to have a proper exit condition rather than just quitting out of a loop.
  20. Without more detail nobody is able to give you an answer... If your users are on dial up or similar and you just want to hang up when the work is finished then you could find http://www.pinvoke.net/default.aspx/wininet.InternetHangUp useful. If you mean something else however you will need to provide more specific information.
  21. I'll either dig up some links or post something here soon...
  22. If you do not change the method signatures then there would be no need to recompile applications that use the shared library - you would just copy a new version over the old version and things would be fine. However if you want to do things properly you should be providing each released version with a different version number and also make sure each released version has a strong name. This however will prevent you simply replacing an old version with a new version... One benefit is that a new version can be installed along side an old version, that means you do not need to be as rigorous when checking backwards compatibility... If you want an existing application (or all applications) to use the new version you can create a binding redirect - this will allow an old client to use a new version of the library without a recompile. For critical updates you can also provide a publisher policy which forces existing applications to use the new version unless they opt out.
  23. What are you connecting to? How are you currently keeping track of open connections?
  24. Looks like an awful lot of .Net 2 stuff on the exam... Hope they focus more on Linq otherwise it will be hard to tell who really knew the 3.5 stuff and who got by on the 2 and earlier material.
  25. The actual initalisation is done in the .locals init ( [0] int32 j) bit. The runtime appears to always initialise variables, c# requires an explicit assignment before use though... In fact if you change the c# version to be int j = 0; then you get exactly what you expected.
×
×
  • Create New...