荔园在线

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

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


发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Program
标  题: [转载]  MSVC Digest - 10 Jan 1999 to 11 Jan 1999 (#1999-11)
发信站: BBS 荔园晨风站 (Tue Jan 12 17:46:07 1999), 站内信件

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

Topics of the day:

  1. Precompiled headers for both C and C++
  2. Microsoft Management Console
  3. CString += operator not working? (4)
  4. Cool window?
  5. CString += operator?  DOH!
  6. Localization (4)
  7. Multi-select Combo Box (2)
  8. All ComputerNames in NetWork (2)
  9. win api to fade audio
 10. SetViewportExtEx
 11. How to change the NT file's SHARED

--------------------------------------------------------------------------
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:    Mon, 11 Jan 1999 00:06:14 +0100
From:    Mats M錸hav <mats@MOONSEA.COM>
Subject: Precompiled headers for both C and C++

Environment: MSVC 6.0 (sp1) Win NT 4.0 (sp4)
Hello,

I have a project with a lot of C files and a lot of C++ files.

I have not found a way to have precompiled headers for both of the
file types in the same project.
Does anyone know how to do this, if it is possible ?

Best regards,
Mats
mailto:mats@moonsea.com

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

Date:    Mon, 11 Jan 1999 07:58:12 +0100
From:    Frantisek Tripsky <frantisek.tripsky@TELECOM.CZ>
Subject: Microsoft Management Console

Dears,

Does anyone know where i could find an example of an application that =
used Icomponent interface that allows the Microsoft Management Console =
to communicate with any snap-in component .
Can anyone send me an example.

Thanks
    Fero Tripsky

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

Date:    Mon, 11 Jan 1999 08:37:18 +0100
From:    =?iso-8859-1?Q?Anders_W=E5hlin?= <wahlin@ERV.ERICSSON.SE>
Subject: Re: CString += operator not working?

I have also had problems when appending a CString object to another =
CString.
This works however:

CString csString, csDestination;

csDestination =3D "Hello";
csString=3D " World!";

csDestination =3D csString; // FAILS!?
csDestination =3D (LPCTSTR)csString; // WORKS!!

I don't know why.

/Amders W

> -----Original Message-----
> From: Cliff Rowley [SMTP:crowley@NOSPLASH.FORCE9.CO.UK]
> Sent: Sunday, January 10, 1999 11:49 PM
> To:   MSVC@PEACH.EASE.LSOFT.COM
> Subject:      CString +=3D operator not working?
> Importance:   High
>=20
> OS:=A0=A0=A0=A0 Windows NT4/SP4
> ENV:=A0=A0=A0 MSVC++ 6/SP1
>=20
> For some reason, of which I cannot fathom, the CString +=3D operator =
appears
> to be failing.=A0 Whether this is my own fault or not, I have yet to
> ascertain.
>=20
> I have included snippets from my code below, showing the declarations =
of
> the variables, and their usage.
>=20
> The first time through the loop, tagbuff is correctly set to the =
contents
> of buff.=A0 But, the next (and subsequent) times through the loop, =
tagbuff
> remains the same, where it should in theory contain the previous =
contents
> of itself with the addition of the contents of buff.
>=20
> At first I thought I had reached a limit of CString, and then thought =
that
> would be ridiculous as the string is a usual max of about 4000
> characters.=A0 The MSDN documentation states that the maximum for a =
CString
> is 2,147,483,647 characters (INT_MAX) - so I am well off the mark =
there.
>=20
> I also tried various methods to assign tagbuff.=A0 e.g.
>=20
> tagbuff =3D tagbuff + buff;
>=20
> CString tmp =3D buff;
> tagbuff =3D tagbuff + buff;
>=20
> CString tmp;
> tmp.Format("%s", buff);
> tagbuff +=3D tmp;
>=20
> and various other ways.
>=20
> I am in dire need here as my project must be finished within the next
> week, as our company has a show in the US.
>=20
> <SNIP>
> =A0=A0=A0=A0=A0=A0=A0 TCHAR buff[CB_READ_BLOCK];
> =A0=A0=A0=A0=A0=A0=A0 CString tagbuff;
> <SNIP>
> while (SUCCEEDED(pStream->Read(buff, CB_READ_BLOCK, &cbRead)) && =
cbRead >
> 0)
> {
> =A0=A0=A0=A0=A0=A0=A0 // if the actual read was less than the read =
block
> =A0=A0=A0=A0=A0=A0=A0 // we must add a null terminator to prevent =
garbage
> =A0=A0=A0=A0=A0=A0=A0 // at the end of the string
> =A0=A0=A0=A0=A0=A0=A0 if (cbRead < CB_READ_BLOCK)
> =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0 buff[cbRead] =3D '\0';
>=20
> =A0=A0=A0=A0=A0=A0=A0 // add the buffer to the tag buffer
>=20
> >>>>>=A0=A0 tagbuff +=3D buff; // THIS IS FAILING!!!=A0 tagbuff is =
unchanged <<<<<
>=20
> <SNIP>
>=20
> Many thanks,
>=20
> Cliff Rowley.=20
>=20

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

Date:    Mon, 11 Jan 1999 09:36:30 +0100
From:    =?iso-8859-1?Q?Anders_W=E5hlin?= <wahlin@ERV.ERICSSON.SE>
Subject: Re: CString += operator not working?

I have also had problems when appending a CString object to another CString.
This works however:

CString csString, csDestination;

csDestination = "Hello";
csString= " World!";

csDestination = csString; // FAILS!?
csDestination = (LPCTSTR)csString; // WORKS!!

I don't know why.

/Anders W

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

Date:    Mon, 11 Jan 1999 17:47:17 +0000
From:    Mike Zang <mike.zang@REUTERS.COM>
Subject: Re: CString += operator not working?

>csDestination = csString; // FAILS!?
It is Ok, compile no problem!

Mike

------------------------------------------------------------------------
Any views expressed in this message are those of the individual  sender,
except  where  the  sender  specifically  states them to be the views of
Reuters Ltd.

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

Date:    Mon, 11 Jan 1999 09:33:04 -0000
From:    Paul Vincent <PV@ACCESS-ACCOUNTS.COM>
Subject: Re: Cool window?

Hi,

You can set a window to stay on top by using:

SetWindowPos(
        hwnd,
        HWND_TOPMOST,
        x,y, width, height, redraw);

Hope this helps,

Paul
-----Original Message-----
From: Chjan Bao [mailto:root@DLIFE.FREENET.BISHKEK.SU]
Sent: 09 January 1999 22:20
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: Cool window?


Hi,
how I can make window, that lie over all other windows (Explorer, MS Office)
and has no title bar?

Thanks

--------------------------------------------------------------------------
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:    Mon, 11 Jan 1999 10:00:19 -0000
From:    Cliff Rowley <CRowley@COMTEST.CO.UK>
Subject: Re: CString += operator not working?

> After the read, what is the value of cbRead?  It looks like it could
be 0.

cbRead is the correct value (256, as I am doing a 256 byte read), and I
have traced through the CString source, and it fails on the 2nd memset
within ConcatCopy.

> I would suggest stepping into the CString method
> that appends and see what it is doing.

I did, here's what I found...

void CString::ConcatCopy(int nSrc1Len, LPCTSTR lpszSrc1Data,
        int nSrc2Len, LPCTSTR lpszSrc2Data)
{
  // -- master concatenation routine
  // Concatenate two sources
  // -- assume that 'this' is a new CString object

        int nNewLen = nSrc1Len + nSrc2Len;
        if (nNewLen != 0)
        {
                AllocBuffer(nNewLen);
                memcpy(m_pchData, lpszSrc1Data, nSrc1Len*sizeof(TCHAR));
                memcpy(m_pchData+nSrc1Len, lpszSrc2Data,
nSrc2Len*sizeof(TCHAR)); <--- Fails, or appears to do nothing
        }
}

This function is called by operator+=

I have no idea what's going on :(

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

Date:    Mon, 11 Jan 1999 11:33:17 -0000
From:    Cliff Rowley <CRowley@COMTEST.CO.UK>
Subject: CString += operator?  DOH!

Well slap me silly and call me susan.=A0 It's (not entirely) my =
fault.=A0
While I was watching the internals of the function in question throught
the debugger, when the value I was watching did not grow, or change
color when it should have, I instantly assumed it wasnt working.=A0 The
fact is that it was working, and it's in fact a limitation of the watch
window.
=A0
Apparently it has a limit to the amount of text each "box" can contain
(no idea what that limit is), and also, if it overflows this limit, =
it's
color will not change when the data is modified.=A0 Perhaps the non =
color
change is a bug.
=A0
Apologies if I wasted anyone's time :\

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

Date:    Mon, 11 Jan 1999 08:56:17 -0500
From:    Timothy Dixon <tdixon@PHDINC.COM>
Subject: Localization

Hi all!

I have been given the exciting task of examining all our legacy code (much
of which hasn't changed since our DOS days) and determining what is needed
to support localization.  I haven't a clue what's involved in localization,
but since our European and Mexican markets are growing faster than our
domestic markets, I agree that it makes sense (which is not always the case
when a VP decides what the software will do next :->).

Can you fine folks recommend online resources or books which will help lay
the topic out for me?  I'll read through the information in MSDN, of
course, so don't bother suggesting that. :-)

Thanks a bundle!


Tim Dixon, Software Engineer
PHD, Inc.  http://www.phdinc.com

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

Date:    Mon, 11 Jan 1999 16:01:14 +0100
From:    Mats M錸hav <mats@MOONSEA.COM>
Subject: Re: Localization

Hi Timothy,

  There is an excellent tool called RC-WinTrans for localizing .rc
  files. I have been using it for about a year and a half now and I am
  very satisfied with it.
  I allows me to work with one resource file only. All the
  translations are handled by RC-WinTrans. When I want something
  translated I export the strings to an Excel file, and send it off to
  the translator. When it comes back I import it, and RC-WinTrans
  builds a localized .rc file that I can compile into my project.

  You can find at http://members.aol.com/ibsdevelop/rct/rctsite.htm

Best regards,
Mats  mailto:mats@moonsea.com

m=E5ndag, den 11 januari 1999, Timothy wrote:
TD> Hi all!

TD> I have been given the exciting task of examining all our legacy code =
(much
TD> of which hasn't changed since our DOS days) and determining what is n=
eeded
TD> to support localization.  I haven't a clue what's involved in localiz=
ation,
TD> but since our European and Mexican markets are growing faster than ou=
r
TD> domestic markets, I agree that it makes sense (which is not always th=
e case
TD> when a VP decides what the software will do next :->).

TD> Can you fine folks recommend online resources or books which will hel=
p lay
TD> the topic out for me?  I'll read through the information in MSDN, of
TD> course, so don't bother suggesting that. :-)

TD> Thanks a bundle!


TD> Tim Dixon, Software Engineer
TD> PHD, Inc.  http://www.phdinc.com

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

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

Date:    Mon, 11 Jan 1999 09:22:55 -0600
From:    Jeff Nygren <Jeff_Nygren@DATACARD.COM>
Subject: Multi-select Combo Box

Does the Win32 API provide some straightforward way to make a Drop List type
of Combo Box with Multiple Selection? Can any of you refer me to some help
with this?

Thanks!

Jeff Nygren
jeff_nygren@datacard.com

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

Date:    Mon, 11 Jan 1999 10:24:59 -0500
From:    Timothy Dixon <tdixon@PHDINC.COM>
Subject: Re: Multi-select Combo Box

I don't know of one.  Use Delphi. <grin>

Seriously, this would be a useful thing for me too.  If anybody does know
of something, please reply to the list rather than offline.  Thanks!

Tim Dixon, Software Engineer
PHD, Inc.  http://www.phdinc.com





Jeff_Nygren@DATACARD.COM on 01/11/99 10:22:55 AM

Please respond to MSVC@PEACH.EASE.LSOFT.COM

To:   MSVC@PEACH.EASE.LSOFT.COM
cc:    (bcc: Tim Dixon/PHD)
Subject:  Multi-select Combo Box




Does the Win32 API provide some straightforward way to make a Drop List
type
of Combo Box with Multiple Selection? Can any of you refer me to some help
with this?
Thanks!
Jeff Nygren
jeff_nygren@datacard.com
--------------------------------------------------------------------------
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:    Mon, 11 Jan 1999 09:26:37 -0600
From:    David Stroupe <dstroupe@HOME.COM>
Subject: Re: Localization

FYI
The web site for RC-WinTrans has changed to:

http://www.schaudin.com/rctsite.htm

David

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

Date:    Mon, 11 Jan 1999 08:27:20 -0800
From:    Shanmuga S <s_shanmuganathan@YAHOO.COM>
Subject: All ComputerNames in NetWork

Dear Gurus,

Is there any function to get the list
of all the computers that are connected
to the network.

Like, we get the list of computernames
in the NetworkNeighborhood of Explorer.

Any information are welcome.

Thanks in advance.

-Shanmuga





_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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

Date:    Mon, 11 Jan 1999 16:20:58 -0000
From:    "Anderson, Alan" <Alan.Anderson@GBR.XEROX.COM>
Subject: Re: Localization

Tim,

I'd suggest you take a look at "Developing International Software for
Windows 95 & NT" by Nadine Kano. When I first started working in this field,
it was of great help.

Also if possible use UNICODE.

Alan Anderson, Software Developer
Globalisation Tools & Processes, Xerox Ltd.

-----Original Message-----
From: Timothy Dixon [mailto:tdixon@PHDINC.COM]
Sent: 11 January 1999 13:56
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: Localization


Hi all!

I have been given the exciting task of examining all our legacy code (much
of which hasn't changed since our DOS days) and determining what is needed
to support localization.  I haven't a clue what's involved in localization,
but since our European and Mexican markets are growing faster than our
domestic markets, I agree that it makes sense (which is not always the case
when a VP decides what the software will do next :->).

Can you fine folks recommend online resources or books which will help lay
the topic out for me?  I'll read through the information in MSDN, of
course, so don't bother suggesting that. :-)

Thanks a bundle!


Tim Dixon, Software Engineer
PHD, Inc.  http://www.phdinc.com

--------------------------------------------------------------------------
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:    Mon, 11 Jan 1999 12:22:27 -0500
From:    "Swirski, Zbyszek" <Zbyszek.Swirski@AEXP.COM>
Subject: Re: All ComputerNames in NetWork

NetServerEnum declared in lmserver.h, defined in netapi32.lib
If you need more details, E-mail me directly, it is a pretty big library
to describe it here
Zbyszek

-----Original Message-----
From: Shanmuga S [mailto:s_shanmuganathan@YAHOO.COM]
Sent: Monday, January 11, 1999 4:27 PM
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: All ComputerNames in NetWork


Dear Gurus,

Is there any function to get the list
of all the computers that are connected
to the network.

Like, we get the list of computernames
in the NetworkNeighborhood of Explorer.

Any information are welcome.

Thanks in advance.

-Shanmuga





_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

------------------------------------------------------------------------
--
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:    Mon, 11 Jan 1999 17:55:25 -0000
From:    Phil Beck <phil@EF-X.COM>
Subject: win api to fade audio

Environment: Visual C++ 6.0 NT 4.0 SP 4

Hi,

I am writing an app that must set up the mixer device to fade volume over a
few seconds.

This is actually the third major version of this software, with the first
being released for DOS about 1993, the second being 16 bit windows in 96 and
now this on Win32. All three version have had to ramp the volume up and down
smoothly without user intervention. The DOS version used "The Developer Kit
For Sound Blaster Series" which was (and I think still is) a full library to
program SB cards from DOS. This contained a function called ctadSetupFade()
which programmed the mixer chip to independantly ramp the volume on its own.
In other words if my DOS program contained the code :-

foo()
{
    ctadSetupFade();
    ctadStartCtrl();   // actually start the volume fading
    while(1 == 1);
}

my program would lock in an infinate loop, but the sound (maybe CD) coming
out of the sound card would continue to fade smoothly. The sound card
proceeding like an independant computer.

The win3.1 version of the software used setvolume() type functions in a
loop. Sometimes it was okay, but other times there would be a message
bottleneck and suddenly all the bunched up setvolume() messages would be
executed very quickly - very messy.

So we know that programming the mixer chip to do a fade on its own over a
certain amount of time is supported by the hardware and we are trying to
find a way of programming it through win32. Does anyone know about this ?

Thanks
Phil.

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

Date:    Mon, 11 Jan 1999 15:23:33 +0800
From:    Rick Zhang <otv_zhang@163.NET>
Subject: SetViewportExtEx

Hi everybody:

I want to know how to get the scope of the viewport. I used the function
"GetViewportExtEx(HWND hWnd, LPSIZE
lpsize)". The function worked fine, but the value it returned is: lpsize->cx =
1, lpsize->cy = 1. It seems not right.
I wonder if there are some mistake in my code:
--------------------------------------------------------------------------------
----
HDC hDC;
LPSIZE pwRet;
..

   if (GetMapMode(hDC) != MM_TEXT) SetMapMode(hDC,MM_TEXT);
   if (GetViewportExtEx(hDC,pwRet))
   {
      xClient = wRet.cx;
      yClient = pwRet->cy;

..

Thanks in advance.

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

Date:    Tue, 12 Jan 1999 10:07:53 +0800
From:    Dong Yonggang <Dewence@WONDERSGROUP.COM>
Subject: How to change the NT file's SHARED

Hi  everybody:
    I am programming for managing this users, groups and files in WinNT,
I used the ADSI (Active Directory Sevice Interface) for managing the
Users and Groups, but I could not find how to manage the files' shared.
Use ADSI? Or use another interface or another ...

  Thanx.
  Dewence

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

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


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

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