Huge pointers vs Far pointers 
Author Message
 Huge pointers vs Far pointers

I'm trying to convert a 16 bit library (VC 1.5) to a 32 bit library (VC
4.0).  I ran into a problem with Huge pointers which are not in 32 bit
code.  I figure I can change them to "Far" pointers.

Am I right?  Here is the conversions I am planning to make.

Original line
   char huge *lpInBuf = (char huge *)lpBuffer;

Changed to
   char far *lpInBuf = (char far *)lpBuffer;

and original
   BYTE huge *hpBuffer = lpBuffer;   // make a huge pointer to the data

changed to
   BYTE far *hpBuffer = lpBuffer;   // make a huge pointer to the data

Thanks.



Tue, 30 May 2000 03:00:00 GMT  
 Huge pointers vs Far pointers

Quote:

> I'm trying to convert a 16 bit library (VC 1.5) to a 32 bit library (VC
> 4.0).  I ran into a problem with Huge pointers which are not in 32 bit
> code.  I figure I can change them to "Far" pointers.

> Am I right?  Here is the conversions I am planning to make.

> Original line
>    char huge *lpInBuf = (char huge *)lpBuffer;

> Changed to
>    char far *lpInBuf = (char far *)lpBuffer;

> and original
>    BYTE huge *hpBuffer = lpBuffer;   // make a huge pointer to the data

> changed to
>    BYTE far *hpBuffer = lpBuffer;   // make a huge pointer to the data

Actually if you include windows.h

BYTE far *hpBuffer
will get translated to
BYTE *hpBuffer



Tue, 30 May 2000 03:00:00 GMT  
 Huge pointers vs Far pointers

Quote:
>I'm trying to convert a 16 bit library (VC 1.5) to a 32 bit library (VC
>4.0).  I ran into a problem with Huge pointers which are not in 32 bit
>code.  I figure I can change them to "Far" pointers.

>Am I right?  Here is the conversions I am planning to make.

Thomas,

Under Win32 there are no near, far, or huge pointers like in Win-16.
If you want to maintain some common source code you can use the macro
definitions FAR and HUGE, and create definitions for these in Win32
that are empty:

#ifdef WIN32
#define NEAR
#define FAR
#define HUGE
#endif

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.



Wed, 31 May 2000 03:00:00 GMT  
 Huge pointers vs Far pointers


Fri, 19 Jun 1992 00:00:00 GMT  
 Huge pointers vs Far pointers

Can anybody help me with the GetCharacterPlacement() GDI32 function.?

For me it returns zero, indicating failure, and does not fill in any
of the members of the GCP_RESULTS structure that i pass to it.  There
must be something that i'm not doing right.

Yitshak Kugler
in Jerusalem

Here is the code that i try to use:

 dwFLI = GetFontLanguageInfo(*pDC);
 gcp->lpClass[0] = (GCPCLASS_PREBOUNDRTL | GCPCLASS_HEBREW) ;
 gcp->nGlyphs = lenText;

 GCPrtv.dwRTV = GetCharacterPlacement(
  *pDC,
  aText,       //char * to the string to be displayed.
  lenText,
  textSize.cx,
  gcp,
  //(dwFLI & FLI_MASK)
  (GCP_REORDER | GCP_DIACRITIC | GCP_GLYPHSHAPE | GCP_LIGATE |
GCP_CLASSIN)
  );

//so far this function returns 0 and does not fill in any member
//of gcp.
//I've checked that all of the above options are returned by the
//preceeding GetFontLanguageInfo() function.

//gcp is a member of myClass and defined as:
   GCP_RESULTS * gcp;
//Here is how i initialize it:
 gcp = (GCP_RESULTS *)new GCP_RESULTS;
 gcp->lpOutString = (char *)new char[80];
 memset(gcp->lpOutString,0,80);
 gcp->lpOrder     = (UINT *)new UINT[80];
 memset(gcp->lpOrder,0,80*sizeof(UINT));
 gcp->lpDx        = (INT *)new INT[80];
 memset(gcp->lpDx,0,80*sizeof(INT));
 gcp->lpCaretPos  = (INT *)new INT[80];
 memset(gcp->lpCaretPos,0,80*sizeof(INT));
 gcp->lpClass     = (char *)new char[80];
 memset(gcp->lpClass,0,80);
 gcp->lpGlyphs  = (unsigned short *)new UINT[80];
 memset(gcp->lpGlyphs,0,80*sizeof(UINT));
 gcp->nGlyphs     = 0;
 gcp->nMaxFit     = 0;

//I've studied the three pages of information on
//GetCharPlacement (4 pages) and GCP_RESULTS(3pages)
//on the MSDN CD.
//Also i have Nadine Kano's book, Developing International Software.

Thanks in advance for any pointers or help.

Yitshak Kugler



Sun, 18 Jun 2000 03:00:00 GMT  
 Huge pointers vs Far pointers

About GCP_RESULTS.nGlyphs:
"On input, this member must be set to the size of the arrays pointed to by
the array pointer members."

but you have:
gcp->nGlyphs = 0;

Claire Sylvestre

Quote:

>Can anybody help me with the GetCharacterPlacement() GDI32 function.?

>For me it returns zero, indicating failure, and does not fill in any
>of the members of the GCP_RESULTS structure that i pass to it.  There
>must be something that i'm not doing right.



Sun, 18 Jun 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. near, huge and far pointers

2. long pointers again -- far pointers

3. Converting huge pointers to normal pointers

4. Dereferencing f-pointers, arrays of f-pointers, pointers to f-pointers

5. char pointers vs. int pointers

6. pointer to array vs pointer

7. Huge pointer to base memory

8. Huge Pointer

9. Bug in huge pointers in Visual C++ 1.51/16 bits/Quick Win

10. huge pointers

11. word, dword and huge pointers arithmetic

12. Turbo C++ 1.0 Huge pointer addition error?

 

 
Powered by phpBB® Forum Software