Jump to content
Xtreme .Net Talk

Merrion

*Experts*
  • Posts

    269
  • Joined

  • Last visited

Everything posted by Merrion

  1. Yeah - Beta2 though - and since the .Net framework additions for office are probably a further month behind in terms of user testing.... :(
  2. Very cool XML stuff - but oh so unstable... :(
  3. [PLAIN][resolved] Inherits LicenseProvider[/PLAIN] I don't remember being pointed at that URL before but this happens a lot at my advanced age ;) However I looked at it this time and it is exactly what I was looking for. Chuz.
  4. Anybody created a class that inherits from the LicenseProvider class? What goes in the GetLicense function to create the License to return?
  5. You can also define your won new types of attributes by having a class that inherits from System.Attribute - we have custom attributes to track work done to allow billing the various departments for the work done.
  6. Does GOAL/D mean anything to you? Trying to work out if we work for the same "large insurance company"
  7. I have a component that I wish to protect with a design-time license. i.e. when the component is loaded in a .Net IDE it requires a license but apps compiled and distributed with it do not. I am using the built in license providor: LicFileLicenseProvider - how do I tell it to only require a license for design time use? e.g. <LicenseProvider(GetType(LicFileLicenseProvider))> _ Public Class PrintEngine Inherits Component ' Creates a new, null license. Private license As License = Nothing Public Sub New() ' Adds Validate to the control's constructor. license = LicenseManager.Validate(GetType(PrintEngine), Me) End Sub Public Overloads Overrides Sub Dispose() If Not (license Is Nothing) Then license.Dispose() license = Nothing End If End Sub End Class
  8. You're probably better to search the .Net framework to see if it does what you need before worrying about the API. It seems to cover nearly everything.
  9. The rc beta is looking very good - once I read the help files, that is :lol:
  10. As I approach the start of my sixth year here with one client - renewed every six months - that comment has given me a wry smile....
  11. Um - where'd the attachement go? Or have I gone blind...
  12. Attached is code for the Printer Queue watching component...as per the articleprintwatchnetsrc2002.zip
  13. OK - my Guru status is not transferable ;)
  14. Nah - the dll compiled in VS.Net 2003 wont work in VS.Net 2002 - it complains about not being able to resolve something or other. Anyway - two seperate machines with two different setups for the moment until I work out what is going on...
  15. Hmm - probably a good thing considering how good my .Net code is likely to be but not sure if this is a deliberate policy or not?
  16. Checked through the help and it seems that the solution ffile is converted to VS.Net 2003 and this is one-way. So this effectively means we will need to maintain seperate copies of the solution for VS.Net 2002 and 2003 (or only use the older version?)
  17. So - I upgraded to VS2003 and recompiled the prin chserver.net component no problem. Now anybody opening the component from VS.Net 2002 gets a stupid "The implementation has changed" error and if they try to open the source code they get "This code was created with a newer version of Visual Studio" so - in order to run my code they will have to upgrade as well???? Note that the code hasn't actually changed - I just opened it up in VS.Nret 2003 and recompiled it! Any thoughts?
  18. To make a type safe collection, inherit from the DictionaryBase collection and overload the properties Item, Add and Contains e.g.: Public Class Vehicle Public LicencePlate As String '\\This is unique... Public Make As String End Class Public Class VehiclesDictionary Inherits Collections.DictionaryBase Public Overloads Property Item(ByVal LicencePlate As String) As Vehicle Get Return CType(dictionary.Item(LicencePlate), Vehicle) End Get Set (Byval Value As Vehilce) dictionary.Item(Value.LicencePlate) = Value End Set End Property End Class Hope this is useful, Duncan
  19. Good point. I'm still trying to get out of the VB6 mentatilty on this.
  20. Monitoring a print queue from VB.Net Any comments/suggestions for improvement? Thanks in advance Duncan
  21. [PLAIN][Resolved] Marshalling as a pointer to an array of shorts?[/PLAIN] Attached is the source for the first cut of the printer watch component - thanks for your help in getting it this far... pritwatchnetsrc.zip
  22. OK - I have a partial solution as per this article...Derek Stone was right in the first instance...
  23. I may be misreading the documentation, but WMI_Printer doesn't seem to have any spooler type events?
  24. In the VB5 version I pass it an uninitialised long and it puts an address in this long which is an address of the structure that it has allocated e.g.: Dim lpPrintInfoBuffer As Long If FindNextPrinterChangeNotificationByLong(mEventHandle, pdwChange, PrintOptions, lpPrintInfoBuffer) <> 0 Then Call CopyMemoryPRINTER_NOTIFY_INFO(mData, lpPrintInfoBuffer, Len(mData)) '... Which is pretty much what you are saying. However doing the same thing in .Net it doesn't put the address in the IntPtr that I have passed it so I can't use Marshal.PtrToStructure on it. There seem to be two possibilities: (1) The FindNextPrinterChangeNotification function doesn't realise that I am passing it an IntPtr to put this address in or (2) the FindNextPrinterChangeNotification call doesn't realise that pPrinterNotifyOptions is set so thinks I don't want any lppPrinterNotifyInfo back. I am getting the last win 32 error as per your earlier help and it is saying "The operation executed successfully" so I really don't think option 2 is occuring... I know - if only MS would put me out of my missery by adding this stuff to the framework..life could be so much simpler if I could do: Dim WithEvents sp As New Spooler(Printer.DeviceName) Perhaps in version 1.3?
  25. Are you using the StdCall calling convention in your DLL? If not you may have to declare the dll import differently i.e.: <DllImport("dnslib2.dll", EntryPoint:="CanVBSeeThis", _ SetLastError:=False, CharSet:=CharSet.Ansi, _ ExactSpelling:=True, _ CallingConvention:=CallingConvention.Cdecl)> Public Shared function CanVBSee (byval s as string) as long '\\ No code goes here.... End Function Check out the DllImport class for more info.. HTH, Duncan
×
×
  • Create New...