ShellExecute 32 bit API Call

Hi!
I am trying to use ShellExecute API function with PB 5.0.2 32 bit and WIn
95/NT.
When the function is called, I get a message 
"Error Calling External Function ShellExecute"
Can somebody tell me what I am doing wrong?

Local Function Declaration

FUNCTION ulong ShellExecute ( ulong hwnd, ref string lpOperation,
  ref string lpFile, ref string lpParameters, ref string lpDirectory,
  integer iShowCmd) LIBRARY "shell32.dll"


User Object Function Script

// This user object function receives the argument, as_docname which is the
full path and filename to be opened


ulong ul_returnvalue
string ls_operation, ls_filename, ls_parameters, ls_directory, ls_errormsg
SetNull(ls_operation)
SetNull(ls_parameters)
SetNull(ls_directory)

ls_filename = as_docname

ul_returnvalue = This.ShellExecute( Handle(g_w_frame), ls_operation, &
	 ls_filename, ls_parameters, ls_directory, 1 ) // 1 - SW Normal

Thanks

0
Chandra
8/15/1997 8:31:02 PM
sybase.powerscript 7704 articles. 0 followers. Follow

5 Replies
713 Views

Similar Articles

[PageSpeed] 31

 Add this to the end of your declaration

ALIAS FOR "ShellExecuteA"

hth
Bill Green[TeamPS]

Chandra Kalyanaraman wrote in article
<01bca9c2$4a315d70$b16464c1@chandra>...

>Hi!
>I am trying to use ShellExecute API function with PB 5.0.2 32 bit and WIn
>95/NT.
>When the function is called, I get a message
>"Error Calling External Function ShellExecute"
>Can somebody tell me what I am doing wrong?
>
>Local Function Declaration
>
>FUNCTION ulong ShellExecute ( ulong hwnd, ref string lpOperation,
>  ref string lpFile, ref string lpParameters, ref string lpDirectory,
>  integer iShowCmd) LIBRARY "shell32.dll"
>
>
>User Object Function Script
>
>// This user object function receives the argument, as_docname which is the
>full path and filename to be opened
>
>
>ulong ul_returnvalue
>string ls_operation, ls_filename, ls_parameters, ls_directory, ls_errormsg
>SetNull(ls_operation)
>SetNull(ls_parameters)
>SetNull(ls_directory)
>
>ls_filename = as_docname
>
>ul_returnvalue = This.ShellExecute( Handle(g_w_frame), ls_operation, &
> ls_filename, ls_parameters, ls_directory, 1 ) // 1 - SW Normal
>
>Thanks
>


0
Bill
8/16/1997 2:46:15 AM
This right, if you ask me, declaration is:

function ulong ShellExecuteA(
    ulong hwnd,	// handle of parent window
    ref string  lpszOp,	// address of string for operation to perform
    ref string  lpszFile,	// address of string for filename
    ref string  lpszParams,	// address of string for executable-file
parameters 
    ref string  lpszDir,	// address of string for default directory
    long wShowCmd 	// whether file is shown when opened
   ) library "shellapi32.dll"

HTH
-- 
- Met vriendelijke groet,

  Eric Aling [TeamPS], Cypres Informatisering bv, The Netherlands
  http://ourworld.compuserve.com/homepages/alingejj


Chandra Kalyanaraman <kalyanc@sourcesvc.com> wrote in article
<01bca9c2$4a315d70$b16464c1@chandra>...
> Hi!
> I am trying to use ShellExecute API function with PB 5.0.2 32 bit and WIn
> 95/NT.
> When the function is called, I get a message 
> "Error Calling External Function ShellExecute"
> Can somebody tell me what I am doing wrong?
> 
> Local Function Declaration
> 
> FUNCTION ulong ShellExecute ( ulong hwnd, ref string lpOperation,
>   ref string lpFile, ref string lpParameters, ref string lpDirectory,
>   integer iShowCmd) LIBRARY "shell32.dll"
> 
> 
> User Object Function Script
> 
> // This user object function receives the argument, as_docname which is
the
> full path and filename to be opened
> 
> 
> ulong ul_returnvalue
> string ls_operation, ls_filename, ls_parameters, ls_directory,
ls_errormsg
> SetNull(ls_operation)
> SetNull(ls_parameters)
> SetNull(ls_directory)
> 
> ls_filename = as_docname
> 
> ul_returnvalue = This.ShellExecute( Handle(g_w_frame), ls_operation, &
> 	 ls_filename, ls_parameters, ls_directory, 1 ) // 1 - SW Normal
> 
> Thanks
> 
> 
0
Eric
8/20/1997 7:09:33 PM
I think you will still have a problem even when you change the ShellExecute
to ShellExecuteA.  I was getting the "Unsupported argument type" runtime
error when I called this function with NULL for the operation, parameters
and directory arguments.  If you pass the NULLs by value instead of by
reference it will work.  

FWIW I believe that you  could pass them by reference without a problem (or
that you had to do it that way) in PB 4.


0
Rick
8/21/1997 1:41:15 PM
>> ... library "shellapi32.dll"<<

That will give you some trouble.  "shell32.dll" is what you want.



0
Rick
8/21/1997 1:42:54 PM
<HTML>
Rick Redpath wrote:
<BLOCKQUOTE TYPE=CITE>>> ... library "shellapi32.dll"&lt;&lt;

<P>That will give you some trouble.&nbsp; "shell32.dll" is what you want.</BLOCKQUOTE>
Just a reminder:&nbsp; Before you write Win API function, check out <A HREF="http://www.ultranet.com/~dsalomon/api/">http://www.ultranet.com/~dsalomon/api/</A>

<P>You can find all the information you need.
<BR>&nbsp;

<P>--
<BR>Lijun

<P>-----------------------------------------
<BR>Lijun Yang mailto: Yangl@sprintmail.com
<BR>Pinnacle Decision Systems, Inc. <A HREF="http://www.pinndec.com">http://www.pinndec.com</A>
<BR>-----------------------------------------
<BR>&nbsp;</HTML>

0
Lijun
8/21/1997 3:19:26 PM
Reply:

Similar Artilces:

Changing 16 bit API calls to 32 bit API calls.
Hi. I have an application which i am migrating from 16 Bit PB4 to 32 bit PB5. I have the following 16 bit API calls in the application. Can someone please let me what the corresponding 32 bit API calls would be and what libraries i can find them in? Also, where can i find information on API calls? function int FindWindow(string lpClassName, string lpWindowName)LIBRARY "user.exe" function int Winhelp(int iWindowHandle, string lpszhelpfile, uint fuCommand, long dwData) Library "user.exe" function ULONG MAPISendDocuments(uLong ulUIParm, string lpszDelimChar, string ...

16 bit and 32 bit api calls from PB app.
Hi, i have an application that i want to run on both windows 3.1 and windows 95 pc's. however, i am making some api calls in this application. i would like to make 16 bit api calls if the pc is running 3.1 and 32 bit calls if it is 95. is there any way i can find out what operating system the pc has, as soon as my app is started up? any help will be greatly appreciated. thanks, Rohit Look at the environment object. This is what you need. Regards, Costas Tsaklas[TeamPS] Elevated Technologies, Inc. - New York www.elevatedtech.com Rohit Sankholkar wrote in message ...

PB 16 bit and PB 32 bit and API calls
Hello, I am trying to do a API call for a fingerprint reader. I have done all of the global declarations and I am sure all variables are mapped correctly. I don't get any errors from the function I am calling into, however I do get a PB error on the Global function I declared. The error is telling me that there is an invalid stack pointer. This function returns the number of the device which was created which is essentially a pointer. My question is this. Since I am running PB 7 which is 32 bit is it possible that if these ..DLL's I am calling into is 16 bit will I get ...

Converting 16-bit API calls to 32-bit using pbm_commnotify
I'm converting an old PB5.0 app to PB6.5 and having problems with API calls to do a credit card validation via modem. The original code appears to have been copy/pasted with only minor modifications from Sept/1995 PowerBuilder Developer's Journal ("Serial Communications Manager" http://www.sys-con.com/pbdj/source/995/robinson.htm). Now I need to make it work with 32-bit APIs. I've never worked with serial communication before, so I feel a bit like a fish out of water here. Any help would be greatly appreciated. The main problem I'm experiencing is with the p...

32-bit API Calls
I am trying to access the comm port in order to read data from a special input device. Does anyone have an example of how to do this. Thanks, Mike Christopher ...

Problems with 32 bit api call.
Hi, I am trying to run a dos command from my powerbuilder app, which zips a db file and copies it to a network drive. i want my powerbuilder app to wait till the dos command is done. the way i was doing this in windows 3.1 was to open a response window and use the run command in the open event of the response window to fire off a PIF file, which ran the dos batch file. I then started a timer event. In the timer event, i used the Findwindow api function to check whether the dos window was still open. if it wasn't, then i closed the response window and continued. In windows 95 ho...

32 bit calling 16 bit
Hi! We're trying to upgrade an app from PB5.02 - 16 bit to 6.5. The trouble is that we call a lot of third-party 16 bit DLL's. Both our interface and the third party part does database calls (MS SQL Server 6.5 SP5). Can anyone shed some light on how we'd do this? (One friend mentioned we needed a "thunk" layer. Another didn't think you could "thunk" PB. I don't know enough about "thunk" to know what to think...). Thanks! Dennis Dennis, >We're trying to upgrade an app from PB5.02 - 16 bit to 6.5. The trouble is &...

Calling 16 bit dll from 32 bit Powerbuilder
I want to know if it is possible to call a function out of a 16 bit dll from within a Power Builder App that was compiled in 32 bit. If so, How ? Hi, No. This is not possible direclty. The most simple way is to get a 32bit version of that DLL, but you probably don't have that right? So, your in deep shit. You could create a thunking layer, which is a 32bit layer, converting 32bit calls to 16bit but this is not an easy task to do. Other option is creating a 16bit VB oleserver which calls your DLL. This ole server can be used within your 32bit PB environment. But first, try to g...

call 32 bit method from 64 bit application?
Hi to all, I have some questions 1. I have a Bit64 application, if i call the Bit32 application method then will it work or not? 2. I have a bit32 applicaation, if i call the Bit64 application method then will it work or not? 3. What is the negative point while converting Bit32 application into Bit64 application ? 4. I came to know if we are using API calls then we should consider this while convert the application from bit32 to bit64, here i changed the code based on bit64 managed code, now i try to run the applicaton in Bit32 so i change the Active Solution Platform into Any CPU(X32) ...

Calling 16-bit functions (DLL) from 32-bit App?
I've migrated a 16-bit app to a 32-bit app recently. The one problem is that we purchased a communications DLL from a third party who has since gone out of business, so there's no chance at getting a 32-bit version. The DLL is 16-bit, and PowerBuilder (32-bit) has a problem opening the library. Is there anyway to call functions in a 16-bit DLL from a 32-bit application? Chris, Unfortunately not. Unless the DLL is 'thunkable', then it can't be accessed from PB. Who is/was the 3rd party vendor? hth, -- Anthony M. Perugini Principal Consultant CPDP,...

Calling 16 bit DLL from 32 bit PB app
Is it possible to call a 16 bit C DLL from a 32 bit PB application? If so, what is the correct calling convention in C. I am using PB 6.5.1 Thanks, Brian Wetzel wetzelb@mindless.com On Tue, 18 Apr 2000 17:24:23 -0500, "Brian Wetzel" <wetzelb@mindless.com> wrote: I seem to recall there used to be a white paper on the Sybase Web site describing how to access 16 bit ODBC from 32 bit PB. That makes me thing that it is possible, but I don't remember the specifics. You might want to check out the Sybase site and see if you can find anything. I'll check...

pascal(16-bit) or standard(32-bit) calling sequence
Is there any info on the Pascal(16-bit) or standard(32-bit) calling sequence, apparently C++ DLL's must be in this format in order, for PB to call them as local external calls, any examples...? My MS-VC++ source: // TestDLL.cpp : Defines the entry point for the DLL application. // #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } bool TestDLL() { return true; } I'm sure there is info available on this s...

32-bit COM server called up in 64-bit COM server
I have an existing custom COM server written in Delphi XE4 (sorry, no funds to keep up with all the new releases) and compiled for 32-bit platform. I now want to recompile this for a 64-bit platform. The problem is that this server calls up another server which is only available as 32-bit. I know it is frowned upon to mix 64-bit with 32-bit code, but this is the one allowed way of doing it. The 32-bit server is registered with the surrogate mechanisms provided by the operating system, so that the 64-bit a pp can call the 32-bit server. I use the component import wizard to build the necessary ...

API Call ShellExecute
I need to call the API function ShellExecute from PowerBuilder and i've allready made the object with the external declaration, all i need is to know how to call it in the script. Since it has many referenced arguments, do i have to make a structure or something ... please help. No structure needed. Your External declaration ought to look something like this: Function long ShellExecute ( long hWnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, long nShowCmd) library 'shell32' alias for 'ShellExecuteA' In your script, just ca...

Web resources about - ShellExecute 32 bit API Call - sybase.powerscript

User Account Control - Wikipedia, the free encyclopedia
version also present in Windows 7 and Windows Server 2008 R2 . It aims to improve the security of Microsoft Windows by limiting application software ...


Binary Planting Goes "EXE"
Yesterday, Apple issued new versions of the Safari browser that fix a binary planting vulnerability our company has reported to them in March ...

Third-party Updates Not Enough to Plug Hole in Windows Shell
It's another humbling admission that would have been distinctly uncharacteristic of Microsoft just years ago. But this morning, the company's ...

VeraCrypt - Documentation
An open source disk encryption tool with strong security for the Paranoid

BT 下载器下载的安装文件被杀毒软件卡住的问题
... 客户端分发给客户的标配了。 rainfiel 同学在一个多月前主动领了这个任务,对 BT 的开源库考察一番后使用 libtorrent 开发这个下载器。 最近在测试的时候发现了一个问题,成功下载完安装包后,如果系统安装有 卡巴斯基 或 360 等杀毒软件,就会在调用 ShellExecute ...

Firefox 2.0.0.6 fixes yet another protocol-handling bug
Mozilla Corp. updated the Firefox browser for the second time this month to patch a pair of vulnerabilities, including yet another flaw in how ...

I am Ironman: DEEP PANDA Uses Sakula Malware to Target Organizations in Multiple Sectors
Over the last few months, the CrowdStrike Intelligence team has been tracking a campaign of highly targeted events focused on entities in the ...

Operation Double Tap
APT3 (also known as UPS), the actors responsible for Operation Clandestine Fox has quietly continued to send waves of spearphishing messages ...

Analysis of MBR File System Infector
F-Secure Security Labs brings you the latest online security news from around the world. Ensure that you are up-to-date with the latest online ...

Resources last updated: 12/6/2015 7:05:34 PM