Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 08 DEC 2004 06:08:10PM Jim Vaughan wrote:

I am unsure how to define a couple of paramter types for a DLL.

From ????.H

int FUNCTYPE direct_transfer(char far *target);

char * FUNCTYPE CKTimeString(char *stringbuf, ULONG cktime);

Is the following correct?

INT PASCAL direct_transfer(LPACHAR)

LPACHAR PASCAL CKTimeString(LPACHAR, ULONG)

or is this correct?

INT PASCAL direct_transfer(LPACHAR)

LPACHAR PASCAL CKTimeString(ACHAR, ULONG)

I am unsure about the difference between the following

char *

char far *

are these both pointers or not?


At 08 DEC 2004 08:25PM Pat McNerthney wrote:

Jim,

Both the PASCAL calling sequence and the far pointer data type are remanents of the 16-bit Windows world and are no longer used in 32-bit Windows.

If any of the "char *" parameters are suppose to be null terminated strings, I would declare those as LPASTR. The problem is "char *" can either mean the pointer to a buffer of an array of characters, or it can mean a pointer to a null terminated string of characters.

So your declarations like this:

INT STDCALL direct_transfer(LPACHAR)

LPACHAR STDCALL CKTimeString(LPACHAR, ULONG)

are the closest. It is hard to say which of the LPACHAR's should really be LPASTR's without a description of what the function expects.

Pat


At 08 DEC 2004 08:41PM Jim Vaughan wrote:

Great and thanks Pat, I will set them all as LPACHAR and see if everything works.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/abbceb0d0e887f5485256f64007f176a.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1