473,811 Members | 3,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ShellExecute

Dear Guru,

From Dos Command, I can execute like C:\Converter TextFile.txt or
C:\Converter D:\TextFile.txt

I wrote an application (using VC++) to call a dos command, where
sztxtBuffer1 is the select / browse text file, and Converter.exe is located
at the same directory/ folder with this application.
I tested that the following is not working well.
int ret = (int)ShellExecu te(hWnd, "open", "Converter.exe" , sztxtBuffer1 ,
NULL, 0);

How can the application look for Converter.exe at the current direcotry,
instead of specifying the absolute path of Converter like

int ret = (int)ShellExecu te(hWnd, "open", "C:\Converter.e xe",
sztxtBuffer1 , NULL, 0);
Because the application and converter can be installed at any directory.

Thanks.
Nov 22 '06 #1
1 4139
magix wrote:
Dear Guru,

From Dos Command, I can execute like C:\Converter TextFile.txt or
C:\Converter D:\TextFile.txt

I wrote an application (using VC++) to call a dos command, where
sztxtBuffer1 is the select / browse text file, and Converter.exe is
located at the same directory/ folder with this application.
I tested that the following is not working well.
int ret = (int)ShellExecu te(hWnd, "open", "Converter.exe" ,
sztxtBuffer1 , NULL, 0);

How can the application look for Converter.exe at the current
direcotry, instead of specifying the absolute path of Converter like

int ret = (int)ShellExecu te(hWnd, "open", "C:\Converter.e xe",
sztxtBuffer1 , NULL, 0);
Because the application and converter can be installed at any
directory.
Your question doesn't belong here. You need to post your OS-specific
question to 'comp.os.ms-windows.program mer' (or any of its subgroups).

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Nov 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2568
by: Marcel Sammut | last post by:
Greetings, I am converting a VB6 application to .net and am having troubles trying to print a document directley to the printer. My VB6 app used the API ShellExecute method to accomplish this, however, needed the printer name, driver and port. All which were obtainable using the Printer object in VB6. Now in .net, I've tried using the System.Drawing.Printing namespace to do this, but that is unsatisfactory. So I went back to the API...
3
5475
by: Wiktor Zychla | last post by:
I have a problem I cannot solve. My application hosts IE activex control. I follow the standard procedure: I just aximp shdocvw.dll. Note that this gives you two files: axshdocvw.dll and shdocvw.dll. And there comes the problem. I reference the libraries from my project. For this to work, I put the libraries in the same directory as the application. Now, from my code I try to ShellExecute to a link (to show it in a new window):
1
2315
by: MCzajk | last post by:
Is there a function similar to ShellExecute, which I can hook to when the program is started using Start Menu icon? MCzajk
11
81736
by: Le, Thanh-Nhan | last post by:
Hi, Is there a same function in .Net as API shellexecute? Thanks Nhan
0
1837
by: the_openFace | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd, string lpOperation, string lpFile,
0
1600
by: the openBack | last post by:
I'm trying to display the shell's property page for various files and I'm using this code: class Win32Shell { // ... other stuff here public static extern Int32 ShellExecute( Int32 hwnd, string lpOperation, string lpFile,
0
1860
by: David | last post by:
We have an mfc application in which we use ShellExecute to launch the browser with an initial web site. {ShellExecute( NULL, "open", "http://www.SomeWebSite.com", NULL, NULL, SW_SHOWNORMAL ) } This always worked without problems until... We have modified the application so that it now contains some managed C++ and C# code (in dll's). The call to ShellExecute is in an unmanaged C++ dll. When trying
4
3431
by: fdmaxey | last post by:
I currently start a target executable written in VB.Net from an application that uses a C-script language. I start the target executable using ShellExecute in the C-script. The target runs fine like this except for the fact that the target can't write to a log file. If I run the target independently of the C-script application, the log file is created and written to without a hitch. There is no error produced - the log file just...
1
3101
by: bugs bunny via .NET 247 | last post by:
Does anyone have actually used SetWindowsHookEx() to hook upShellExecute() so as to find what application was started bywindows or which folder is currently browsed by explorer. I knowone thing and that is ... Windows uses ShellExecute() to doalmost every task. I need some implementation help. I want to trigger an userdefined function when suppose Notepad is opened or in simplecase a messagebox that says Notepad has started. If anyone has a...
2
10744
by: John Smith | last post by:
Hi, I have an access database form with an image. I'm trying to create an onclick event on the image so that when a user clicks on the image it opens that file with the default viewer the computer is set on. I've searched the web and nothing solid. I did get the following VBA code and it doesn't seem to work. If anyone can help me i'd appreciate it. From the code below txtImageNote is a field on the form that displays the path to...
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
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...
0
10127
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
7665
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
6882
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
5552
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.