HDTenEightyP/NetNews huggingface dataset:
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Problems with Clipping Regions
Date: 17 Dec 92 00:34:20 GMT
Organization: PE-Nelson

In article <1992Dec16.152731.45692@kuhub.cc.ukans.edu>, 2ftptimely@kuhub.cc.ukans.edu writes:
|> I am having a hell of a time with
|> the Windows API call
|> SelectClipRgn(...)
|> 
|> I select a region and clipping works fine but 
|> when I try to unselect the region wDeleteObject(ClipRgn)
|> Then everything else that I paint to
|> that DC is still "clipped". What I want
|> is to restore the DC to how it was before I
|> gave it a new clipping region. This is the
|> DC given to me in the PAINT routine of 
|> Borland OWL in the TWindow class. Any
|> thoughts?

When you select a clipping region a copy of the region is placed into the
DC.  Simply using DeleteObject on your region will not affect the copy that
you placed (selected) in the display context.  You need to use SelectClipRgn
with a NULL region handle to remove clipping.

If there may have been a different clipping region in effect before you gave
the DC yours then use SaveDC()/RestoreDC() around your code:

	SaveDC(hDC);		// push DC on a special GDI stack
	.
	.			// setup new clipping and paint
	.
	RestoreDC(hDC, -1);	// restore DC from top of stack


----------------------------------------------------------------------------
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: v37262d@kaira.hut.fi (Mancko H|glund)
Subject: Re: Status Line in MDI Application
Reply-To: ebbe@shsibm.shh.fi
Organization: Helsinki University of Technology, Finland
Date: Thu, 17 Dec 1992 07:10:27 GMT

In article <1992Dec15.082236.21852@neptune.inf.ethz.ch> skimmel@iiic.ethz.ch (Stefan Martin Kimmel) writes:

>Do I have to create an own "status line" MDI Child or is there an
>easier possibility? 
>
>Is there some sample code around (ftp)?

Check out the MULTIPAD sample app that came with the Microsoft C7 compiler.
That features a basic MDI status bar which shouldn't be to difficult to
customize into whatever you have in mind. 
Also, you could pull the file 26.zip from ftp.uu.net in
/vendor/microsoft/developer-network/win; that depicts how to go about
producing a status bar.

	...ebbe


+----------------------------------------------------------------------------+
v37262d@kaira.hut.fi:	Mancko H|glund 	(mancko@shsibm.shh.fi) or  
			Ebbe Jonsson	(ebbe@shsibm.shh.fi)
+----------------------------------------------------------------------------+
Newsgroups: comp.os.ms-windows.programmer.misc
From: torstein@itekiris.kjemi.unit.no (torstein hansen)
Subject: Re: Programming for foreign languages
Organization: Dept. of Chem.Eng, Norwegian Inst. of Tech
Date: 14 Dec 92 18:17:39

In article <1992Dec12.185658.13375@serval.net.wsu.edu> rnelson@wsuaix.csc.wsu.edu (roger nelson;S23487) 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.

   I am using both Borland C++ w/AF and Borland Pascal for windows, and
   am new to windows programming.

   Presently I keep a file of constant declarations (Pascal) or #defines (C)
   and include the file for the respective language at compile time.
   I would prefer to sort out the language stuff at runtime because most
   of my users want to be able to switch to another language but not have
   to install a different version. 
   But I don't want to take up space to read in the language strings.
   The list of language strings must be easy to maintain and reorganize
   since I have several hundred phrases for each language and I often add
   new phrases.

   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.

   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...

   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 language definition file will keep a list of program defines:
   #define L_File_not_found 1
   #define L_Save_simulation_file 2
     :


   When the program starts or when a different language is selected, the respective
   file is loaded in a linked list (search tree) indexed by phrase number.

   When I want to use the string I would use the following function:

      translate(language,L_File_not_found)

   Where language is the current language number returned by windows.
   Translate would then lookup the phrase number in the search tree and
   return the phrase string.

   Does anyone have a better way to do this in Windows?

   Thanks,  Roger

You could make a resource-only DLL with the translated strings for
each of the languages you wish to support. You could then let the user
choose wich language to use at install time. See the documentation for
Borland Resource Workshop on how to make string resources.

I would recommend that you should have translations of all your
strings, as a user may run the italian version of your program on an
english version of Windows.

Good luck!

Torstein
--
Torstein Hansen
torstein@itekiris.kjemi.unit.no
Newsgroups: comp.os.ms-windows.programmer.misc
From: dj@ekcolor.ssd.kodak.com (Dave Jones)
Subject: Re: Status Line in MDI Application
Organization: Vonnegut Tent Rentals, Inc.
X-Newsreader: TIN [version 1.1 PL7]
Date: Tue, 15 Dec 92 16:30:49 GMT

Stefan Martin Kimmel (skimmel@iiic.ethz.ch) wrote:
> I am currently programming an application using MDI. I want to use
> a status line at the bottom of the application to display status 
> information (like e.g. WfW).
> 
> Do I have to create an own "status line" MDI Child or is there an
> easier possibility? 

Create a child, but don't make it an MDI child.  Just make it a control
that you maintain yourself.  Reduce the client area of the MDI frame so that
the actual MDI children don't overlap it.

--
||------------------------------------------------------------------------
||Dave Jones (dj@ekcolor.ssd.kodak.com)|Eastman Kodak Co. Rochester, NY  |
From: rbarker@endor.dpl.scg.hac.com (Roger Barker)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Print Scaling Problem with Windows/DESKJET 500
Date: 11 Dec 92 14:40:41 GMT
Distribution: na
Organization: Hughes Aircraft Co., El Segundo, CA

I'm running Borland's Objectvision 2.1 with Windows 3.1. I'm having
trouble getting my printer (DESKJET 500) to print what's on my screen.
Here's an ASCII sample of my graphical problem.

My Monitor:

	-------------------------------------------------------------
	|This is a Forms Based Application Written with Objectvision|
	-------------------------------------------------------------

        Field Name: Field Value

My Printer:

-------------------------------------------------------------------------
|       This is a Forms Based Application Written with Objectvision     |
-------------------------------------------------------------------------

Field Name:        Field Value



Visualize the 'graphical' border as being the same size in each example
but the text shrunk.  Actually, the graphical border stays in proportion
(as far as I can tell) but the text shrinks (relative to the outline).
The text shrinks throughout my form but it's easier to illustrate with
the attached graphical border.

The font I'm currently using is Courier 10 (I've also tried CG Times).
I'm using HP's new Deskjet Driver's for Windows 3.1 (I forget the
version of the Driver). I've tried the TrueType fonts without success
as well as the standard font sets for the Deskjet. I've explained the
problem to HP, Microsoft and Borland and naturally they say it's someone
elses problem.

1) Anyone seen this specific problem?

2) Anyone seen this problem in other Windows applications?

3) Any ideas how to correct this? Is it something simple?


Newsgroups: comp.os.ms-windows.programmer.misc
From: rryan@panix.com (Rob Ryan)
Subject: Re: Borland and Memory
Date: Wed, 16 Dec 1992 18:25:13 GMT
Distribution: usa
Organization: Panix, NYC

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

>I seem to have a point in my code, where I am stuck.
>
>I do a lot of new and delete inside my code, and first,
>I do see a memory leak somewhere, but I can;t pin it down.
>
>The problem I have is that the program just spins.  This
>can happen in two different places - either when I declare ofstream ofs(name),
>or when I'm in a loop allocating a 2 dimensional array - similar to the
>following
>
> [ ... code deleted ... ]

As recommended by another user, make sure that you're using a memory model
large enough to support all the data you're using.  Also, make sure you
check the results of the "new" allocation so you can determine if everything
works or not, and report a failure when it does occur.

I wanted to try this out, though, and got some curious results.  I initially
tried Borland's EasyWin and kept on getting GPFs.  So, while the command
line versions of Borland C++ v3.1 and MSC v7.0 dealt with the following code
fine (reporting errors allocating at row 14, which makes sense given how
much data I'm allocating).  And when I tried from Windows, Microsoft's
QuickWin worked fine, too (reporting allocation failure at row 12, which
also makes sense due to overhead of Windows processing).  What failed to
work was Borland's EasyWin.  It got a GPF when I tried this program with it.
I don't know why, though, since the code seems safe.  I presume this is a
bug in EasyWin's memory allocation routines.

Assuming that you're not using EasyWin, you'd presumably want something
like the following.  Incidentally, when I decrease the numbers to 150 and
30, the program works without incident.  And I don't know why the ofstream
would be causing a problem.  Have you tried running the code through a
debugger and seeing where the problem occurs?

-------------------------------- cut here --------------------------------

#include <iostream.h>

const long MAXX = 1000;
const long MAXY = 1000;

main()
{
	float **pn = new float *[MAXX];

	if (!pn) {
		cerr << "failed initial allocation";
		return -1;
	}

	for (int i = 0; i < MAXX; i++) {
		pn[i] = new float[MAXY];
		if (!pn[i]) {
			cerr << "failed allocation of row " << i << endl;
			return -2;
		}
	}

	return 0;
}

-- 
 Rob Ryan
    rryan@panix.com
Newsgroups: comp.os.ms-windows.programmer.misc
From: mak@vulcan.xtel.co.uk (Martijn Koster)
Subject: Bringing Application Windows to the top
Organization: X-Tel Services Ltd.
Date: Thu, 17 Dec 92 12:23:21 GMT


Hi,
I`ve got fairly simple question:

	Given a HWND, how can I bring an Application window to the top?

I want only one instance of my application to run, and like in the
File Manager I'd like the current instance of my program to come
to the front when the user selects my program-item from the 
Program Manager.
To do this I check for a previous instance on startup, and if there
is one I use EnumWindows to step through the windows looking for
the one belonging to the previous instance. This works fine, I
can set the title of that window. But now I want to bring that 
application to the top. I tried SetWindowPos(hwnd, HWND_TOPMOST,
0, 0, 0, 0, WPS_NOSIZE | WPS_NOMOVE), but nothing happens.

Any suggestions greatly appreciated.

-- Martijn
Newsgroups: comp.os.ms-windows.programmer.misc
From: stephen@eggneb.astro.ucla.edu (Stephen Schimpf)
Subject: Multi-Edit
Organization: UCLA Dept of Astronomy
Date: 11 Dec 92 15:03:19 PST

I would very much appreciate comments from anyone out there who is
using an editor called Multi-Edit from American Cybernetics. Judging
by the ads I've seen, it looks like a pretty nice editor with the
features I want right now. (I try and I try but Microsoft's PWB screws
me again and again. Yes, I have the patch. What a joke.)

Thanks for any information.

Stephen.
Newsgroups: comp.os.ms-windows.programmer.misc
From: duitz@mksol.dseg.ti.com (mitchel n duitz)
Subject: Re: Borland and Memory
Organization: Texas Instruments, Inc
Distribution: usa
Date: Thu, 17 Dec 1992 16:00:15 GMT

In article <1992Dec16.182513.5844@panix.com> rryan@panix.com (Rob Ryan) writes:
>In <1992Dec15.144205.16197@mksol.dseg.ti.com> duitz@mksol.dseg.ti.com (mitchel n duitz) writes:
>
>>I seem to have a point in my code, where I am stuck.
>>
>>I do a lot of new and delete inside my code, and first,
>>I do see a memory leak somewhere, but I can;t pin it down.
>>
>>The problem I have is that the program just spins.  This
>>can happen in two different places - either when I declare ofstream ofs(name),
>>or when I'm in a loop allocating a 2 dimensional array - similar to the
>>following
>>
>> [ ... code deleted ... ]
>
>As recommended by another user, make sure that you're using a memory model
>large enough to support all the data you're using.  Also, make sure you
>check the results of the "new" allocation so you can determine if everything
>works or not, and report a failure when it does occur.
>
>I wanted to try this out, though, and got some curious results.  I initially
>tried Borland's EasyWin and kept on getting GPFs.  So, while the command
>line versions of Borland C++ v3.1 and MSC v7.0 dealt with the following code
>fine (reporting errors allocating at row 14, which makes sense given how
>much data I'm allocating).  And when I tried from Windows, Microsoft's
>QuickWin worked fine, too (reporting allocation failure at row 12, which
>also makes sense due to overhead of Windows processing).  What failed to
>work was Borland's EasyWin.  It got a GPF when I tried this program with it.
>I don't know why, though, since the code seems safe.  I presume this is a
>bug in EasyWin's memory allocation routines.
>
>Assuming that you're not using EasyWin, you'd presumably want something
>like the following.  Incidentally, when I decrease the numbers to 150 and
>30, the program works without incident.  And I don't know why the ofstream
>would be causing a problem.  Have you tried running the code through a
>debugger and seeing where the problem occurs?
>
>-------------------------------- cut here --------------------------------
>
>#include <iostream.h>
>
>const long MAXX = 1000;
>const long MAXY = 1000;
>
>main()
>{
>	float **pn = new float *[MAXX];
>
>	if (!pn) {
>		cerr << "failed initial allocation";
>		return -1;
>	}
>
>	for (int i = 0; i < MAXX; i++) {
>		pn[i] = new float[MAXY];
>		if (!pn[i]) {
>			cerr << "failed allocation of row " << i << endl;
>			return -2;
>		}
>	}
>
>	return 0;
>}
>
>-- 
> Rob Ryan
>    rryan@panix.com

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.

Newsgroups: comp.os.ms-windows.programmer.misc
From: doug@cc.ysu.edu (Doug Sewell)
Subject: How would you program this ?
Organization: Bush in 92 ? NOT!
X-Newsreader: Tin 1.1 PL4
Date: Sat, 19 Dec 1992 02:30:47 GMT

I have to retrieve three related numbers from a user (they're the count
of two-dimensional tables, and the dimensions of the tables).

The number of tables ranges from two to four.
The columns range from two to four, for each of the tables.
The rows in each table range from five to ten.

For alternatives to retrieve the values, I see three options (I'm using
VB, incidentally). 

Three text boxes, with editing on each field (this is what I'm leaning
towards).

Radio buttons.

Some sort of selection list like the "select a font" menu.

This will be my first "serious" windows app.
--
Doug Sewell, Tech Support, Computer Center, Youngstown State University
doug@cc.ysu.edu	   doug@ysub.bitnet	<internet>!cc.ysu.edu!doug

cat core | uuencode bunny.dropping | mail jp@tygra.michigan.com
Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
From: yefchak@hplabsz.hpl.hp.com (George Yefchak)
Subject: Re: How to distinguish between Click and Double-Click?
Date: Fri, 18 Dec 1992 01:22:28 GMT
Organization: Hewlett-Packard Laboratories Palo Alto,CA
X-Newsreader: TIN [version 1.1.4 PL6]

Are the second opinions on that?  I think I've seen software
which does seem to be able to distinguish between single
and double clicks as described above.  (Actually, I've
wanted to know how to do that too...)  In particular,
on the Mac you have only one button, so this ability seems
pretty important there.
--George Yefchak

Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Problem with large DGROUP segment, MS C7 
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:58:09 +0000

In article <8051@skye.ed.ac.uk> jacs@aiai.uucp writes:

>Hi,
>
>I'm compiling a largish Windows program with MS C7, large model, and linking
>gives me an L1074 error - DGROUP segment larger than 64K.
>How can I get round this, or can I?  For some reason,
>generating a MAP file doesn't work (the file is empty) although
>I've given the /MAP:FULL and /LI options to the linker.
>
>Heeeelp....!
>
>Thank you for any tips.
>
>Julian Smart
>jacs@aiai.ed.ac.uk
>

There are several options:

1.  Use the "/Gtn" flag to tell the compiler to put all items greater than
    "n" bytes long into FAR DATA.

2.  If you have any global or static arrays, use "malloc" or "GlobalAlloc"
    instead.

3.  Put any quoted strings into a STRINGTABLE resource in the program's RC
    file.

4.  Make sure the stack is no larger than it has to be.

These measures should help.

-- 
--------------------------------------------------------------------------
| Chris Marriott                   | chris@chrism.demon.co.uk            |
|                                  | BIX: cmarriott                      |
| (Still awaiting inspiration      | CIX: cmarriott                      |
|  for a witty .sig .... )         | Compuserve: 100113,1140             |
--------------------------------------------------------------------------
From: warren@nbnz.co.nz (warren adams)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Pure virtual function calls
Date: 20 Dec 92 23:29:52 GMT
Organization: NationalBankNZ
X-Newsreader: Tin 1.1 PL4

What is the easiest way to find the cause of a pure virtual function
call error.  I know that it happens when an object that has virtual
functions in it deleted and then one of the virtual functions is called.
The problem is locating the deleted object that is being called.

I have been unable to locate it by examining the code or using TDW. (TDW
says the program has terminated if you CTRL-ALT-Break when the message
is on screen.)

Any ideas appreciated.

Thanks in advance
Warren
From: johnm@CIS.Prime.COM (John Mason)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Porting X applications to Win32
Date: 15 Dec 92 16:14:52 GMT
Reply-To: johnm@CIS.Prime.COM
Organization: Computervision R&D Ltd


   I am currently looking into the feasibility of porting an X application to
   Windows NT/Win32. My X application consists of two cooperating processes;
   a UI engine and a graphics engine. Amongst other things, the UI engine is
   responsible for creating graphics windows within a strictly defined presentation
   area, and then passing the handles to these graphics windows to the graphics
   engine. The graphics engine is then able to draw graphics and process X events
   in these windows, just as if it had created them itself. My question is this.
   Will Windows NT/Win32 support this type of architecture (ie sharing windows
   between different processes) ?

   Thanks
   John Mason
From: bsm@utrcv1.res.utc.com (Brian S. McCarthy)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Problems calling a DLL function from a VB app. PLEASE HELP!
Date: 15 Dec 92 21:09:49 GMT
Organization: United Technologies Research Center

In article <1992Dec15.135809.5339@u.washington.edu> tvp@gibdo.engr.washington.edu writes:
>From: tvp@gibdo.engr.washington.edu
>Subject: Problems calling a DLL function from a VB app. PLEASE HELP!
>Date: 15 Dec 92 13:58:09 GMT
>
>Okay, I posted a few days ago about not wanting the screen to blank
>for the few seconds it took me Shell() out to DOS to run an .exe
>utility (written in C) that I was calling from inside my VB app.
>
>I rewrote the inside of my C source to compile it into a .dll file.
>Then I followed the instructions in the VB manuals to declare and call
>the function inside the DLL that was replacing the standalone C app I
>used to use under DOS. But when I hit F5 to test the VB app, and get
>to the part where I push the command button that will cause the DLL
>function to be called, it fails and tells me:
>
>          "Function or sub undefined"
>
>It also highlights the line where the function is called in the
>source.  This is pretty maddening because the function IS defined
>right there in the Declarations section of the form. And it's defined
>correctly as far as I can tell too, it's of the proper type, with no
>mispellings in the Function name or the Lib path. Does anyone know
>what's up and how I can fix it? I'M STUCK!
>
>Thanks in advance to anyone who can help me.
>
>------------------------------------------------------------------------
>Tad Perry      Internet:    tvp@gibdo.engr.washington.edu
>               CompuServe:  70402,3020
>               NIFTY-Serve: GBG01266
>------------------------------------------------------------------------
Are you using Borland C?  If so, I may have the answer.  It may even apply 
to Microsoft C; I don't know.  Is your DLL function declared as an export in 
your DEF file?  Like this:

LIBRARY        DLLEX
DESCRIPTION    'Borland C DLL example'
EXETYPE        WINDOWS
CODE           PRELOAD MOVEABLE DISCARDABLE
DATA           PRELOAD MOVEABLE SINGLE
HEAPSIZE       20480
EXPORTS        MyOwnFunctionName     <------- (right here)
               OtherFunctionName
               EtCetera

I was able to duplicate your error message "sub or function not defined" 
simply by deleting the name of one of my functions from the 
EXPORTS list.  Hope this helps.                
---------------------------------------
Any opinions expressed here are mine alone,
and are not those of my employer or anyone else.

Brian McCarthy
United Technologies Research Center
East Hartford, Connecticut
(203)727-7638
bsm@utrc.utc.com
---------------------------------------
Newsgroups: comp.os.ms-windows.programmer.misc
From: mccreary@sword.eng.hou.compaq.com (Ed McCreary)
Subject: Re: two quick owl questions
Organization: Compaq Computer Corp.
Date: Wed, 16 Dec 1992 18:47:07 GMT

In article <maley.724486117@micro> maley@micro.cs.umn.edu (Michael P Maley) writes:
>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.

Yep, that did the trick.  FileMan picks the first icon in the resource
and they are sorted alphabetically.  changing the name of the icon
fixed it right up!

--
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