Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Studio 2003.NET+ShellExecuteEx() in Windows Vista Business

Status
Not open for further replies.
Nov 2, 2006
4
0
0
US
Hi all,
I'm not a Visual C++ program but only a system administrator. Due to the nature of newly-purchased computers are all bundled with Windows Vista, I need to modify a simple application. The purpose for this application is to fetch Windows contacts list from the server through FTP connection then execute the self-extract compress file into Windows Vista's User Contacts folder for Windows Mail ( a successor for Outlook Express).
I've modified it and tested it on my Windows XP with all exact folder and file paths as the Windows vista environment has. This application ran flawlessly.
After that, I copied the application and related .ini file in a Windows Vista-based PC. After unblock the built-in firewall setting, it didn't run as expected. I'm wondering if there's any particular UI component or shell component I need to include in the header.
This application is developed under Visual Studio. NET 2003 on my Windows XP Professional.
Here's the brief codes in the application:
.
.
.

#include <shlobj.h>
#include <shlwapi.h>
#include <ShellAPI.h>
.
.
.
SHELLEXECUTEINFO sei;
sei.fMask = NULL;
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.hwnd = NULL;
sei.lpVerb = "open";
sei.lpFile = "C:\\Users\\SALES\\SALES.exe";
sei.lpParameters= NULL;
sei.nShow = SW_SHOWNORMAL;
sei.hInstApp = NULL;
sei.lpIDList = NULL;
sei.lpClass = NULL;
sei.hkeyClass = NULL;
sei.dwHotKey = NULL;
sei.hIcon = NULL;
sei.hProcess = NULL;
sei.lpDirectory = "C:\\Users\\SALES";
int ReturnCode = ::ShellExecuteEx(&sei);
.
.
.


Can anyone shed lights on this problem for successfully running on Windows Vista Business?
 
When you say it "didn't run as expected", what does that mean? Did you get any errors? Did it crash? Did it not run at all? and what part of it didn't work?
 
No error, no crash.
Actually I found what the problem is.
The Vista has much stricter on files security settings. After applied the folder setting, this application ran perfectly.
Thanks
 
Precisely why I never plan to downgrade to Vista! ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top