473,796 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsft Photo Editor hanges when printo verb is used

8 New Member
Hello,

I have a small piece of code to launch a file and print it to desired printer. The code is as follows:

Expand|Select|Wrap|Line Numbers
  1. objProcess.StartInfo.FileName = "C:\test.jpg";
  2. objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden | ProcessWindowStyle.Minimized;
  3. objProcess.StartInfo.UseShellExecute = true;
  4. objProcess.StartInfo.CreateNoWindow = true;
  5. objProcess.StartInfo.ErrorDialog = false;
  6. objProcess.StartInfo.Arguments = "HP Lazer Jet 1010";
  7. objProcess.StartInfo.Verb = "Printto";
  8. objProcess.Start();
  9.  
This code works perfect will all files extensions except ".jpg". As soon as i try with ".jpg" Microsoft Photo Editor opens and goes to "not responding" mode.

When I use "print" verb it works well.

I've verified that proper command is given to printto verb in file association.
"C:\Program Files\Common Files\Microsoft Shared\PhotoEd\ PHOTOED.EXE" /pt "%1" "%2" "%3" "%4"

If I manually open a jpg file in Microsoft Photo and print; it works well.

I've tried reinstalling the photo editor but no luck. I'm unable to figure out what's the problem with printto verb.

Please help me.

Regards,
Piyush
Jan 5 '10 #1
6 2400
tlhintoq
3,525 Recognized Expert Specialist
So your application isn't actually printing anything?
You are just trying to cause any file passed to open in its default application and print?
Is that right?
If it were a text file you assume it will open in NotePad?
If it were a jpg file you assume it will open in MS Photo Editor?
Jan 5 '10 #2
piyusht
8 New Member
That's right tlhintoq. I'm just trying to open the file passed in its default application and print.
Jan 13 '10 #3
piyusht
8 New Member
Yes my application causes the file passed to open in its default application and print.
Jan 13 '10 #4
tlhintoq
3,525 Recognized Expert Specialist
But you have no way of knowing what program the user has set as the default for a specific type. On your computer the default for a text file might be notepad. For someone else it might be WordPad. For someone else it could be Microsoft word.
When I use "print" verb it works well.
I'm unable to figure out what's the problem with printto verb.
I've never actually tried doing what you are try so please bear with me.
  • If it works with the "print" verb why not go with that?
  • What does "printto" give you that "print" does not?
  • Have you tried changing the default program for that file type to see if a different program will react the way you want to the "printto" command? Maybe it is a bug is that one program.
Jan 13 '10 #5
piyusht
8 New Member
Hi Tlhintoq,

My idea here is to shell the file and let the application associated with its file extension open the application. That's how it works in Windows as well. File extensions like ".txt", ".doc" etc are associated with some programs and mainly there are three verbs "Open", "Print" and "Printto".

Use can view this in Folder Options-->File Types by clicking the advanced button. Please check the attached file.

I hope it makes it clear.
Attached Images
File Type: jpg folderoptions.jpg (18.1 KB, 226 views)
Jan 14 '10 #6
piyusht
8 New Member
My answers to the questions:
  • If it works with the "print" verb why not go with that?
    That's because "print" verb doesn't allow choosing printer. It prints on default printer that can be changed any time.
  • What does "printto" give you that "print" does not?
    The answer is same "printto" allows to print the file to a specified printer.
  • Have you tried changing the default program for that file type to see if a different program will react the way you want to the "printto" command? Maybe it is a bug is that one program.
    Yes this works with other programs but my issue is specific to MS Photo Editor. If I change it to any other program it work fine, but i cannot guaranty that user's machine will not have MS Photo editor as it is quite common program.
Jan 14 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7496
by: Zeroeffect | last post by:
Hello! I have a database with alot of embedded images. The reason for having the images embedded is security. My problem is that it works fine on my computer, but not on my clients computer. He hasn't got Microsoft Photo Editor installed and because of that he cant view the images when doubleclicking on them in the table. He can still see the pictures in the formview but when he doubelclicks the images a error message shows up.
2
4225
by: falk.strobach | last post by:
Hallo, ich habe mir im Access eine Bilddatenbank angelegt. Die Bilder sind als OLE-Objekt (verbunden mit dem Photo Editor) in der Datenbank enthalten. Mit der Umstellung auf MS Office 2003 gibt es den Photo Editor nicht mehr. Somit kann ich die Bilder nicht mehr in der Datenbank angezeigt werden. Gibt es eine Möglichkeit das OLE-Objekt umzuwandeln? Auch wenn ich dem OLE-Objekt die Klasse einer anderen Anwendung zuweise, hat das keinen
4
2541
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView Inherits System.Windows.Forms.UserControl Private _Collection As GridTableStylesCollection
1
4493
by: Neil | last post by:
I am using ShellExecute to open JPG files with the associated application, MS Photo Editor, from within an Access 2000 application. When the code is run the first time (Photo Editor closed), there's a blinking in my application title bar, and nothing appears. Then, if I do it a second time, Photo Editor appears, but with two copies of the image. And, as long as Photo Editor stays open, the images open fine. But if it's closed, it takes two...
1
2234
by: Throw | last post by:
G'day everyone I'm looking for a simple photo gallery script in PHP (or Perl), but not too simple. I have tried several photo gallery scripts in either language and I have found that they are either too complex or too simple for my purpose. Most photo gallery scripts are intended primarily for sharing new photos continuously and allowing visitors to comment on them. I want something more static, which allows more text content.
4
2010
by: TomA | last post by:
Hi All, I have a picturebox on a form containing the photo of a person. As you advance through the records, the photo updates. Rather than storing the images in an inefficient blob field in a table, I have the separate images stored in an image directory with primary key as the filename (3476.jpg). If the image exists, I display the image. All this works fine. I have a buttons that allow for the insertion and deletion of photos. ...
0
5693
by: nkotbox | last post by:
I have this script to enable/disable my wireless nic on my laptop. Is it possible for the scripts icon or shortcut to the script to change icons depending on whether or not the nic is enabled. So if the wireless nic was enabled then the script icon would be my on.ico and if it were disabled the the icon would be my off.ico heres the script Const ssfCONTROLS = 3 sConnectionName = "wireless network Connection" sEnableVerb = "En&able" ...
25
2342
by: koolj96825 | last post by:
1) Thank you. Thanks to this news group in which I read a post earlier today about making variables static in certain cases, I believe I avoided future debugging headaches. It reminded me of a place in my code where I did that. Thank you! 2) Like I mentioned in an earlier post, I program on the hobby level, but I am working on a project now and so I am coding again, however, it is like being revived from a deep sleep for me. Put it...
4
5510
by: dclingan | last post by:
OS XP Access 2003 additional program available MS Photo Editor 3 I understand Access 2003 did not come with Photo Editor and such needs to be installed. I have done this. I have inserted a photos field in my table and tried to insert the photo by inserting object (the photo is the sample empid1.bmp with office). After I have inserted it I get "package" in the field. Now Access help says this is because Photo Editor was not install, but...
0
10461
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.