16-bit API calls for file information?


    Does anyone know a way in which to get the date, version, etc.
information about  file using 16-bit version of PB enterprise 5.0.3?
I've not be able to find a reference source for 16-bit APIs.

Thanks for any help,

Sean Campbell

4/23/1998 6:54:12 AM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 19


AFAIK, there are none. You have to create a DLL in order to get this
information. Perfect job for a PB C++ userobject.

- Met vriendelijke groet,
  Eric Aling [TeamPS], Cypres Informatisering bv, The Netherlands

Sean A. Campbell wrote in message <353EE593.65D964AC@teleport.com>...
|    Does anyone know a way in which to get the date, version, etc.
|information about  file using 16-bit version of PB enterprise 5.0.3?
|I've not be able to find a reference source for 16-bit APIs.
|Thanks for any help,
|Sean Campbell

begin 666 Eric J Aling.vcf
M,S$H,"DS,#8P,C4T,# -"E1%3#M(3TU%.U9/24-%.BLS,2@P*3,T,S4W.30Y
M,#D-"E1%3#M73U)+.T9!6#HK,S$H,"DS,#8P-3 W.3D-"D%$4CM73U)+.CL[
M13M%3D-/1$E.1SU154]4140M4%))3E1!0DQ%.D%M<W1E;" Q.3TP1#TP05=I
M86YD<PT*55),.FAT=' Z+R]O=7)W;W)L9"YC;VUP=7-E<G9E+F-O;2]H;VUE
M<&%G97,O86QI;F=E:FH-"E523#IH='1P.B\O=W=W+F-Y<')E<RYN; T*14U!
M24P[4%)%1CM)3E1%4DY%5#IE+F%L:6YG0&-Y<')E<RYN; T*14Y$.E9#05)$

4/23/1998 8:49:52 PM
Here's a 16-bit routine that will get the date & time for a DOS file.
You can cut it and paste it into a file and import it into PowerBuilder.
global type gf_get_file_datetime from function_object
end type

forward prototypes
global function integer gf_get_file_datetime (string arg_filename, ref
datetime arg_file_datetime)
end prototypes

global function integer gf_get_file_datetime (string arg_filename, ref
//	Integer function gf_get_file_datetime( ) 
//	Uses Window OpenFile() API call to determine a file's 
//      datetime stamp.
// The following Windows 3.1 API declaration must be declared
// as either a PowerBuilder local or global external function:
// FUNCTION int OpenFile( string filename, 
//			ref gs_ofstruct ls_ofstruct, 
//			int wstyle ) library "kernel.exe"
// A global structure must be declared in PowerBuilder;
// the exported global structure's source is displayed here
// for completeness:
//    $PBExportHeader$gs_ofstruct.srs
//    global type gs_ofstruct from structure
//    character cbytes
//    character ffixeddisk
//    unsignedinteger nerrcode
//    unsignedinteger reserved[2]
//    character szpathname[128]
//    end type
gs_ofstruct ls_ofstruct
integer		li_wstyle 
integer		li_result
string		ls_pad
uint			lui_work
integer		li_day
integer		li_month
integer		li_year
integer		li_seconds
integer		li_minutes
integer		li_hours
date		ld_date
time		lt_time
datetime	ldt_datetime

// Windows 3.1 API OF_EXIST constant value. 
// This tells OpenFile() to determine if the file  
// exists. If it exists, the file is closed. 
// This does not appear to update the file's date/time:
// that is, it does not appear to "touch" the file.
integer		OF_EXIST = 2^14

li_wstyle	= OF_EXIST

// Set up for API call to OpenFile().
ls_pad = Space( 128 - len(arg_filename))
arg_filename = arg_filename + ls_pad

ls_ofstruct.cbytes		= " "
ls_ofstruct.ffixeddisk	= " "
ls_ofstruct.nerrcode		= 0
integer i
ls_ofstruct.reserved[1] = 0
ls_ofstruct.reserved[2] = 0
FOR i = 1 to 128
	ls_ofstruct.szpathname[i]	= " "

// Call API function to get file characteristics.
li_result = OpenFile( arg_filename, ls_ofstruct, li_wstyle ) 

IF li_result > 0 THEN
	// First word contains the file's year, month and day.
	// Day is in bits 0-4.
	lui_work = ls_ofstruct.reserved[1]
	lui_work	= lui_work * 2^11 
	li_day   = lui_work / 2^11

	// Month is in bits 5-8.
	lui_work = ls_ofstruct.reserved[1]
	lui_work = lui_work * 2^7  
	li_month = lui_work / 2^12

	// Year is in bits 9-15. ( 0 corresponds to the year 1980).
	lui_work = ls_ofstruct.reserved[1]
	li_year  = lui_work / 2^9  + 1980

	// Combine the 3 values to get a date value.
	ld_date = Date( li_year, li_month, li_day )

	// Second word contains the file's time values: hours, minutes,
	// Bits 11-15 contain the hours.
	lui_work		= ls_ofstruct.reserved[2]
	li_hours 	= lui_work / 2^11 

	// Bits 5-10 contain the minutes.
	lui_work		= ls_ofstruct.reserved[2]
	lui_work		= lui_work * 2^5
	li_minutes	= lui_work / 2^10 

	// Bits 0-4 contain a value that represents (seconds/2).
	lui_work		= ls_ofstruct.reserved[2]
	lui_work		= lui_work * 2^11
	li_seconds	= lui_work / 2^11
	li_seconds  = li_seconds * 2

	// Convert to a time datatype.
	lt_time = Time( li_hours, li_minutes, li_seconds )

	// Combine the date and time values to a datetime datatype.
	arg_file_datetime = DateTime( ld_date, lt_time )
	// OpenFile() error occurred.

end function
Sean A. Campbell wrote:
> Hi,
>     Does anyone know a way in which to get the date, version, etc.
> information about  file using 16-bit version of PB enterprise 5.0.3?
> I've not be able to find a reference source for 16-bit APIs.
> Thanks for any help,
> Sean Campbell
4/24/1998 4:38:37 AM

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 ...

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...

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...

16-bit PB calling a 16-bit DLL?
I am trying to build a "bridge" between a PB program (originally a 32-bit .exe) and a 32-bit DLL (I can't change this to 16-bit); both work flawlessly when run as 32-bit under Windows 95. Now... when I try to convert the PB app to 16-bit, and call my bridge pgm (a 16-bit .dll compiled with the Watcom C/C++ compiler v 10.?), I get a message "error calling external function..." when I try to access the function (the .dll loads fine). I have checked the spelling; I think the prototypes are correct, I have looked for samples (to no avail), etc. Does anyone kno...

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 &...

Help! Calling 16 bit LZCopy from LZEXPAND.DLL to copy files
I am having trouble figuring out how to call the LZCopy function in the 16 bit DLL LZEXPAND.DLL that comes with Windows NT (C:\WINNT\SYSTEM\) from PB 5.002. I cannot use 32bit calls since this is a 16 bit application I am working on. Here is what I am doing: Global External Function: FUNCTION int LZCopy(ref string p_from, ref string p_to) LIBRARY "LZEXPAND.DLL" Call: int rc string ls_from, ls_to ls_from = "c:\temp\test.txt" ls_to = "c:\temp\test2.txt" rc = LZCopy(ls_from, ls_to) MessageBox('Return Code', String(rc)) ...

32 bit PowerBuilder and 16 bit executables
Hi, Well, I am glad to know that I'm not the only one having 32bit vs 16bit problems. We have a rather small app (6 pbls / an average of 4 objects per pbl). We are compiling this app as a 16 executable using PB5 32bit. The compile is good (I guess) but when I start the app I get an external reference error when the app tries to use a non visual residing in one of the DLLs. Now I have done all of the things that any good PB developer would do (specify all PBLs as PBDs, make sure all the DLLs are in the same directory as the EXE, make sure the EXE has a different name as the DL...

16 bits ccmail and 32 bits powerbuilder application
Does any one know how to create and send email to 16bits ccmail 2.2 from 32 bits powerbuilder application ? Thanks in advance ...

16 bits CCmail and 32 bits Powerbuilder app
Does any one know how to create and send email to 16bits ccmail 2.2 from 32 bits powerbuilder application ? Thanks in advance Check out my site : http://members.xoom.com/sanskrut It may help you!! All the best in advance!! Nirav. Zakia Pirzada wrote: > Does any one know how to create and send email to 16bits ccmail 2.2 from > 32 bits powerbuilder application ? > > Thanks in advance ...

16-bit vs 32-bit PBD files
I was under the impression that PBD files were the same whether you compiled under 16-bit PB or under 32-bit PB. I just compiled a small application. I made a copy of the PBL files onto two machines. On one machine, I compiled a 16-bit version (under PB 5.0.02 16-bit) of the application into an EXE and 2 PBD files. On the other machine, I did the same thing but made a 32-bit version (under PB 5.0.02 32-bit) of the application. Both machines were running Windows 95. The 16-bit PBD files and the 32-bit PBD files are exactly the same size, but when I compare them using the MS-DOS...

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...

Better to use API fn call/Powerbuilder fn call ...
I have a rather elementary question. Is there any difference in application performance if I use an API call rather than a PowerBuilder function call ? eg Suppose there is PowerBuilder function 'X' which will bring a window to the foreground. An API function 'Y' does the same. Assuming that I need not prepare/initialize any structure etc to be passed to the API function 'Y', does it make any difference to the app performance if I make an API call instead of the PowerBuilder function call 'X' ? Thx Ganesh The difference would be virtually i...

Web resources about - 16-bit API calls for file information? - sybase.powerbuilder.general

Information - Wikipedia, the free encyclopedia
Information (shortened as info or info. ) is that which informs, i.e. an answer to a question, as well as that from which knowledge and data ...

InformationWeek – Latest Information Technology (IT) news & IT articles - Technology news - IT magazine ...
InformationWeek provides latest Information technology (IT) news online & articles and publishes latest tech news & IT magazine for Indian IT ...

Did Senator Ted Cruz release classified information during Republican debate?
A Republican senator is investigating whether Republican presidential candidate Ted Cruz released classified information while discussing the ...

US gave San Bernardino shooter Tashfeen Malik visa 'despite missing information'
A congressman claims the US approved an entry visa even though Malik never provided the extra evidence requested by an immigration official. ...

Trudeau says improving access to information will make government better
Ensuring Canadians have access to federal information will mean more and sometimes difficult public scrutiny, but ultimately it will lead to ...

Making Access To Information Better Will Make Improve Government, Trudeau Says 54
The Liberals will conduct a "proper review" of the decades-old Access to Information Act with the aim of figuring out "what is actually going ...

Martin Peers Promoted at The Information
The Information, the tech subscription site that was founded in 2013, has named Martin Peers managing editor. Peers most recently served as ...

Senate Intellicence Committee Chair Burr all but confirms that Cruz leaked classified information at ...
... that, among other things, updates the government’s program of collecting phone metadata. In doing so, Cruz probably leaked classified information. ...

Apple’s Maps app adds Los Angeles public transit information
Apple’s Maps application now supports public transit information for Los Angeles, California, forming a continuation of the service’s gradual ...

It's not exactly the Watergate break-in — is it? — but Bernie Sanders's campaign broke into Hillary Clinton's ...
... Democratic National Committee have accused the presidential campaign of Sen. Bernie Sanders of improperly accessing confidential voter information ...

Resources last updated: 12/23/2015 5:25:18 PM