荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Program
标  题: [转载]  MSVC Digest - 4 Jan 1999 to 5 Jan 1999 (#1999-5)
发信站: BBS 荔园晨风站 (Wed Jan  6 17:21:45 1999), 站内信件

【 以下文字转载自 tang 的信箱 】
【 原文由 Automatic 所发表 】
There are 10 messages totalling 806 lines in this issue.

Topics of the day:

  1. How Can I make an NT SERVICES using ATL COM WIZARD (2)
  2. Link Err
  3. Multiple CSplitterWnd's?
  4. exporting STLs in Extended DLL
  5. Structured Storage Maximum Size
  6. unresolved external symbol _main (2)
  7. Low Overhead DBF access
  8. (none)

--------------------------------------------------------------------------
The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

----------------------------------------------------------------------

Date:    Tue, 5 Jan 1999 08:16:00 +0100
From:    Benjamin Levstek <benjamin.levstek@ADACTA.SI>
Subject: Re: How Can I make an NT SERVICES using ATL COM WIZARD

This is a multi-part message in MIME format.

------=_NextPart_000_0011_01BE3883.A12F5EA0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Dan,
i wonder if you know any site that contains free c++ code for MS-DOS.
Thanx
    -----Original Message-----
    From: Dan Lofquist <danne@POLYMORPH.SE>
    To: MSVC@PEACH.EASE.LSOFT.COM <MSVC@PEACH.EASE.LSOFT.COM>
    Date: Tuesday, January 05, 1999 3:06 AM
    Subject: Re: How Can I make an NT SERVICES using ATL COM WIZARD
   =20
   =20
    Hi there,
   =20
    If you are going to create a NT-Service with an COM interface then =
the COM-Wizard
    is the one to use. But if you are going to create a NT -Service that =
does not contain
    a COM interface it's better to either implement the functions =
yourself or get a NT-Service
    class template from http://www.codeguru.com.
    =20
    So if you going to implement COM use the ATL Wizard and implement =
your code in the
    Interfaces your create. You can also add some init code before the =
call is made to
    CServiceModule::Run().
    =20
    BTW a NT Service can not have any interactions with the user what so =
ever it's just
    a silent program that are running in the background that does stuff =
! One common
    way to use NT Services is to have them control communications of =
some form. I've
    done some that handles communications between PC and Mainstream for =
example.
    One smart thing about services is that you can start and stop them =
from another=20
    computer through the NET commands.
    =20
    Hope this brings some light :-)
    =20
    Regards Dan
   =20
   =20
        -----Original Message-----
        From: Microsoft Visual C++ programmers list =
[mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of iban
        Sent: Tuesday, January 05, 1999 1:53 AM
        To: MSVC@PEACH.EASE.LSOFT.COM
        Subject: =BB=D8=B8=B4: How Can I make an NT SERVICES using AT L =
COM WI
       =20
       =20
            Thanks Dan.
            I wasn't very clear how to insert my own codes in the =
program,
            As you know ,in classs CServiceModule::Run() method there =
are some lines as following:
            MSG msg;
            whild(GetMessage(&msg,0,0,0)) DispatchMessage(....)
            I don't know how to process message here and how to do my =
own work
            in this Run() method?
            It's easy, just check the 'Service (EXE)' and you got =
yourself a
            NT Service.
           =20
            Regards Dan
                -----Original Message-----
                From: Microsoft Visual C++ programmers list
            [mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of iban
                Sent: Monday, January 04, 1999 7:19 PM
                To: MSVC@PEACH.EASE.LSOFT.COM
                Subject: How Can I make an NT SERVICES using ATL COM =
WIZARD
           =20
           =20
                How Can I make an NT SERVICES using ATL COM WIZARD?
           =20
           =20
           =20


------=_NextPart_000_0011_01BE3883.A12F5EA0
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN">
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hi Dan,</FONT></DIV>
<DIV><FONT size=3D2>i wonder if you know any site that contains free c++ =
code for=20
MS-DOS.</FONT></DIV>
<DIV><FONT size=3D2>Thanx</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV><FONT face=3DArial size=3D2><B>-----Original =
Message-----</B><BR><B>From:=20
    </B>Dan Lofquist &lt;<A=20
    =
href=3D"mailto:danne@POLYMORPH.SE">danne@POLYMORPH.SE</A>&gt;<BR><B>To: =
</B><A=20
    =
href=3D"mailto:MSVC@PEACH.EASE.LSOFT.COM">MSVC@PEACH.EASE.LSOFT.COM</A> =
&lt;<A=20
    =
href=3D"mailto:MSVC@PEACH.EASE.LSOFT.COM">MSVC@PEACH.EASE.LSOFT.COM</A>&g=
t;<BR><B>Date:=20
    </B>Tuesday, January 05, 1999 3:06 AM<BR><B>Subject: </B>Re: How Can =
I make=20
    an NT SERVICES using ATL COM WIZARD<BR><BR></DIV></FONT>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>Hi there,</FONT></SPAN></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2>If you are going to create a NT-Service with an COM =
interface then=20
    the COM-Wizard</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>is the one to use. But if you are going to =
create a NT=20
    -Service that does not contain</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>a COM interface it's better to either =
implement the=20
    functions yourself or get a NT-Service</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>class template from <A=20
    =
href=3D"http://www.codeguru.com">http://www.codeguru.com</A>.</FONT></SPA=
N></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2>So if you going to implement COM use the ATL Wizard and =
implement=20
    your code in the</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>Interfaces your create. You can also add =
some init code=20
    before the call is made to</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2>CServiceModule::Run().</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2>BTW a NT Service can not have any interactions with the =
user what so=20
    ever it's just</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>a silent program that are running in the =
background that=20
    does stuff ! One common</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>way to use NT Services is to have them =
control=20
    communications of some form. I've</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>done some that handles communications =
between PC and=20
    Mainstream for example.</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>One smart thing about services is that you =
can start and=20
    stop them from another </FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN><SPAN class=3D203154601-05011999><FONT =
color=3D#0000ff=20
    face=3DVerdana size=3D2>computer through the NET =
commands.</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2>Hope this brings some light :-)</FONT></SPAN></DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=3D203154601-05011999><FONT color=3D#0000ff =
face=3DVerdana=20
    size=3D2>Regards Dan</FONT></SPAN></DIV>
    <DIV>&nbsp;</DIV>
    <DIV>&nbsp;</DIV>
    <BLOCKQUOTE=20
    style=3D"BORDER-LEFT: #0000ff solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">
        <DIV class=3DOutlookMessageHeader><FONT face=3D"Times New Roman" =

        size=3D2>-----Original Message-----<BR><B>From:</B> Microsoft =
Visual C++=20
        programmers list [mailto:MSVC@PEACH.EASE.LSOFT.COM]<B>On Behalf =
Of</B>=20
        iban<BR><B>Sent:</B> Tuesday, January 05, 1999 1:53 =
AM<BR><B>To:</B> <A=20
        =
href=3D"mailto:MSVC@PEACH.EASE.LSOFT.COM">MSVC@PEACH.EASE.LSOFT.COM</A><B=
R><B>Subject:</B>=20
        &raquo;&Oslash;&cedil;&acute;: How Can I make an NT SERVICES =
using AT L=20
        COM WI<BR><BR></FONT></DIV>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">Thanks=20
            Dan.</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">I=20
            wasn't very clear how to insert my own codes in the=20
program,</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">As=20
            you know ,in classs CServiceModule::Run() method there are =
some=20
            lines as following:</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">MSG=20
            msg;</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">whild(GetMessage(&amp;msg,0,0,0))=20
            DispatchMessage(....)</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">I=20
            don't know how to process message here and how to do my own=20
        work</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">in=20
            this Run() method?</BLOCKQUOTE>
        <BLOCKQUOTE=20
        style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; =
PADDING-LEFT: 5px">It's=20
            easy, just check the 'Service (EXE)' and you got yourself =
a<BR>NT=20
            Service.<BR><BR>Regards Dan<BR>&nbsp;&nbsp;&nbsp; =
-----Original=20
            Message-----<BR>&nbsp;&nbsp;&nbsp; From: Microsoft Visual =
C++=20
            programmers list<BR>[<A=20
            =
href=3D"mailto:MSVC@PEACH.EASE.LSOFT.COM">mailto:MSVC@PEACH.EASE.LSOFT.CO=
M</A>]On=20
            Behalf Of iban<BR>&nbsp;&nbsp;&nbsp; Sent: Monday, January =
04, 1999=20
            7:19 PM<BR>&nbsp;&nbsp;&nbsp; To: <A=20
            =
href=3D"mailto:MSVC@PEACH.EASE.LSOFT.COM">MSVC@PEACH.EASE.LSOFT.COM</A><B=
R>&nbsp;&nbsp;&nbsp;=20
            Subject: How Can I make an NT SERVICES using ATL COM=20
            WIZARD<BR><BR><BR>&nbsp;&nbsp;&nbsp; How Can I make an NT =
SERVICES=20
            using ATL COM=20
WIZARD?<BR><BR><BR><BR></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HT=
ML>

------=_NextPart_000_0011_01BE3883.A12F5EA0--

------------------------------

Date:    Tue, 5 Jan 1999 09:32:38 -0000
From:    Cliff Rowley <CRowley@COMTEST.CO.UK>
Subject: Re: How Can I make an NT SERVICES using ATL COM WIZARD

ftp://x2ftp.oulu.fi/msdos/programming/

-----Original Message-----
From: Microsoft Visual C++ programmers list
[mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of Benjamin Levstek
Sent: 05 January 1999 07:16
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: Re: How Can I make an NT SERVICES using ATL COM WIZARD


Hi Dan,
i wonder if you know any site that contains free c++ code for MS-DOS.
Thanx

-----Original Message-----
From: Dan Lofquist < danne@POLYMORPH.SE>
To: MSVC@PEACH.EASE.LSOFT.COM < MSVC@PEACH.EASE.LSOFT.COM>
Date: Tuesday, January 05, 1999 3:06 AM
Subject: Re: How Can I make an NT SERVICES using ATL COM WIZARD


Hi there,
=A0
If you are going to create a NT-Service with an COM interface then the
COM-Wizard
is the one to use. But if you are going to create a NT -Service that
does not contain
a COM interface it's better to either implement the functions yourself
or get a NT-Service
class template from http://www.codeguru.com.
=A0
So if you going to implement COM use the ATL Wizard and implement your
code in the
Interfaces your create. You can also add some init code before the call
is made to
CServiceModule::Run().
=A0
BTW a NT Service can not have any interactions with the user what so
ever it's just
a silent program that are running in the background that does stuff !
One common
way to use NT Services is to have them control communications of some
form. I've
done some that handles communications between PC and Mainstream for
example.
One smart thing about services is that you can start and stop them from
another=20
computer through the NET commands.
=A0
Hope this brings some light :-)
=A0
Regards Dan
=A0
=A0

-----Original Message-----
From: Microsoft Visual C++ programmers list
[mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of iban
Sent: Tuesday, January 05, 1999 1:53 AM
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: =BB=D8=B8=B4: How Can I make an NT SERVICES using AT L COM WI



Thanks Dan.

I wasn't very clear how to insert my own codes in the program,

As you know ,in classs CServiceModule::Run() method there are some =
lines
as following:

MSG msg;

whild(GetMessage(&msg,0,0,0)) DispatchMessage(....)

I don't know how to process message here and how to do my own work

in this Run() method?

It's easy, just check the 'Service (EXE)' and you got yourself a
NT Service.

Regards Dan
=A0=A0=A0 -----Original Message-----
=A0=A0=A0 From: Microsoft Visual C++ programmers list
[ mailto:MSVC@PEACH.EASE.LSOFT.COM]On Behalf Of iban
=A0=A0=A0 Sent: Monday, January 04, 1999 7:19 PM
=A0=A0=A0 To: MSVC@PEACH.EASE.LSOFT.COM
=A0=A0=A0 Subject: How Can I make an NT SERVICES using ATL COM WIZARD


=A0=A0=A0 How Can I make an NT SERVICES using ATL COM WIZARD?

------------------------------

Date:    Tue, 5 Jan 1999 19:45:25 +0800
From:    Rick Zhang <otv_zhang@163.NET>
Subject: Link Err

Hi :
    I'm the beginner of C++. First I copy the code from the book to VC. The
compile is ok, but the linker give
the err bellow:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/cw.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I wonder if somebody would kindly tell me why!

Thanks in advance.

------------------------------

Date:    Tue, 5 Jan 1999 08:40:52 -0500
From:    Terry Griffin <terryg@DATACUBE.COM>
Subject: Re: Multiple CSplitterWnd's?

Hi Cliff,
   You can have multiple splitter windows by making on splitter the =
child of another. For example, using your diagram below, you would =
create a splitter with the main frame as the parent. This splitter would =
have two panes; the status pane and another splitter. The second =
splitter, created with the first splitter as the parent, would have also =
have two panes; the directory tree and the remote sitemap.=20
   To create the splitter windows you use CreateStatic, giving the =
parent window and the number of rows and columns. To create the panes =
based on CView derived windows you use CSplitterWnd::CreateView.=20
   To create the second splitter as a child of the first splitter the =
only trick is that you need to use the correct ID. MFC uses the ID to =
determine which window goes with which pane. To get the ID that you need =
to use when creating the child splitter you use =
CSplitterWnd::IdFromRowCol.

----------------------
Terry Griffin
terryg@datacube.com

Web Systems Group
Datacube, Inc.
300 Rosewood Drive
Danvers, MA 01923
(978) 777-4200



-----Original Message-----
From:   Cliff Rowley [SMTP:crowley@NOSPLASH.FORCE9.CO.UK]
Sent:   Monday, January 04, 1999 4:13 PM
To:     MSVC@PEACH.EASE.LSOFT.COM
Subject:        Multiple CSplitterWnd's?

Operating System - Windows98
Development System - MSVC++ 6 w/ SP1

*NOTE:  Please view in a fixed-width font*

I am writing a web spider for my Wife geared specifically towards =
children
and nursery education, and for this I would like the main window to have =
a
layout similar to this:

*******************************
*     *                       *
*     *                       *
*     *                       *
*     *                       *
*     *                       *
*     *                       *
*     *                       *
*******************************
*                             *
*******************************

The bottom window is the status window, the left hand pane is the local
directory tree, and the right hand pane is the remote sitemap.

Is it possible to embed 2 splitter windows in the main frame to achieve
this?  Or will I have to create a splitter window in the upper view?  If =
so,
where do I get the CCreateContext from?  There is no OnCreateClient in a
view or generic CWnd class.

Your help is much appreciated.

Cliff Rowley

-------------------------------------------------------------------------=
-
The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software.  For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

------------------------------

Date:    Tue, 5 Jan 1999 08:33:39 -0600
From:    "Mark A. Glass" <mark.glass@PHILIPS.COM>
Subject: exporting STLs in Extended DLL

Can someone tell me if it is possible to export STLs other than vector =
from an extended DLL in MSVC V6. Microsoft
states in Article ID: Q168958 "HowTO: Exporting STL components Inside &=
 Outside of a Class" that it is not possible to export any class
template except vector because all the other templates contain nested c=
lasses. The HOWTO was written for version 5.

Thanks,
Mark Glass
Sr. Software Customization  Engineer
Philips Analytical
Mahwah, NJ

Mark.Glass@Philips.com
=

------------------------------

Date:    Tue, 5 Jan 1999 09:49:13 -0500
From:    Terry Griffin <terryg@DATACUBE.COM>
Subject: Structured Storage Maximum Size

Hi All,
   I have a problem writing a large amount of data to a stream in a =
Compound file. I wrote a small test program that shows that same =
behavior. After writing about 930 Meg to the file the call to Write =
hangs.   There is still about 1.5 GB of free disk space when the app =
hangs. The documentation indicates that the maximum size should be 4 GB. =
Does anyone know if the real maximum is only about 1 GB or is there some =
other problem. Any help is appreciated.

Here is the code I used to test.=20

#include <iostream.h>
#include <windows.h>

int main()
{
   IStorage *pStorage =3D 0;
   int iData[1024] =3D {0};
   IStream *pStream1 =3D 0;
   IStream *pStream2 =3D 0;
   HRESULT hr;
   ULONG dc;
   int i,j;

   hr =3D ::StgCreateDocfile(L"F:\\Temp\\BigFile",
        STGM_READWRITE|STGM_DIRECT|STGM_SHARE_EXCLUSIVE|STGM_CREATE,
                                0, &pStorage);
   if (FAILED(hr)) {
      cout << "StgCreateDocfile failed";
      return -1;
   }
   hr =3D =
pStorage->CreateStream(L"Stream1",STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STG=
M_CREATE,
      0,0,&pStream1);
   if (FAILED(hr)) {
      cout << "CreateStream Stream1 failed " << hr;
      return -1;
   }
   hr =3D =
pStorage->CreateStream(L"Stream2",STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STG=
M_CREATE,
      0,0,&pStream2);
   if (FAILED(hr)) {
      cout << "CreateStream Stream2 failed " << hr;
      return -1;
   }
   for (i=3D0;i<2048;++i) {
      for (j=3D0;j<256;++j) {
        // Hangs here
         pStream1->Write(iData,sizeof(int)*1024,&dc);
         pStream2->Write(iData,sizeof(int)*1024,&dc);
      }
      cout << "i =3D " << i << endl;
   }
   return 0;
}




----------------------
Terry Griffin
terryg@datacube.com

Web Systems Group
Datacube, Inc.
300 Rosewood Drive
Danvers, MA 01923
(978) 777-4200

=00=00

------------------------------

Date:    Wed, 6 Jan 1999 07:30:24 +0800
From:    Rick Zhang <zhang_rick@HOTMAIL.COM>
Subject: unresolved external symbol _main

Hi Friends:
        I just begin to use C++. Can Somebody tell why?
Code:
#include <windows.h>

LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,
                                                 LPARAM lParam)
{
        return DefWindowProc(hwnd,message,wParam,lParam);
}
char szAppName[] = "Window";

int PASCAL WinMain( HANDLE hInstance, HANDLE hPreInstance,
                                   LPSTR lpszCmdLine, int nCmdShow)
{
        HWND hwnd;
        MSG msg;
        WNDCLASS wndclass;
        if (!hPreInstance)
        {
                wndclass.style = CS_HREDRAW | CS_VREDRAW;
                wndclass.lpfnWndProc = WndProc;
                wndclass.cbClsExtra = 0;
                wndclass.cbWndExtra = 0;
                wndclass.hInstance = hInstance;
                wndclass.hIcon = LoadIcon(NULL,IDI_APPLICATION);
                wndclass.hCursor = LoadIcon(NULL,IDC_ARROW);
                wndclass.hbrBackground = GetStockObject(WHITE_BRUSH);
                wndclass.lpszMenuName = NULL;
                wndclass.lpszClassName = szAppName;
                if (!RegisterClass(&wndclass))
                        return FALSE;
                hwnd = CreateWindow(szAppName,"Sample Program",
                        WS_OVERLAPPEDWINDOW,
                        CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
                        NULL,NULL,hInstance,NULL);
                ShowWindow(hwnd,SW_SHOWNORMAL);
                UpdateWindow(hwnd);
                while (GetMessage(&msg,NULL,0,0))
                {
                        TranslateMessage(&msg);
                        DispatchMessage(&msg);
                }

        }
        return msg.wParam;
}

Err:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/cw.exe : fatal error LNK1120: 1 unresolved externals

        I first compile it, MSVC reported no err. Then I tried to link it, but
got the 2 err.

Thanks in advance.

------------------------------

Date:    Tue, 5 Jan 1999 19:23:17 -0600
From:    "Nathan T. Wild" <nwild@BIGFOOT.COM>
Subject: Low Overhead DBF access

I want to write a DLL in C/C++ which needs to access some dBase III tables.

My admittedly limited exposure to MFC has lead me to believe that for my
simple requirements, the DAO, etc. is overkill in a big way.

Is there a simple C API for Jet database access?  If not, how can I go about
making a minimalist MFC DLL (yes...  size still counts!)...

Thanks in advance for any help you can offer...

------------------------------

Date:    Tue, 5 Jan 1999 20:38:00 -0500
From:    Kyle Berry <kberry@CUSTOMNET.NET>
Subject: Re: unresolved external symbol _main

You see this code won't work unless you compile in win32 app.But even then the
code doesn't work.
So I worked on it myself and it doesn't do anything. Sorry.

Rick Zhang wrote:

> Hi Friends:
>         I just begin to use C++. Can Somebody tell why?
> Code:
> #include <windows.h>
>
> LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,
>                                                  LPARAM lParam)
> {
>         return DefWindowProc(hwnd,message,wParam,lParam);
> }
> char szAppName[] = "Window";
>
> int PASCAL WinMain( HANDLE hInstance, HANDLE hPreInstance,
>                                    LPSTR lpszCmdLine, int nCmdShow)
> {
>         HWND hwnd;
>         MSG msg;
>         WNDCLASS wndclass;
>         if (!hPreInstance)
>         {
>                 wndclass.style = CS_HREDRAW | CS_VREDRAW;
>                 wndclass.lpfnWndProc = WndProc;
>                 wndclass.cbClsExtra = 0;
>                 wndclass.cbWndExtra = 0;
>                 wndclass.hInstance = hInstance;
>                 wndclass.hIcon = LoadIcon(NULL,IDI_APPLICATION);
>                 wndclass.hCursor = LoadIcon(NULL,IDC_ARROW);
>                 wndclass.hbrBackground = GetStockObject(WHITE_BRUSH);
>                 wndclass.lpszMenuName = NULL;
>                 wndclass.lpszClassName = szAppName;
>                 if (!RegisterClass(&wndclass))
>                         return FALSE;
>                 hwnd = CreateWindow(szAppName,"Sample Program",
>                         WS_OVERLAPPEDWINDOW,
>                         CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
CW_USEDEFAULT,
>                         NULL,NULL,hInstance,NULL);
>                 ShowWindow(hwnd,SW_SHOWNORMAL);
>                 UpdateWindow(hwnd);
>                 while (GetMessage(&msg,NULL,0,0))
>                 {
>                         TranslateMessage(&msg);
>                         DispatchMessage(&msg);
>                 }
>
>         }
>         return msg.wParam;
> }
>
> Err:
> LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
> Debug/cw.exe : fatal error LNK1120: 1 unresolved externals
>
>         I first compile it, MSVC reported no err. Then I tried to link it,
but got the 2 err.
>
> Thanks in advance.
>
> --------------------------------------------------------------------------
> The MSVC list is hosted on a Windows NT(TM) machine running L-Soft
> international's LISTSERV(R) software.  For subscription/signoff info
> and archives, see http://peach.ease.lsoft.com/archives/msvc.html .

------------------------------

Date:    Tue, 5 Jan 1999 20:50:17 -0500
From:    Kyle Berry <kberry@CUSTOMNET.NET>
Subject: (none)

Hey crew,
What's your guys newgroup? Or your website to everyone's question's and
answers because I really like your service?

------------------------------

End of MSVC Digest - 4 Jan 1999 to 5 Jan 1999 (#1999-5)
*******************************************************
--
※ 转载:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店