HDTenEightyP/NetNews huggingface dataset:
From: moriarty@tc.fluke.COM (Jeff Meyer)
Subject: Re: generic replacement for malloc and free using Global...?
Followup-To: comp.os.ms-windows.programmer.misc
Summary: MS, w/ C7 and Win 3.1, recommends going back to using malloc
Keywords: malloc free GlobalAlloc GlobalFree
Reply-To: moriarty@tc.fluke.COM (Jeff Meyer)
Organization: The John Fluke Mfg. Co.  /a.k.a. The Gizmonics Institute/
Date: Fri, 13 Nov 1992 18:26:36 GMT

In comp.windows.ms.tools whedon@netcom.com writes:

>I wonder if anyone has a generic replacement for malloc and free which make
>use of GlobalAlloc and GlobalFree?  I did those up, but for some reason, the
>memory thus allocated doesn't seem to be getting released properly, even
>though I am careful to execute one free for each malloc.  As an offshoot of
>this, my memory slowly goes down in Windows until I terminate my app, at
>which time it all appears to come back. Any ideas?  Working procs?   Please
>email me and I will summarize, as I know of at least two other people who
>want this stuff.  I suspect there're more...

There's a Microsoft C/C++ Technical Note ("Allocating Memory the
Old-Fashioned Way: _fmalloc and Applications for Windows" by Dale Rogerson,
dated July of this year) that basically says that with the combination of MS
C/C++ 7.0 being released and the advent of Windows 3.1 (where there is no
real mode) -- and, I suspect, the coming of Win32 and NT -- MS is going back
to recommending that you use malloc and free instead of the
LocalAlloc/GlobalAlloc calls.

In particular, the article mentions using _fmalloc (under C7, calls to
malloc in large memory models are automatically mapped to _fmalloc) as
opposed to GlobalAlloc because it is more efficient in the use of memory;
fmalloc basically calls GlobalAlloc with the GMEM_MOVEABLE option, but
doesn't allocate a new global segment for each call for memory.
Using _ffree, however, appears to be a bit more complex than using
GlobalFree; see the article for more information.

Don't know if this is of help, but I thought I should draw your attention to
this article.  (After using Global/LocalAlloc for months, it sort of took me
by surprise that MS was suggesting going back to malloc!)

                           "Open Channel D..."
---
                                        Moriarty, aka Jeff Meyer
INTERNET:     moriarty@tc.fluke.COM
Manual UUCP:  {uunet, uw-beaver, sun, microsoft}!fluke!moriarty
CREDO:        You gotta be Cruel to be Kind...
                 **>> Keep circulating the tapes <<**
From: regentin@cpsin2.cps.msu.edu (Curtis Regentin)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Need help, Please! ;)
Summary: Trying to address a hardware address in windows
Keywords: help
Date: 9 Nov 92 15:48:43 GMT
Organization: Dept. of Biochemistry, Michigan State University
Originator: regentin@cpsin2.cps.msu.edu

Hi,

I'm new to Windows (and DOS for that matter) and I'm having a problem
writing to an interface card (CIO-DIO24H) in a 386 running Windows 3.0.
I've got a piece of test code, that looks something like this:

char far *p;
p = (char far *)0x300;
*p = 0xcf;

This runs under DOS, but causes Exeption 13 in Borland's TDW, at:

  C45EFA	les	bx,[bp-06]
->26C607CF	mov	es:byte ptr [bx], CF

What am I doing wrong?  How can I make windows happy, and aware of the
situation?

Any assistance would be apreciated, or please point me at a reference
that might have this kind of information.

Thanks,
  Curt Regentin
  roo@itr1.bch.msu.edu
From: jeff@igc.apc.org (Jeff Dean)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Virtual Device Driver for COM Ports
Date: 5 Nov 92 06:34:00 GMT
Nf-ID: #R:mcnnet.uucp:11:cdp:1668700011:000:215
Nf-From: cdp.UUCP!jeff    Nov  4 22:34:00 1992


Windows already provides a virtual device driver for com ports.
(The Windows 3.1 driver is much better than the 3.0 version.)
Source code for the driver is included in Microsoft's DDK.

	Jeff Dean
	jeff@igc.apc.org
From: slo@otter.hpl.hp.com (Steve Loughran)
Date: Wed, 4 Nov 1992 11:31:03 GMT
Subject: Re: Message passing from DLL routine to VB
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Newsgroups: comp.os.ms-windows.programmer.misc

>I have a data acquisition programming running in background as a
>DLL and would like it to notify my VB program when it is done. Is there
>an easy way of doing this without using DDE?

Just send a message which your VB program can handle.
The one i've used in the past is just WM_CHAR with wParam set to a low
number which the user wouldn't normally press (16 & 17 are good)
This should be sent to whatever window your VB app passes to the DLL -almost
any control will do. This control just handles the KeyPress(keyascii) 
event and checks for keyascii=17.

Fairly tortuous but easy to do...
	Steve
From: trepe00@DMI.USherb.CA (ERIC TREPANIER)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Typecasting a pointer to member-function to unsigned long
Summary: Subclassing a WndProc with an OWL member function
Keywords: WndProc, OWL, SubClass
Date: 5 Nov 92 18:59:14 GMT
Article-I.D.: DMI.Bx9BEr.n0z
Organization: Universite de Sherbrooke -- Dept. d'Informatique

In article <runehh.97.720902695@dhhalden.no> runehh@dhhalden.no (RUNE HALFDAN HOLST HUSEBY) writes:
>
>In a project I'm working on, I need to typecast a (far) pointer to a 
>function to an unsigned long (DWORD). I need to do this because the 
>MS Windows API requires me to do such a thing.
>
>This is the line that causes the error:
>
>        SetWindowLong(GetDlgItem(HWindow, ID_TO), GWL_WNDPROC, 
>                                (DWORD)&WCompose::ComboProc);
>
>What I'm trying to do, is to send over a callback function, using a generic 
>function which set a lot of different properties, all the size of a long.
>Thus I need to typecast the function pointer to an unsigned long.

It looks like you are trying to subclass a combobox control.  If that is
what you want to do, then there are two things you should be aware of:

1) The new window procedure (WCompose::ComboProc) *MUST* be declared
   "static" in the WCompose object definition, and it *MUST* be a public
   member function.  If done correctly, it should look like this:

class WCompose: public TWindow
{
  // protected variables & member functions
public:
  ...
  static CALLBACK _export ComboProc(HWND hwnd, UINT msg,
                                    WPARAM wparam, LPARAM lparam);
  ...
}

2) There is a new file included with BC++ 3.1, "windowsx.h" which contains
   a lot of useful macros, especially if you are using "#define STRICT".
   This file defines a special macro called "SubClassWindow".
   Have a look at the file "win31.doc" in your Borland's DOC directory to
   see how it works exactly.  If I remember correctly:

WNDPROC oldWndProc;

oldWndProc = SubClassWindow(GetDlgItem(HWindow, ID_TO), WCompose::ComboProc);

Now, in your ComboProc, you should make sure that you call oldWndProc for all
messages that you are not processing explicitly.  If you are not using Smart
CallBacks, you'll also need to call MakeProcInstance / FreeProcInstance.

If this sounds a bit complicated, email-me and I'll explain in more details.


Eric
-- 
Eric Trepanier
eric@tgm.CAM.ORG
"Everybody has a right to believe in something.
 I believe I'll have another beer."
From: Robert.Turner@brunel.ac.uk (Robert Turner)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Skeleton Windows App.
Date: 6 Nov 92 17:48:04 GMT
Organization: Brunel University, West London, UK

Hi

I am just starting to  convert my VB apps to MicroSoft C7, and am
getting bogged down in the sample apps that are supplied in the SDK. Has
anyone got a generic Windows skeleton program that they can send me
(including .RC .DEF and .MAK files) PLEASE!  I do not care about being
inundated, the more versions that I can get, the better (IMHO).

All I want is an app that can:

Open a window and put some (variable) text in it.
Check a private .INI file
Have a menu (this is about all I can do at the moment, thanks to GENERIC)

I have the Petzold book on order via our library, but they expect
delivery in months rather than days.

Thanks in advance from a frustrated programmer,

Rob
-- 
 _________________________________________________________________________
/                            |                                            \
|   Rob Turner, PC Support   |     email : Robert.Turner@brunel.ac.uk     |
|   Brunel University        |                                            |
|   London, England          |   Life is worth living, and then you die.  |
\____________________________|____________________________________________/
Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
From: andys@rruxc.uucp (25651-say)
Subject: TDW lockup...
Organization: Bellcore, Livingston, NJ
Date: Sat, 7 Nov 92 22:07:29 GMT
Followup-To: comp.windows.ms.programmer
Keywords: Borland,Debugger

   I have run across a problem when trying to run TDW (Turbo Debugger for
Windows) in Borland C++ 3.1.  When I attempt to run the program either
from the Windows IDE or through Run the computer locks up.  I do a CTRL-ALT-DEL
to kill TDW and then Windows crashes with it.  I have tried this in both
Enhanced Mode and Standard mode.  Anyone else seen this??
   My setup is 486/33, 8 Meg RAM, ATI Ultra with drivers dated 4/22/92, Win.
3.1, DOS 5.0 with 4DOS 4.0 running, and Borland C++ 3.1.

Any help would be appreciated,
   Andy

******************************************************************************
* I do not speak for Bellcore.                                               *
******************************************************************************
Newsgroups: comp.os.ms-windows.programmer.misc
From: ebergman@nyx.cs.du.edu (Eric Bergman-Terrell)
Subject: Re: Jobs programming Windows?
X-Disclaimer: Nyx is a public access Unix system run by the University
	of Denver for the Denver community.  The University has neither
	control over nor responsibility for the opinions of users.
Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
Date: Thu, 12 Nov 92 02:35:25 GMT

In article <BxKFu1.DMB@apollo.hp.com> nelson_p@apollo.hp.com (Peter Nelson) writes:
>
[ lines deleted ]

>
>    I've been programming 3D graphics in C and Pascal on 
>    Unix workstations and similar enviromnents for the 
>    last 9 years.  (prior to that I programmed in assembly
>    language) 
>
>    But if I left this job I would be interested in Windows
>    programming.   I've been doing that at home (along with
>    C++) and am currently taking a Windows programming course
>    at Boston's Northeastern University and I really enjoy it.
>    I will have NT set up on my PC in December and long-term,
>    that's where I want to concentrate.  
>
>    The question: is there any likelihood of getting a job
>    doing Windows?  The impression I get is that employers want
>    to see work experience in Windows programming.   Since I
>    don't have any, and it's a tight market, how do I get some? 

If you were a graphic artist, you would present your best work (your 
portfolio) to prospective clients.  Most software authors can't do this -
either the work is secret/proprietary, or it's a small part of a large
system, etc.

However, if you were to write a significant MS Windows program on your own
time, on your own machine, you could send the disk along with your resume.
You could also enclose favorable reviews of the software published in 
magazines, etc.

You might consider writing such a program.  You can recruit testers from
the network, post it to comp.binaries.ibm.pc, etc.  I recommend distributing
the program via shareware.

I may be wrong, but I expect being able to show prospective employers a
program entirely written by yourself would give you an advantage over
other applicants.  

Also, consider writing an article about windows programming techniques that
you've picked up.  Send them to Windows Tech Journal, Microsoft Systems
Journal, Dr. Dobbs, Computer Language, etc.  A copy of the article could also
be enclosed with your resume.

I expect the next time I send out a resume I'll include a program I wrote,
and magazine reviews of same.

>    
>    Should I just stay put or is there a way to get into Windows
>    programming with my background?

See above.  Comments anyone?

Eric Bergman-Terrell

Newsgroups: comp.os.ms-windows.programmer.misc
From: ahrikenc@snake-1.cae.wisc.edu (Cherif Ahrikencheikh)
Subject: Please Help Accessing BIOS ROM info from windows
Organization: UW-Madison
Distribution: usa
Date: 6 Nov 92 14:19:27 CST
Originator: ahrikenc@snake-1.cae.wisc.edu


I need to access BIOS ROM info from a MS-Windows program.  In
DOS I did this by using ptr = MK_FP( seg, off), then displaying
byte by byte ptr.  I tried this same code in Windows, and it
crashes (Can't read anything)

Please help (Email to ahrikenc@cae.wisc.edu)



Newsgroups: comp.os.ms-windows.programmer.misc
From: runehh@dhhalden.no (RUNE HALFDAN HOLST HUSEBY)
Subject: How to force selection of item in combo-box (OWL)
Keywords: combo, OWL
Organization: Ostfold College
Date: Mon, 9 Nov 1992 00:46:51 GMT

In a project I'm currently working, I put several things into a drop-down 
combo-box as the user types something.
Later I need to traverse the items in the combo-box, so I thought it would 
be easy to force selection of item nr 1, then nr 2 and so forth, getting the 
text from each selected item.

Im using Borlands OWL-library.

// code 
void WCompose::generate_envelope(void)
{
	char szRecipient[20];
	int nIndex = 0;

// pComboTo is a pointer to a TComboBox

  // Selects first in list 

// This is the test that fails
	if(pComboTo->SetSelIndex(nIndex) < 0)
	{
		MessageBeep (-1);
		BWCCMessageBox (HWindow, "Enter names to send to!", NULL, 
				MB_OK | MB_ICONSTOP);		
		return;
	}

	do
	{
		pComboTo->GetText(szRecipient, 20);
		pComboTo->GetString (szRecipient, nIndex);
		// do something with text
		// Selects first in list
		nIndex++;

		if(pComboTo->SetSelIndex(nIndex) < 0)
		{
			// No more to send to
			break;
		}

		generate_recipients();
	}
	while (1);
}

What I'm trying to do, is first select item index 0, put the item into a 
string, use it, select next item, until SetSelIndex(nIndex) returns 
something less than 0 because there is no more items to be selected.
For some reason, my first SetSelIndex(nIndex) fails for some unknown reason.
I'm absolutely positive that there is something in the combobox.

Thanks for any help!

Newsgroups: comp.os.ms-windows.programmer.misc
From: baum@kirk.es.go.dlr.de (Peter Baumann)
Subject: SUMMARY: accessing real mode memory
Organization: University of Kaiserslautern, Germany
Date: Wed, 11 Nov 1992 09:51:07 GMT

Hi!

I originally posted a question on accessing real mode memory (the first MB)
directly. This is needed to read/write to memory located on add on boards
as frame grabbers grafics cards, etc. The solution is relatively simple and
was supplied to me first by nar@math.wayne.edu (Mark Narduzzi) and then by
brad@huey.jpl.nasa.gov for use with Borland C++ 3.1. 

The Windows kernel supplies selectors for 64KB size memory pages, which are
called __A000H, __B000H, ... These are used in the following manner to access
memory D0000-DFFFF:

extern WORD _D000H;
LPBYTE fp = MAKELONG(0, &_D000H);

(C prepends an underscore to all variables so only use one underscore in your
source.)

Thanks a lot for the fast turnaround (I posted on Monday at 1.00AM and Mark
had answered by 9.00 AM).

ciao, Peter
 
-- 
DDD   L    RRR   |  Peter Baumann
D  D  L    R  R  |  Abt. SM-ES, DLR, Bunsenstr. 10, W-3400 Goettingen, FRG
D  D  L    RRR   |  Tel. (0551) 709-2190 FAX: (0551) 709-2101
DDD   LLLL R  R  |  internet: baum@kirk.es.go.dlr.de
Xref: sparky comp.os.ms-windows.programmer.misc:3258 alt.lang.basic:787
From: pluto@cs.ucsd.edu (Mark Plutowksi)
Newsgroups: comp.os.ms-windows.programmer.misc,alt.lang.basic
Subject: Re: Straw poll: comp.os.ms-windows.visual-basic ?
Date: 5 Nov 92 17:44:55 GMT
Followup-To: comp.os.ms-windows.programmer.misc

yfwu@Uz.nthu.edu.tw (EE U780935) writes:

>doug@cc.ysu.edu (Doug Sewell) writes:
>> In article <1992Oct13.142255.20959@news.ysu.edu> I wrote:
>> >This is just a straw poll.  How many would be interested in a separate
>> >newsgroup comp.os.ms-windows.visual-basic ?
>> >
>> >Please reply by e-mail, if there's sufficient interest I'll consider
>> >going the RFD/CFV route on it.
>> 


I'd prefer a group discussing gui-builders in general, not
just visual-basic.  Myself, I'm happy with Protogen as the
partcular tool of choice, and would also welcome discussion
about gui design as well as discussion of tools.

= Mark
k

Newsgroups: comp.os.ms-windows.programmer.misc
From: flink@mits.mdata.fi (Flinkman)
Subject: What is new in Visual Basic 2.0 ?
Organization: ArrowSoft
Date: Sun, 8 Nov 1992 12:46:09 GMT

	I read that Microsoft announced new version of Visual Basic.
	 
	Now I'd like to know, what is new in this, second, version
	of Visual Basic ?

--
<<-=-=-=-=-=-=-=-=-=-=<<  <<=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<<
 >>   Ari Flinkman     >>  >>   E-Mail: Flink@Mits.Mdata.Fi      >>
<<    Suomi/Finland   <<  <<            -ArrowSoft->            <<
 >>=-=-=-=-=-=-=-=-=-=->>  >>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=>>
From: rocker@desire.wright.edu
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: MDI Apps & streams
Date: 5 Nov 92 17:02:37 EST
Organization:  Wright State University 

	Does anyone know how to save the sizes/positions of the MDI children as
well as the main app's on a stream?

	I can save the children with no  problem, but the app gets opened in
different locatiions and size.  I thought if I just replaced putchildren->store
&getchildren->load would do it, but no.

	Where should I do this?  The app level? the mdiwindow level?
setupwindow?

Borland keeps saying it should work, but I'm not getting it.

thanx
Newsgroups: comp.os.ms-windows.programmer.misc
From: scott@ods.com (Scott Harper)
Subject: FAQ - WM_ICONERASEBKGND???
Organization: Optical Data Systems, Inc.
X-Newsreader: TIN [version 1.1 PL6]
Date: Tue, 10 Nov 1992 19:14:36 GMT

I'm sure this is a FAQ, but I've forgotton what the answer is...

I want to process the WM_ICONERASEBKGND message, and paint the icon's
background a different color under certain circumstances.  My question
is, once I get into the WM_ICONERASEBKGND case and determine that I
need to repaint the background, how do I actually do it?  Should I
use FillRect, or do I just need to provide the alternate brush to
some other location?

Thanks -
-- 
Scott Harper                       Optical Data Systems, Inc.
scott@ods.com                      1101 E. Arapaho Road
(214) 234-6400                     Richardson, TX  75081
Newsgroups: comp.os.ms-windows.programmer.misc
From: baum@kirk.es.go.dlr.de (Peter Baumann)
Subject: HELP!!! Problem with acessing system memory
Organization: University of Kaiserslautern, Germany
Date: Sun, 8 Nov 1992 22:40:19 GMT

Hi!

I have a problem. I want to access the memory of a frame grabber installed
to my system (BC++, Windows 3.1). I found a note in a programmers guide that
something like this should be possible:

unsigned char far * fp;
fp = MAKELONG(0,&_E000H);

Then I have a pointer to memory location D0000 where the frame grabber is. 
__E000H is supposed to be a constant defined for windows. I CANT FIND IT!!!
Does anybody out there have a def for this constant or can I access the
memory in a different manner?

-- 
DDD   L    RRR   |  Peter Baumann
D  D  L    R  R  |  Abt. SM-ES, DLR, Bunsenstr. 10, W-3400 Goettingen, FRG
D  D  L    RRR   |  Tel. (0551) 709-2190 FAX: (0551) 709-2101
DDD   LLLL R  R  |  internet: baum@kirk.es.go.dlr.de
From: trepe00@DMI.USherb.CA (ERIC TREPANIER)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: CTRL-Z Illegal accelerator key in Borland RW 3.1?
Keywords: resource workshop
Date: 5 Nov 92 19:06:10 GMT
Article-I.D.: DMI.Bx9BqB.Ex
Organization: Universite de Sherbrooke -- Dept. d'Informatique

In article <1992Nov5.083449.16151@fel.tno.nl> rioj7@fel.tno.nl (M.L.M.Veraart) writes:
>Using the resource workshop of Turbo C++ 3.1 for windows I was unable
>to create an accelerator key for CRTL-Z. 
>It complained about "Illegal key name" on the line
>    "^Z",VIEW_ZOOM
>Creating an accelerator key for ALT-Z was no problem.
>
>Is this a bug in the resource workshop, or am I doing something wrong?
>The resource compiler of SDK 3.0 dit not had any problem with CRTL-Z.

Possibly, this is because Windows 3.1 now uses some CTRL key combinations
for Cut & Pasting (ala Mac).  Have a look at the Edit menu in notepad v3.1,
I think the CTRL-V / X / Z are used for Cut / Copy / Paste operations.

I suppose Resource Workshop knows about this, so it won't allow you to
use these key combinations.


Eric
-- 
Eric Trepanier
eric@tgm.CAM.ORG
"Everybody has a right to believe in something.
 I believe I'll have another beer."
From: kim@Software.Mitel.COM (Kim Letkeman)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Two Monitors Needed?
Date: 6 Nov 92 21:58:09 GMT
	<1csprqINNpfk@charnel.ecst.csuchico.edu>
Organization: MITEL Public Switching, Kanata, Ontario, Canada
In-reply-to: jmeyers@ecst.csuchico.edu's message of 31 Oct 92 02:08:58 GMT

In article <1csprqINNpfk@charnel.ecst.csuchico.edu> jmeyers@ecst.csuchico.edu (Jeff Meyers) writes:

| I agree!  I picked up a new monochrome monitor for about $70 and the
| generic card for about $10.  I use the dual monitor debugging for
| both DOS and Windows programming - and I love it.  Especially with
| Windows, it's better that flipping back and forth between text and
| graphic modes.  The only negative I've found is that with the mono
| card activated, your vga card goes into 8-bit mode and slows down.
| So, I put in a switch that activates the mono card only when I plan
| on using it - just have to turn the machine off - switch - then
| on...

I've found that the ATI Graphics Ultra will run full blast (8+ million
Winmarks) with a mono card installed (at least with the ATI Graphics
Solution in mono mode.)  Makes it a good card for this setup.

But, I find the mono screen annoying to use because of the lack of
different colours to differentiate information and the lack of 50 line
ability. I know that some cards are slow at refreshing the screen when
going back to a hires mode, but the Ultra does this in an instant.
--
Kim Letkeman	kim@Software.Mitel.COM
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Communicating Over Networks...
From: ccdps@levels.unisa.edu.au
Date: 2 Nov 92 07:59:03 +1030
Organization: University of South Australia

In article <9suBTB2w165w@bluemoon.rn.com>, bigman@bluemoon.rn.com (Matt Werline) writes:
>         I have search forever to find infomation on how to communicate to
> other applications(or a copy of the same app) over the a network.

Not sure how it fits into BBS world, but the MS Lan Manager 2.1 Programmers
Toolkit is available on the net. Bob Baggerman has got hold of it (and I have
a copy - thanks Bob) but he was going to announce it himself. Ask him for
info:

          bob@comlab.gatech.edu

--
 Dan Shearer                        email: Dan.Shearer@UniSA.edu.au
 Information Technology Branch      Phone: +61 8 302 3479
 University of South Australia      Fax  : +61 8 302 3385
Newsgroups: comp.os.ms-windows.programmer.misc