Tuesday, February 24, 2009

Access .Net

When will .net VBA be in Access?
http://www.utteraccess.com/forums/showflat.php?Cat=&Board=84&Number=1685738&Zf=&Zw=&Zg=1&Zl=b&Main=1685689&Search=true&where=&Zu=13965&Zd=l&Zn=&Zt=3e8&Zs=&Zy=

Access 2003 and .net
http://www.utteraccess.com/forums/showflat.php?Cat=&Board=89&Number=1575105&Zf=&Zw=&Zg=7&Zl=b&Main=1574291&Search=true&where=&Zu=13965&Zd=l&Zn=&Zt=3e8&Zs=&Zy=

Windows Spool Files


http://www.undocprint.org/winspool/spool_files
https://www.iterasi.net/Viewer.aspx?RootAssetID=889679


The following information is provided as is, and the authors take no responsibility for the correctness.






Windows Spool Files





Warning While you might use the informations you find here to extract EMF and other data from the Windows spoolfiles, you should remember, that this informations is undocumented and might change without prior notice!


"You can probably locate the information about the EMF structs in
the spool file format. But note that one major caveat with this
approach is that since the spool file format is MS proprietary, it
might change in future releases without notice. So if your driver
is dependent on a particular spool file format, it could break on
future releases. This is the reason for us recommending that you
not rely on the spool file format."
//Ashwin, Microsoft




Introduction





For each print job there are two spool files generated by the Windows NT/2000 spooler. One file with the .SHD extension for job settings, and one with the .SPL extension for the drawing commands.



  • EMF Microsoft® Enhanced Metafile Format


  • SPL Microsoft® Windows Spool File Format


  • SHD Microsoft® Windows Shadow File Format






How to set "Keep Printed Documents"





You can set “Keep Printed Documents” via registry, instead of using the printer control panel. Information about this on the Windows Spooler Registry page.





Printjob size restriction





The maximum size of a printjob on Windows is 4 gigabyte. Jobs that are bigger just drop the page data without any errors. It seems like the spooler just wraps around the internal spool data size counter, when reaching the maximum32bit value.




This size will be further limited if the disk does not have enough free space to store the spool file. When the spool file runs the disk out of space the printer often finishes the job by printing blank pages. No errors are recorded.





Reading job data





Access to the data of a SPL spool file, can be implemented quite easily from within a print processor.




To access the spool stream use the OpenPrinter function, where you specify “PrinterName,Job xxxx” for the pPrinterName parameter. The returned hPrinter handle can be used to read the job data via the ReadPrinter function.




If the printername is "Lexmark W820" and the JobId is 3, the string to be used would be "Lexmark W820,Job 3"




For more information on this see the SDK documentation for OpenPrinter and ReadPrinter.




Information about the SPL file format can be found here: SPL Files.




Comment by Microsoft:


I checked with our developers to find out if there is any change
in behavior as far as spooling of file is concerned in XP compared
to that of Win 2000. The change in XP is that it clears the spooled
file after sending the file to the printer. On the other hand in
Win 2000, the file is kept until the printer prints the file. For
this reason you are getting garbage reading in XP, but as you
mentioned that if you choose to keep the document in the spooler
"Keep printed document" in the Printer properties, it works.

This is a design change in XP behavior, not a bug.

Though the documents does not say that ReadPrinter should not be
called from the driver, the actual use of ReadPrinter is in the
print processor. Relying on reading the spooled file may cause
problem in later OSes. But developers still read the spooled file
to get specific information. The change in behavior in XP and Win
2003 caused problem to some third party print management programs.

The following article describes the problem you are seeing and
provides suggested workarounds:
http://support.microsoft.com/default.aspx?scid=kb;en-us;815913
Third-Party Print Management Program Does Not Work as Expected
After You Upgrade to Windows Server 2003 or Windows XP

In addition to the two workarounds you found, this article has
another workaround of creating and setting the
DisableServerFilePooling in
HKLM/System/CurrentControlSet/Control/Print reg_dword with
value greater than zero.



Comment by Christoph:


Contrary to Microsoft´s statement, that "ReadPrinter should not be
called from the driver", tests have showed, that it is possible to
use ReadPrinter from a printer driver. Only the ReadPrinter calls
should be done from DrvStartDoc. Remember to call
RevertToPrinterSelf!




Force JobID in Spoolfile names





On Windows NT/2000 find the files by name xxxxx.spl where xxxxx was the JobID returned by the EnumJobs API.




However, XP and 2003 create spool files named FPnnnnn.spl where nnnnn is no longer the JobID.




This is the side effect of file pooling. You can “turn off” Spool File Pooling by keeping printed jobs or specify a different spool directory. The workaround to this is as below:





To Turn Off Spool File Pooling on a Per Printer Queue-Basis




  1. Click Start, click Run, type regedit in the Open box, and then click OK.


  2. Locate the following registry subkey, where <printername> is the name of your printer: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\<printername>


  3. In the right pane, right-click SpoolDirectory, and then click Modify.


  4. In the Value data box, type the location where you want the spool files to be stored. For example, type c:\windows\system32\spool\printers as the default location.


  5. Quit Registry Editor.


  6. Restart the Print Spooler service.





All new jobs will be of the form XXXXX.SPL and XXXXX.SHD and will be numbered consistently with their JobIDs.





To Turn Off Spool File Pooling for All Printers





Note: This method only works on Windows 2003 Server. This method does not work for Windows XP.



  1. Click Start, click Run, type regedit in the Open box, and then click OK.


  2. Locate the following registry subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print


  3. On the Edit menu, point to New, and then click DWORD Value.


  4. In the New Value #1 box, type DisableServerFilePooling, and then press ENTER.


  5. Right-click DisableServerFilePooling, and then click Modify.


  6. In the Value data box, type 1 to turn off spool file pooling, and then click OK.


  7. Quit Registry Editor.


  8. Restart the Print Spooler service.





All new jobs will be of the form XXXXX.SPL and XXXXX.SHD and will be numbered consistently with their JobIDs.





When is RAW used?





A Print Processor must support the RAW data type or it simply won’t work. Beyond that, the data types it supports have little effect.




The decision on whether to spool EMF or RAW is made by GDI based on various factors.




Here are some of the factors:




Firstly, if the app uses the print APIs directly, it can specify whatever datatype it wants. But if the app prints through GDI:




We’ll go RAW in the following cases:



  • Printing to FILE:


  • Printing directly to port (no spooling)


  • Client disables “advanced printing features” in printer properties.


  • Some drivers always print RAW, regardless of all other options. e.g. “HP LaserJet 4100 PCL 6” from HP Homepage


  • Acrobat Reader prints PDFs to printers with a postscript driver as RAW postscript files.





Additionally, for networking printing:



  • Client is anything other than NT/Win200/XP


  • Client doesn’t use a “true” connection


  • Printing to a “masq” printer (win9x, netware, etc.)


  • Server has “printer attribute RAW only” bit set


  • Server doesn’t accept client’s EMF version





So there is no real guarantee that you will get on particular datatype or the other.




Make sure the PRINTER_ATTRIBUTE_DIRECT and PRINTER_ATTRIBUTE_RAW_ONLY attributes are not set for the printer.





Misc.



















winspool/spool_files.txt · Last modified: 2008/12/08 08:58 by christoph



















All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).
Disclaimers



Recent changes RSS feed

Powered by PHP

Valid XHTML 1.0

Valid CSS

Driven by DokuWiki







Tuesday, February 17, 2009

Vista Installed on USB Hard drive Creating A Bootable WinPE 2.0 USB Key Create a Bootable Windows PE RAM Disk on UFD Separating Vista and XP

Vista Installed on USB Hard drive:
http://www.vistax64.com/tutorials/204022-vista-installed-usb-hard-drive.html
https://www.iterasi.net/Viewer.aspx?RootAssetID=844730

Creating A Bootable WinPE 2.0 USB Key:
http://windowsconnected.com/blogs/joshs_blog/archive/2007/02/05/creating-a-bootable-winpe-2-0-usb-key.aspx
https://www.iterasi.net/Viewer.aspx?RootAssetID=844723

Create a Bootable Windows PE RAM Disk on UFD (USB) By MS:

http://technet.microsoft.com/en-us/library/cc766092.aspx
https://www.iterasi.net/Viewer.aspx?RootAssetID=844719

Separating Vista and XP when using Vista's Boot Manager:
http://themudcrab.com/separatevistaxp.php
https://www.iterasi.net/Viewer.aspx?RootAssetID=844715

Personal Firewall reviews

http://www.matousec.com/projects/firewall-challenge/results.php

Symantec Norton Recovery Disk (NRD) ISO image download

Symantec Norton Recovery Disk (NRD) ISO image download

community.norton.com/norton/attachments/norton/uploads/42/2/MakeNewNRD.pdf

http://209.85.129.132/search?q=cache:DM1bMFcA83kJ:community.norton.com/norton/attachments/norton/uploads/42/2/MakeNewNRD.pdf+ftp.symantec.com+public+english_us_canada+recovery+2009+NIS+recovery_nis_x86.iso&hl=en&ct=clnk&cd=1

https://www.iterasi.net/Viewer.aspx?RootAssetID=843220

http://www.qitera.com/pages/cached/id96ee5627e096e31c4e98a9f6ee22592917

http://cid-2d044dc4a5aa3245.skydrive.live.com/self.aspx/.Public/Norton%20Recovery%20Disc%20%7C5NRD%7C6.pdf


Tuesday, February 3, 2009

Using The Microsoft InteropForms Toolkit v2.0 To Display .NET Forms In A VB6 Application - Interop Forms Toolkit - VB 6.0

http://blogs.vbcity.com/shandy/articles/8912.aspx

The Microsoft InteropForms Toolkit v2.0 allows a VB v6.0 application to display .NET forms from within the VB6 application. This article is specifically for displaying forms and does not involve the use of .NET controls. I found information on how to do this on the internet a bit patchy, especially as I was converting existing forms rather than using the templates provided to create new .NET forms. All my experience is in using VB6 and VB.NET 2005.

  1. Download and install the Microsoft InteropForms Toolkit v2.0.
  2. Configure the .NET project you want to access from VB6. There are two basic methods you can employ to do this:
    • You can create a project from scratch using a ready made template installed by step 1. This template is located in the New Project dialog box under Visual Basic, Windows, My Templates and is called VB6 InteropForms Library.
    • You can convert an existing VB.NET project.
      • If the application type is not already a Class Library you will need to change it to a class library. You do this in the Project Properties, Application, Application type:
      • Ensure the assembly is COM Visible. You do this in Project Properties, Application, Assembly Information..., Make assembly COM-Visible.
      • Ensure that the application is registered for COM interop. You do this in the Project Properties, Compile, Register for COM interop.
      • Add a reference to the VB.NET project to the Microsoft.InteropFormTools.Dll library. By default this is located at c:\program files\Microsoft Visual Basic 2005 Power Packs\Interop Forms Toolkit 2.0\SDK\Libraries. You do this in Project Properties, References, Add...
  3. Configure the .NET forms you want to access from VB6.
    • Additional, new forms can be added using the Project, Add New Item, My Templates, VB6 InteropForm.
    • Existing forms can be modified.
      • Place the statement Imports Microsoft.InteropFormTools at the top of the form.
      • Place the statement _ on the line immediately before the form class definition.
      • The form class must have a constructor with no parameters.
  4. Within the .NET project create the InteropForm wrapper classes.
    • Use the Tools, Generate InteropForms Wrapper Classes option on the VS IDE menu bar.
    • This will create a folder in the Solution Explorer called Interop Wrapper Classes.
    • Each form class marked as an interop form will have a corresponding wrapper file created in the InteropForm Wrapper Classes folder. The corresponding wrapper file is named with the format .wrapper.vb. This file extends the original class.
    • If you change information such as the form class name you will need to re-create the InteropForm wrapper classes. I therefore advise re-creating the Interop wrapper classes before rebuilding the project.
    • Creating the InteropForm wrapper classes will mean you will lose any modifications you manually made to the InteropForm wrapper classes.
    • The re-creation of InteropForm wrapper classes will not remove any wrapper classes previously created for a form class that is no longer marked as an InteropForm. You must remove these manually.
  5. Build the .NET project.
  6. Configure the VB6 Project To Display The .NET Form.
    • Add a reference to the Microsoft Interop Form Toolkit Library.
    • Add a reference to the .NET project DLL.
    • Ensure that the .NET forms are properly cleaned up by the VB6 application.
      • Declare a global instance of the toolbox.
        Public g_InteropToolbox As InteropToolbox
      • Instantiate the toolbox, call Initialize on it for debugging support, and then signal the start of the application when the application starts (Sub Main or Main Form Load):
        Set g_InteropToolbox = New InteropToolbox
        ' Call Initialize method only when first creating the toolbox
        ' This aids in the debugging experience
        g_InteropToolbox.Initialize
        ' Signal Application Startup
        g_InteropToolbox.EventMessenger.RaiseApplicationStartedupEvent
      • Signal the shutdown of the application when the application ends (Sub Main or Main Form QueryUnload):
        g_InteropToolbox.EventMessenger.RaiseApplicationShutdownEvent
    • Add the code to call the .NET form.
      Dim oForm As ProjectName_FormClassName
      Set oForm = New ProjectName_FormClassName
      Call oForm.Show

Mimmo97 Blog Archive