HDTenEightyP/NetNews huggingface dataset:
From: rryan@panix.com (Rob Ryan)
Subject: Re: Borland and Memory
Date: Fri, 18 Dec 1992 05:29:59 GMT
Distribution: usa
Organization: Panix, NYC

In <1992Dec17.160015.24323@mksol.dseg.ti.com> duitz@mksol.dseg.ti.com (mitchel n duitz) writes:

>I'm using The Large Model in the program, and the allocation
>works fine the first time I use the object, then when i delete
>the object that uses all the memory, and try again it bombs.
>I am freeing the memory delete[] pn.   So I don;t know
>what's going on.  I even looped through with the debugger, and
>then it got to a magic row and it locked up. Thanks.

So, it sounds like the problem isn't in the allocation (because it works the
first time) but the de-allocation.  My understanding is that the construct
"delete [] pn" is used for freeing the memory allocated with something like
"int *pn = new int[100]".  But if you're allocating memory for an array of
pointers and then do subsequent allocations for arrays for the individual
pointers in the first array to point to, don't you have to do something
like:

    for (int i = 0; i < MAXX; i++)
	delete [] pn[i];
    delete [] pn;

I personally find this sort of confusing, but it that seems like it should 
work.  I don't know why "delete [] pn" by itself doesn't work (I could
see it not freeing the bulk of the data, and destroying the pointers to
a lot of data, but I don't see why that would be fatal).  Perhaps when
you're doing the next loop, the system runs out of memory, does a garbage
collection (of sorts), but since the pointers for some unallocated data
have been destroyed, it gets confused.  Ideas?

I really don't know and am just guessing, but does that make sense?  Have
I gone seriously awry here?

-- 
 Rob Ryan
    rryan@panix.com
From: stephen.murphy@freddy.ersys.edmonton.ab.ca (Stephen Murphy) 
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: PROBLEM: SYSTEM ERROR !
Date: 17 Dec 92 21:06:00 GMT
Reply-To: stephen.murphy@freddy.ersys.edmonton.ab.ca (Stephen Murphy) 
Distribution: world
Organization: Freddy's Place BBS - Edmonton, AB - 403-456-4241

Vince;
        I ran into the same problem and thought it was my application
causing the problem. It turns out in my case that all along it was Adobe
Type Manager that was the culprit. Adobe doesn't get along with Borland
C++ or QuickC for Windows. After disabling Adobe, I have not had the
Divide by Zero error since. If your machine has Adobe, this may be the
problem.
Good luck,
Stephen Murphy
                                                                                                                   
Newsgroups: comp.os.ms-windows.programmer.misc,comp.windows.ms.programmer
From: timb@sr.hp.com (Tim Bagwell)
Subject: Re: Windows printing (tabs in particular)
Date: Fri, 18 Dec 1992 23:56:49 GMT
Organization: HP Sonoma County (SRSD/MWTD/MID)
X-Newsreader: TIN [version 1.1.9 PL6]

: "If you use the HP III driver and do the standard printing seqeuence you
: get (in all cases) the tab translated into ascii 127 (which showed up as a
: dithered/shaded box in the printout).  In the case of a dot-matrix driver
: you get a dot instead of 127.  That is all fom the "recommended" public
: algorithms.
: 

Hmmm, I have used the HP IIP driver with the TabbedTextOut function and
it works fine. Tab positions (in pixels) are passed in an integer array.
Maybe there is a problem with the newer driver.
Newsgroups: comp.os.ms-windows.programmer.misc
From: cjs33278@uxa.cso.uiuc.edu (Carl Samos)
Subject: I need all of the RTF codes
Organization: University of Illinois at Urbana
Date: Tue, 15 Dec 1992 17:49:48 GMT

I'm writing an RTF to IPF file converter, and I need the full list of RTF
codes, so if you have it, can you email it to me?  Or if you know where I
may find it, can you tell me?  Thanks in advance!

-Carl Samos
 cjs33278@uxa.cso.uiuc.edu
 Merriam Lab
 University of Illinois

Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Programming for foreign languages 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Mon, 14 Dec 1992 18:44:39 +0000

In article <1992Dec12.185658.13375@serval.net.wsu.edu> rnelson@wsuaix.csc.wsu.edu writes:

>I have written several DOS apps I can compile versions for English, Spanish,
>French and Italian (someday also Castilan, Swedish, Danish and German)
>I am porting these to ms-windows and would like no know
>what is the best way to support foreign languages under windows.
>
> [ stuff deleted]
>
>Does windows provide a facility for loading the strings for the language.
>So far, all I have found in the Borland documentation is the function
>which gets the language version of MS-Windows.
>

This is very easy in Windows.  What you do is to put all the strings you
want the user to see in a STRINGTABLE resource in your application's
resource file, then load them with the "LoadString" function.

Eg, in the .rc file:

        STRINGTABLE
        BEGIN
            IDS_FILENOTFOUND,   "File not found"
            IDS_LOADSIMFILE,    "Load simulation file"
            etc.
        END
        
(note - IDS_FILENOTFOUND, etc, are #defined constants)

Then, in the application:

        char szMessage[64];
        LoadString( hInst, IDS_FILENOTFOUND, szMessage, 64 );
        MessageBox( ..... );
        etc.

>Also is there a way to access strings used by windows so I don't have to
>duplicate translations for things like: ('file not found', 'unable to
>open file', 'file','close','save', etc...
>

Not that I'm aware of, no.

>What I was planning on doing was the following:
>Keep a language file for each language.
>The file will have a number and a string for each phrases, ie:
>1  "File not found"
>2  "Save simulation file"
>       :

A good way to do this with Windows is to have a separate DLL for each
language, containing all the strings resources for that language.
When your application loads, look at the configuration file to decide
which language you want to use, then load the appropriate DLL using
the "LoadLibrary" function.  From there, everything is as above, except
that in the "LoadString" function you use the library handle, as returned
by "LoadLibrary", instead of the application instance handle.

Hope this information is of some use to you.
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------
 
Newsgroups: comp.os.ms-windows.programmer.misc
From: jagrant@emr1.emr.ca (John Grant)
Subject: Re: Tab Stops in combo boxes
Organization: Energy, Mines, and Resources, Ottawa
Date: Tue, 15 Dec 1992 01:20:19 GMT

In article <1992Dec9.164450.6086@nntp.telxon.com> dgarr@nntp.telxon.com (David Garrison) writes:
>
>
>HELP!!
>
>I'm trying to use the tab stops bit in a drop down combo box
>just like a list box.
>
>What I'm doing is setting the tab stop bit for my combo box on and
>adding strings to the box with '\t' characters.  I'm expecting to see
>the drop down box with aligned column string entries but all I get are 
>funny characters in place of the '\t' characters.
>
>This same procedure works fine with a list box.
>
>Does anyone know how to overcome this problem?  Thanx, in advance.
>
	This problem was just discussed and answered in the past
	week or so.

	LBS_USETABSTOPS is for listboxes only - it will not work
	for comboboxes.  You can not use \t tab characters.
	Instead, use sprintf to format your strings with spaces
	between the items and in response to WM_INITDIALOG,
	send a message to the listbox to change the font from
	the default SYSTEM_FONT (proportional pitch) to 
	SYSTEM_FIXED_FONT (fixed pitch):
		SendDlgItemMessage(hdlg,ID_LISTBOX,WM_SETFONT,
		(WPARAM)GetStockObject(SYSTEM_FIXED_FONT),0);
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
From: rhoda@sybase.com (Rhoda Neimand)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Export errors.
Date: 16 Dec 92 16:16:10 GMT
Organization: Sybase, Inc.

In article <724094154.AA00845@etcetc.fidonet.org> smythee@etcetc.fidonet.org (Ean Smythe) writes:
>
>    I'm compiling a Windows application (Microsoft v7) in C.  I ran across
>a "symbol defined more than once", which turned out to be ok, I just didn't
>have the /NOI (NOIGNORECASE) switch on for LINK...
>
>    So I add the /NOI switch to my makefile, and all of a sudden, I get
>the following group of errors :
>
>LINK : error L2022: MainWndProc (alias MainWndProc) : export undefined
>LINK : error L2022: Sale (alias Sale) : export undefined
>LINK : error L2022: NewInv (alias NewInv) : export undefined
>
>    and so on, for every single one of my exported functions.  They *are*
>listed in the .DEF file like always.
>
>    I took the /NOI switch out, and it compiled without errors.
>
>    What's happening?
>

Probably the following:

Routines that you want to export that are not _pascal require an underbar
in the export list of the .def file, e.g. _Sale.  Note that routines
that do not explicitly use the _pascal modifier are, by default, _cdecl
and _cdecl requires the underbar.

Routines that you want to export that do use the _pascal modifier don't
require the underbar.

Any routine that you export that will be called back by someone else,
like Windows or a DLL of your own, must use the _pascal modifier.

Summary:

_pascal modifer               : no underbar in export list
no modifier (which is _cdecl) : underbar in export list

--
Rhoda Neimand			                [I speak for myself]
{sun,lll-tis,pyramid,pacbell}!sybase!rhoda -or- rhoda@sybase.com
"I didn't want to, Jim"		Mr. Spock in _This Side Of Paradise_
Newsgroups: comp.os.ms-windows.programmer.misc
From: tvp@gibdo.engr.washington.edu ()
Subject: Need KLUDGE to make DOS .exe work *my way* from VB app
Organization: clearer than blir
Date: Sat, 12 Dec 1992 04:37:29 GMT

I'm fairly new to Windows programming. I picked up Windows SDK, VB and
Borland C++ 3.1 with the purchase of my home PC last spring.
Basically, all I've been using is BC++, and then only for compiling
straight C.  Realizing this is a waste, I've taken on some small
projects to initiate me in different aspects of Windows programming.

Project 1: Take an old DOS command-line based text filter and convert
           it to a small Windows tool.

[I don't like text entry using word processors; I like input power
through the likes of Emacs, Microemacs and now Microemacs for windows.
The text filter I'm talking about turns whatever I've input from your
typical text file full of hard returns, into flowable text with
command line options of leaving blank lines between paragraphs (or
deleting) and using one (or two) spaces after sentence ending periods.
The source for this filter is "portable" C.]

For conversion, I thought I'd try Visual Basic. (Turns out I kind of
like it, but that's another story.) The way I did it was to put in a
Drive box, Directory box, and File list box (using the standard
idioms) for selecting the input text file; two check boxes repre-
senting the command line options; and Run and Exit buttons. This
interface builds up the appropriate command line string and gives it
to Shell() when the user hits the Run button.  It works, but I don't
like the way the screen goes to DOS momentarily when the exe runs. I'd
rather it just ran in the background.

Question: Are there any good ways of avoiding this?

Since this is a project to learn more about Windows, solutions such as
changing the original C source and going with Windows SDK or BC++ over
VB are also welcome. But a VB interfacing with the original .exe type
solution is best, if possible, as that code already exists.

Thanks in advance.

------------------------------------------------------------------------
Tad Perry      Internet:    tvp@gibdo.engr.washington.edu
               CompuServe:  70402,3020
               NIFTY-Serve: GBG01266
------------------------------------------------------------------------
Newsgroups: comp.os.ms-windows.programmer.misc
From: maley@micro.cs.umn.edu (Michael P Maley)
Subject: Re: two quick owl questions
Organization: University of Minnesota
Date: Wed, 16 Dec 1992 06:08:37 GMT

In <1992Dec15.161603.1213@twisto.eng.hou.compaq.com> mccreary@sword.eng.hou.compaq.com (Ed McCreary) writes:


>two, probably trivial owl questions that I can't seem to figure out.

>Specifying which icon to use in the file manager.  I have an mdi app
>I'm writing, but when I set it up in the file manager, it uses the
>icon from the child window instead of from the frame. when minimized,
>all windows have the proper icon.  Is there something I'm forgetting
>to set?  Can you assign an icon to an application?
I think what is happening here, and what happened with me, is that
FileMan takes the first icon out of the file for its use. Just change
the icon in FileMan, by selecting from the icons in your program. I don't
know how to make it default to the one you want. I think that the
resource editor puts the icons in alphabetically.

>many thanks in advance,
>eddie
>--
>Ed McCreary                                               ,__o
>mccreary@sword.eng.hou.compaq.com                       _-\_<,
>"If it were not for laughter, there would be no Tao."  (*)/'(*)
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Dos Box Icons 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Thu, 17 Dec 1992 22:39:21 +0000

In article <1992Dec17.194435.7959@nwnexus.WA.COM> davidr@halcyon.com writes:

>A number of launchers (including progman.exe) are able to change the
>icon for a full screen dos box to something other than the default.
>Does anyone know how they do it!
>
>
>Regards,
>David
>

It's not in *any* of the manuals, but all the information you need is in
the Windows 3.1 SDK on-line help system.  Search for the topic
"Shell Dynamic Data Exchange Interface Overview".  The information about
how a launcher gets information about the program's icon is described under
the heading "Providing Property Data", towards the end of the topic.

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------
 
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: two quick owl questions 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Tue, 15 Dec 1992 21:54:40 +0000

In article <1992Dec15.161603.1213@twisto.eng.hou.compaq.com> mccreary@sword.eng.hou.compaq.com writes:

>Specifying which icon to use in the file manager.  I have an mdi app
>I'm writing, but when I set it up in the file manager, it uses the
>icon from the child window instead of from the frame. when minimized,
>all windows have the proper icon.  Is there something I'm forgetting
>to set?  Can you assign an icon to an application?
>

The Program Manager uses, by default, the first icon resource listed in
the applications resource file.  If you select the application in Program
Manager, press Alt+Enter to display the "Properties" dialog, then press
the "Icon" button, you should see all the icons present and you'll be able
to select the one you want displayed.

To fix this "problem", just make the applications icon the first one in
the application's resource file.

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------
From: scott@opl.com (Scott Evernden)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: WINDOWS HELP FILE (.HLP) FORMAT
Date: 17 Dec 92 15:45:30 GMT
Distribution: comp.os.ms-windows.programmer.misc
Organization: OPL. Inc.

In article <1992Dec14.221951.18493@husc3.harvard.edu> mwien@husc9.harvard.edu (Michelle Wien) writes:
>
>  Hi,
>  
>  I'm trying to understand the format of the Windows .HLP
>file. Do any of you know if this format is documented ?
>Or has anyone ever tried to extract the text (at least
>some of it) from a .HLP file ?
>
>  There are many formats, including the ones generated by
>hc30 and hc31, with various degrees of compression. I'd
>be happy if someone can tell me what information I should
>look for (and where) at least in an uncompressed .HLP file
>(created w/ hc30 or hc31 and COMPRESSION=NONE).

GOOD LUCK in finding *any* information on the .HLP file
format.  I've been searching for *anything* for months.
I've concluded that Microsoft wants to *own* the entire
potential "knowledge navigator" (Multimedia Viewer, etc)
market, and so will likely *never* make it possible for
anyone but Microsoft to play with WINHELP files. 

I can think of a *lot* of ways to improve on the way
WINHELP works, but until someone spills the beans, or
reverse engineers the format, we're gonna be stuck with
whatever Microsoft thinks we all need...

-scott
Newsgroups: comp.os.ms-windows.programmer.misc
From: conrad@well.sf.ca.us (C. Conrad Cady)
Subject: Want single-picklist C++ class.
Organization: Cady Technical Support Services, 707-763-6635
Date: Thu, 17 Dec 1992 17:00:07 GMT

I'd like a specific C++/Windows class built.

Is there a Windows programmer out there who'd like to make one for me?

The specs are available via email from conrad@well.sf.ca.us, or on the well
from ~conrad/win-spec.zip.  It includes a spec, and a Visual Basic mock-up 
of what I'd like.  The Visual Basic run-time DLL is available as
~conrad\vbdll.zip, if you don't already have it.

I need a GUI_SINGLE_PICKLIST class (and eventually a GUI_MULTIPLE_PICKLIST
class.)  I need the source code, so I can learn how to do it myself later,
and make modifications (as I am sure I will have to, because the spec is
not likely to stay the same.)

Send me e-mail if you're interested.

Thanks, 

Conrad
1
-- 
C. Conrad Cady, conrad@well.sf.ca.us
Cady Technical Support Services, Inc., Petaluma, CA  707-763-6635
My opinions represent my employer.
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: DLL-question
Keywords: Alloc, Peekmessage
Date: 15 Dec 92 17:48:09 GMT
Organization: PE-Nelson

In article <2914@media03.UUCP>, rla@media03.UUCP (Raymond van der Laan) writes:
|> Is this possible in a DLL:
|> 
|>     ... x;
|>     ... y;
|> 
|>     f1 ()
|>     {
|>         y = GlobalAlloc(...);
|>         x = GlobalLock(y);
|>         PeekMessage()
|>         if ours then memcpy(x,...,...);
|>         else Translate & DispatchMessage
|>         ...
|>     }
|> 
|>     f2 (a)
|>     {
|>         memcpy(a, x, ...);
|>         GlobalFree(y);      <-------------\
|>     }                                     |
|>                                           |
|> The caller calls f1, then f2.             |
                                             |
Yes, but some considerations:                |
                                             |
  - Don't forget the GlobalUnlock().  -------/

  - If x and y are global variables for the DLL then f1() and f2() are
    not reentrant.  Consider what happens if you have two applications
    using your DLL and the translate/dispatch within f1() for app1 causes
    app2 to call f1().

    This is probably not a concern for you, but if it is then you will
    want to take some steps to either prevent reentrancy, provide
    some form of mutual exclusion in f1() and f2(), or allow x and y
    to be instance variables for each application using the DLL.

  - The above example is clear enough in what it does, but not at all
    clear is why you are considering this.  What is happening in your
    application that requires this functionality in a DLL?



----------------------------------------------------------------------------
Tom Brown               |  "She turned me into a newt...
PE Nelson Systems       |                                  ... I got better"
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Windows' Serial Port 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Sat, 12 Dec 1992 18:22:57 +0000

In article <57000004@hplvec.LVLD.HP.COM> rozum@hplvec.LVLD.HP.COM writes:

>I have just resently started programing in the Windows 3.1 environment.
>
>I have been trying to figure out the serial capability using windows.
>
>My questions are as follows:
>
>1) How do I read and write to a serial port?
>

It's pretty easy.  Just use the OpenComm, ReadComm, WriteComm, CloseComm
functions for the actual reading and writing, and "BuildCommDCB" and
"SetCommState" if you want to set the port characteristics.

If you're using Windows 3.0, you'll need to keep polling the comms port to
see if data has arrived.  In 3.1 it's a lot easier.  Call
"EnableCommNotification" and you'll the be send "WM_COMMNOTIFY" messages
when data arrives, or when a transmission finishes.

>2) How fast can Windows received data without data being over-
>   written in the serial's data register?  In other words,
>   does Windows have a serial buffer, if so how fast can the serial
>   data be retrieved?
>

With a "standard" serial port card, the practical limit is probably 9600 bps.
With a 16550-based card you can go to 38400 without too many problems.
If you're using Windows-based comms, it's probably sensible to tell the user
(or,better, get your installation program) to set the "COMxBUFFER" parameter
in the WIN.INI file.  Default value is (I think) 128 bytes.  2k or so is a
more sensible value to use.

>3) When working with the serial port is there any special
>   consideration that needs to be taken into account?
>

I can't think of any.  Obviously, writing comms software is never exactly
easy, but I've found it easier to do in Windows than DOS.

Hope this information helps.

--------------------------------------------------------------------------
| Chris Marriott                   | chris@chrism.demon.co.uk            |
|                                  | BIX: cmarriott                      |
| (Still awaiting inspiration      | CIX: cmarriott                      |
|  for a witty .sig .... )         | Compuserve: 100113,1140             |
--------------------------------------------------------------------------
 
Newsgroups: comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.tools
From: d88-jwa@dront.nada.kth.se (Jon Waette)
Subject: Re: MFC and Borland IDE
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 16 Dec 1992 19:49:55 GMT

In <61589@aurs01.UUCP> lynch@aurs01.uucp (David Lynch) writes:

>Ok, most of us agree that the Microsoft MFC class library is
>superior to Borland's OWL for windows programming, and the
>Borland windows IDE is light years ahead of the Microsoft PWB

I heard Borland was a better (easier?) framework than MFC.
MFC is not an application framework worth the name, it's
just a collection of loosely related classes and you need
a LOT of extra work to do anything non-trivial in MFC.

Or does it have a turbo mode I didn't notice? :-)

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

   There's no sex act that can't be made better with Yell-O.