HDTenEightyP/NetNews huggingface dataset:
Newsgroups: comp.os.ms-windows.programmer.misc
Date: Mon, 14 Dec 1992 18:42:39 -0500 
From: Andrew Joseph Kompanek <ak10+@andrew.cmu.edu>
Subject: Segmented Memory Woes and Portability


I recently started porting some data structure libraries I wrote on Unix
to the PC under Windows 3.1.  I'm using Borland C++ 3.1.

I naively assumed that all of the segmented memory issues would be
more or less transparent to me and that the compiler would take care
of pointer conversions, alignment problems, etc.  I figured if I
compiled my code with the Compact option, my pointer declarations
would be interpreted as far pointers and that I could address within a
1 Mb address space without changing a bit of my code.  This doesn't
_seem_ to work, though I just started and still don't know very much
about the 80x86.

So, if this doesn't work, what is the best way to write code portable to
80x86 architectures -- both under DOS and in Windows programs and DLLs?

I realize with a little research and a lot of #ifdefs I could write some
portable code but it would be extremely useful to be able to hide the
PC-specific code from the programmer using malloc().  Has somebody put
some sort of library together?

Alternatively, is it possible to simply call GlobalAlloc() or whatever
the function is to allocate memory from Windows global heap, convert the handle
to a far/huge pointer (the pointer declarations somehow declared this way
implicitly), lock the memory then when you're done with it, convert the
pointer back to a handle, unlock and free it?  This seems like sensible
behavior -- assuming that this doesn't force Windows to keep in memory
stuff that should it should be able to move and swap in/out.

As a programmer, it doesn't seem like I should have to deal with the
quirks of the processor I'm running on...

My understanding of the 386/486 is that it has better support for virtual
memory management and that its virtual 32-bit pointers look like contiguous,
unmoving addressable memory.  Is there a way to do this in Borland C++ 3.1?
Judging from some of the other posts about memory management, it seems that
a lot of people might benefit from discussing some of the stuff I've
brought up.  If this is FAQ material, I'm sorry for clogging network
bandwith with this message.

Drew


------------------------------------------------------------------------------
Andrew Kompanek                        e-mail: drew@chimera.hgen.pitt.edu,
Department of Human Genetics                  ak10@andrew.cmu.edu,
University of Pittsburgh                      kompanek@cs.cmu.edu
------------------------------------------------------------------------------
Newsgroups: comp.os.ms-windows.programmer.misc
From: jagrant@emr1.emr.ca (John Grant)
Subject: Re: Segmented Memory Woes and Portability
Organization: Energy, Mines, and Resources, Ottawa
Date: Tue, 15 Dec 1992 17:48:02 GMT

In article <711@lax.lax.pe-nelson.com> twbrown@PE-Nelson.COM (Tom W. Brown) writes:
>In article <wf=Fjj_00WB8QZoUYr@andrew.cmu.edu>, ak10+@andrew.cmu.edu (Andrew Joseph Kompanek) writes:
[...stuff deleted about segmented memory confusion...]

Here's Tom's answer:

>Certainly it's possible to do that though I've tried to stay away from huge
>pointers because; 1) of the overhead in their use,
	Yes, but it's really not that bad is it?

 2) they chew up selectors, 
	Tom, could you please explain this - I don't understand.

>and 3) the "conventional" normalized huge pointers can't be used in
>protected mode Windows programming.
	I don't understand this either.  Are there 2 kinds of huge
	pointers? - "conventional" & "non-conventional"?  And why
	can't they be used in protected mode?

[...more stuff deleted...]

I reposted this because I thought the questions and Tom's answers
might be of general interest.
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
From: derekl@harlqn.co.uk (Derek Law)
Subject: Force DLL to unload
Organization: Harlequin Limited, Cambridge, England
Distribution: comp
Date: Fri, 18 Dec 1992 10:07:38 GMT

Does anybody know how to FORCE Windows 3.1 to unload a DLL? I'm
developing a DLL, but every time I change it I have to quit and
restart Windows - otherwise Windows complains that the file is "still
in use" and so write protected.

This is getting rather irritating.

TIA, Derek Law, Harlequin Ltd
Newsgroups: comp.os.ms-windows.programmer.misc
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: About editors
Keywords: uEmacs
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Fri, 18 Dec 1992 17:56:22 GMT

Okay, one day later, with an overwhelming million-to-nothing,
my mailbox got flooded by recommendations for MicroEmacs,
available in version 3.9 from the usual sites. It's on a
floppy on its way to a waiting machine, I tell ya' !

Cheers and thanx,

							/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
 Engineering: "How will this work?" Science: "Why will this work?" Management:
 "When will this work?"  Liberal Arts: "Do you want fries with that?"
                     -- Jesse N. Schell
Newsgroups: comp.os.ms-windows.programmer.misc
From: gtonwu@Uz.nthu.edu.tw (Tony)
Subject: Can't read from system device AUX ?!
Organization: National Tsing Hua University (HsinChu)
Date: Tue, 15 Dec 1992 08:22:21 GMT

Hi,  there !


        I am new to the programing on Microsoft Windows !
        Recently, I suffered an error message and got down. 

        The message is "Can't read from system device AUX" !!

        First, I want to ask about the "AUX" . I have heard it many
        times but I don't know what it means ! Second,from what this 
        message results and how to solve it !?

           Thanx for replying !

            Tony Wu.
                gtonwu@uz.nthu.edu.tw
-- 
  __________________________
  |       TONY        |   -|    Name  :  Tony Wu.
  |___________________|    |    
  |         @         |175-|    School:  CHE 95 , NTHU , Hsin-Chu , 
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Status Line in MDI Application 
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 18:55:33 +0000

In article <1992Dec15.082236.21852@neptune.inf.ethz.ch> skimmel@iiic.ethz.ch writes:

>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? 
>
>Is there some sample code around (ftp)?
>
>I am using MS C7. Thanks for your help
>
>        Stefan
>
>Stefan Kimmel                           skimmel@inf.ethz.ch
>
>

There are a number of different ways to set up a status line, but this is the
method I use, which works well:

1.  Create a "status line" window which is a child of the *Frame* window,
    ie, NOT an MDI child.

2.  When you receive a WM_SIZE message in the frame window procedure,
    carry out the following actions:

    a)  Decide how high the status line window should be.  This is normally
        fixed, so you can just store it somewhere.

    b)  Call "MoveWindow" to reposition the status line window at the bottom
        of the frame window's client area, setting its width equal to the
        width of the main window's client area.

    c)  Call "MoveWindow" again to resize the MDI client window window,
        setting its height equal to the height of the frame window's client
        area minus the status line window's height, and its width equal to
        the width of the frame window client area.

    d)  Return 0 from the window procedure.  Do NOT call DefFrameProc!!!!

This should get you want you want - a status line which stays at the bottom
of the main window, with the MDI children positioned above it.

Hope this helps you.

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: kimmel@staff.tc.umn.edu (Eric Kimmel)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: OWL: How to access lpCmdLine
Date: 20 Dec 92 21:22:40 GMT
Organization: University of Minnesota

In article <16DEC199223145238@trentu.ca> rbarclay@trentu.ca (ROSS BARCLAY) writes:
>
>I'm having trouble accessing the data in lpCmdLine from my OWL
>program. When I click a button, I want the lpCmdLine string to be put
>into an edit box.
>
>All I could figure out was that its a data element of TModule. Other
>than that, I don't know how to get at it. My guess is that I need to
>pass it from WinMain to the function I need. Is this correct?
>
>Can anybody point me in the right direction?
>
I'll probably get ripped for this, but I just copy it to a global variable
in WinMain and use that.  -Rick

>Thanks.
>________________________________________________________________________________
>"Here, finish your strudel! <Crash>"           Ross Barclay - RBarclay@TrentU.CA
>________________________________________________________________________________
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Bringing Application Windows to the top 
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 18:40:56 +0000

In article <1992Dec17.122321.20939@cs.nott.ac.uk> mak@vulcan.xtel.co.uk writes:

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

Using "EnumWindows" isn't necessary.  All you need to do is say:

    if (hPrevInstance!=NULL) {

        // Find the window handle of the previous instance.

        hWnd = FindWindow( "MyClassName", NULL );
        
        // If the window is iconic, restore it.

        if (IsIconic(hWnd)) OpenIcon(hWnd);

        // Bring the window to the front.

        BringWindowToTop( hWnd );
        return 0;
    }

This should do the trick.

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: tanc@cs.curtin.edu.au (Chye Hock Tan)
Subject: Help! I need Latex fonts in Windows .fon format
Keywords: fonts Latex
Organization: Curtin University of Technology
Date: Tue, 15 Dec 1992 09:23:18 GMT


What I need is a complete set of Latex mathematical symbols in the 
window .fon format (either raster or TypeType {prefered}). These symbols are
meant to be used in the z specification editoor program that I am
writing. 

If these Latex symbol fon do exist (either free or commercialy 
available), could the guru out there please tell where can I get them and 
how much does they cost.

If I could not find all the symbols in the window .fon
format, I will be forced to create a new .fon file. 

Since I may be creating a fairly large number of symbol, could 
someone tell me the software package (either free or commercialy 
available) which I can used to create them.

Two packages that I saw in the advertisment for creating fonts are:

	1. Fontographer for Windows
              - Does it support the construction of TrueType fonts?
	2. FontMongers for Windows
	
Anyone which can provide any additional information on these 2 packages is
greatly appreciated.



Newsgroups: comp.os.ms-windows.programmer.misc
From: kress@kentrox.uucp (Bill Kress)
Subject: Re: A sane editor to replace PWB ?
Keywords: emacs
Organization: ADC Kentrox - Portland, Oregon
Date: Thu, 17 Dec 1992 18:33:38 GMT

Actually, there are a few features in PWB that can't be replaced easily.  The
makefile creation is something I've never seen anywhere else, and the source
browser would be difficult to duplicate.  Borland's IDE does the same thing,
but not if you're running the Microsoft compilier, and borland isn't quite
as flexible.

PWB is a pain in the butt to use!  If you want something easy use whatever you
usually use just put it in a dos window.  If you're a professional programmer
buy CodeWright from Premia, it can do almost everything except the Makefiles
and Browsing, and can do a lot of other things too.

If you're not a professional use borland or maybe Visual Basic :)

    Bill.
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Subject: Re: Data links to Excel? 
Distribution: world
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Date: Sun, 20 Dec 1992 01:17:24 +0000

In article <BzInst.853@news.chalmers.se> d6caps@dtek.chalmers.se writes:

>OLE is fine, but it isn't really what I want. 
>Is it possible to use for instance Excel as a Chart Engine, feeding with
>data out of my own picking, and updating for instance once a minute?
>I wouldn't want to re-invent the wheel and make my own diagram engine, when
>all spreadsheet applications have exactly what I want (or rather, my
> customers).
>The easiest way would be to, somehow, create a text-based link to a spreadsheet
>(tab-delimited text would be slow, but if it works, fine). If I could get ahold
>of the internal data structures of for instance Excel, I could perhaps send
>more customized data to be sent on to an Excel chart.
>OLE only does objects, no interpretation of the object data is done (from what
>I've seen).
>Would the Mac system 7 subscribe and publish work, and if so, why can't Windows
>do that?
>
>Anyone?
>Per
>

You should be able to do what you want with DDE.  I would suggest getting
hold of the "Excel Developer's Kit", obtainable from Microsoft at a low
price.  It explains all.

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: jagrant@emr1.emr.ca (John Grant)
Subject: Re: I need all of the RTF codes
Organization: Energy, Mines, and Resources, Ottawa
Date: Wed, 16 Dec 1992 04:34:33 GMT

In article <BzBAv2.540@news.cso.uiuc.edu> cjs33278@uxa.cso.uiuc.edu (Carl Samos) writes:
>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!
>
	I phoned the MicroSoft help desk and they sent me a 20 page
	document entitled:
		"MicroSoft Rich Text Format Specification"
	which describes all of the codes.  Sorry, I don't have a
	digital copy.

	I don't know the US number - I called MicroSoft Canada in Toronto.
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Newsgroups: comp.os.ms-windows.programmer.misc
From: jsalcido@nmsu.edu   (Jason Salcido)
Subject: need help please!
Organization: New Mexico State University
Date: Mon, 14 Dec 1992 23:46:49 GMT


I need help understanding how to instantiate a window class from within another  
window class method.   When I try I know that constructor is run but nothing  
happens.  If I stick the command in the constructor of the first window class  
it does work.  Can someone tell me what I'm doing wrong?

for example:

(in window class)
private:
   AnotherWindow *A;

(in window method)

A = new AnotherWindow(this,"Another Window");

please e-mail me with any suggestions.

jsalcido@nmsu.edu
Newsgroups: comp.os.ms-windows.programmer.misc
From: yefchak@hplabsz.hpl.hp.com (George Yefchak)
Subject: Re: How to make a Long from ints in VB
Date: Fri, 18 Dec 1992 01:25:59 GMT
Organization: Hewlett-Packard Laboratories Palo Alto,CA
X-Newsreader: TIN [version 1.1.4 PL6]

There may be a better way, but I just did something like
new_long = hi_int * 65536 + lo_int.  

--George Yefchak

Newsgroups: comp.os.ms-windows.programmer.misc
From: dgarr@telxon.telxon.com (David Garrison)
Subject: FTP Sites?
Organization: TELXON Corporation
Distribution: na
Date: Wed, 16 Dec 1992 21:21:22 GMT

Does anyone know if there are ANONYMOUS FTP sites which archive windows
program exe's and source?

Thanx
-- 
Dave Garrison         # dgarr@telxon.com
Telxon Corporation    #
3330 West Market St   #
Akron, Ohio, 44313    #
From: equine@eng.umd.edu (Melinda L. Gierisch)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Borland C++ 3.1 vs Visual Basic 2.0
Date: 20 Dec 92 17:17:41 GMT
Distribution: comp.windows.microsoft.programmer
Organization: University of Maryland, College Park



For the last 8 months my group has been developing a Windows
application using the BC++ 3.1 Object Windows Library.  This
program accesses Paradox tables using the Paradox Engine.  Someone in
the group suggested using Visual Basic for much of the user interface
because he believes it is more flexible and easier to use than OWL.
No one else in the group has any experience with Visual Basic.  My
questions are:

1)  What is the "ramp up time" or learning curve for creating windows,
dialogs, etc. with Visual Basic?  We needed about 3 months to get
fully comfortable with OWL.

2)  How easy / difficult would it be to combine Visual Basic windows
and dialogs with BC++ functions for database access (these have
already been written and are not OWL dependent)?

If anyone out there has experience programming in both Visual Basic
and C++ I would appreciate any help.

Thanks in advance,
Melinda Gierisch
Newsgroups: comp.windows.ms.programmer,comp.os.ms-windows.programmer.misc
From: d88-jwa@dront.nada.kth.se (Jon Waette)
Subject: Re: How to distinguish between Click and Double-Click?
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 16 Dec 1992 19:48:09 GMT

In <1992Dec4.162103.7837@news.tu-graz.ac.at> mwelser@iaik.wu-wien.ac.at (Michael Welser) writes:

>The "cheat" of starting action A in both cases and then resort to action B
>if it turns out that there is a doubleclick does not seem to be acceptable,
>as it would lead to (at least) some popping up and disappearing of a
>dialog box.

I know this is an old article, but the user interface
of doing this would be horrendous!

Double-clicking is ALWAYS an extension of single-clicking;
this is not only for programmatical reasons but for users
well-being too. If you want to distinguish between different
kinds of clicks, use the right & left button, or use the
shift/alt/control keys creatively :-)

Cheers,

							/ h+

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

   There's no sex act that can't be made better with Yell-O.
Newsgroups: comp.os.ms-windows.programmer.misc
From: dwightm@microsoft.com (Dwight Matheny)
Subject: Re: SDK 3.1 Cost? Source?
Date: 11 Dec 92 21:15:54 GMT
Organization: Microsoft Corp.
Distribution: usa

The 3.1 SDK has a SRP of  $349, or is also included w/ MS C/C++ 7.0
for a SRP of $499. Both are available retail. The SDK is harder to
find at dealers and can be ordered direct from MS by calling MS
Developer Services at 800-227-4679 x 11771.

-Dwight (MS)
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: ListBox problem
Keywords: windows, programming
Date: 17 Dec 92 00:27:34 GMT
Organization: PE-Nelson

In article <pjsmith.724533171@pv1414.vincent.iastate.edu>, pjsmith@iastate.edu (Phil J Smith) writes:
|> I am attempting to load a directory listing into a listbox with DlgDirList.
|> This works fine except that the listbox does not display it until I click in
|> it.  I have tried using "SendDlgMsg(id,LBN_SETFOCUS,0,0)" but nothing happens.
|> I am using Turbo C++ for Windows v3.1 and OWL.  Any ideas?

Well, I don't use OWL at all, but at the SDK level it sounds like you may
have forgotten to turn back on redraw:

	SendDlgItemMessage(hdlg, id, WM_SETREDRAW, 1, 0);
	InvalidateRect(GetDlgItem(hdlg, id), NULL, TRUE);
	UpdateWindow(GetDlgItem(hdlg, id));   // not really necessary

Try simply appending these lines after you load the listbox and see what
happens.  This may work, but it potentially addresses only a symptom and not
the problem.

You might want to include the appropriate code fragment in a followup if it
still doesn't work, this would give us more to go on.



----------------------------------------------------------------------------
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: scstech@solomon.technet.sg (Kenneth Soh)
Subject: Resource Help
Organization: Singapore Computer Systems Ltd
Date: Thu, 17 Dec 1992 17:35:53 GMT

Hi !

This is my first attempt to use a resource from a windows program.
I've created a dialog window using the Microsoft Windows' Dialog
Editor and I intend to use it in my program as a modeless dialog.

I am using the Microsoft MFC classes and I have inherited from
the CDialog a customised class of my own. The constructor of this
class then does a call to Create( <resource-dialog-name>, <parent
window> ). I then call SendMessage(WM_INITDIALOG) to force my
OnInitDiag() to execute.

I cannot manage to get the dialog window out and hence upon tracing
I realise that my Create() actually returns zero. The resource
cannot be loaded. Can someone advise ??

Many thanks.

Kenneth Soh
Singapore
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)