🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1233

How to handle structure with SDK HANDLE

#1233
From: Zhiping QIU
Date: Thu, 07 Feb 1991 04:22
40 lines
1518 bytes

Hi,

Does anybody out there know how to use HANDLE to define
class (or struct) and to do reference and de-reference?

I am now using Zortech C++ with Window SDK to set up an
application program. The program needs to use a large 
amount of memory which exceeds the local stack. It seems
that Zortech C++ has its own handle type which can solve
the problem as follows:

struct tree {
	char __handle *word;
	int count;
	struct tree __handle *left;
	struct tree __handle *right;
};

... ...

struct tree __handle *p;
p = (struct tree __handle *) 
	handle_calloc(sizeof(struct tree));
p-count ++; 	// it is the de-reference

... ...

But according to SDK's manual, the use of malloc and
calloc should be avoided although SDK has its own version
of them. And Zortech's handle_calloc obviously refers
those functions. So we should avoid using handle_calloc?

If I must use window's HANDLE to do that, how can I 
implement the above struct and its reference/dereference?

Thanks in advance.

---James Z. Qiu
Technical Details
Message-ID: <1991Feb7.042258.18740@cs.mcgill.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!quiche!qiu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!quiche!qiu
From: qiu@cs.mcgill.ca (Zhiping QIU)
Newsgroups: comp.windows.ms.programmer
Subject: How to handle structure with SDK HANDLE
Message-ID: <1991Feb7.042258.18740@cs.mcgill.ca>
Date: 7 Feb 91 04:22:58 GMT
Sender: news@cs.mcgill.ca (Netnews Administrator)
Organization: SOCS, McGill University, Montreal, Canada
Lines: 40
Originator: qiu@homer