荔园在线
荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀
[回到开始]
[上一篇][下一篇]
发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Program
标 题: [转载] MSVC Digest - 11 Jan 1999 to 12 Jan 1999 (#1999-12)
发信站: BBS 荔园晨风站 (Wed Jan 13 17:35:21 1999), 站内信件
【 以下文字转载自 tang 的信箱 】
【 原文由 Automatic 所发表 】
There are 9 messages totalling 394 lines in this issue.
Topics of the day:
1. All ComputerNames in NetWork
2. Ole doubt
3. Trouble with Query result
4. WCHAR
5. CString += operator not working?
6. Query on RUNTIME_CLASS() !!
7. Cyclic thread - How To? (2)
8. SetviewportOrg
--------------------------------------------------------------------------
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, 12 Jan 1999 00:40:24 -0500
From: Srikanth C G <srikanth_cg@TRIGENT.COM>
Subject: Re: All ComputerNames in NetWork
WNet* functions gives you more advanced details.
Srikanth C.G.
At 12:22 PM 1/11/99 -0500, you wrote:
>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
>
>Is there any function to get the list
>of all the computers that are connected
>to the network.
>
------------------------------
Date: Tue, 12 Jan 1999 12:34:46 +0530
From: "Nirmala.R." <nirmala.r@BLR.SNI.DE>
Subject: Ole doubt
Hello all,
I've a doubt in ole automation.
I cld able to create an automation server which can be called thr'
IDispatch as well as using the Typelibrary. I used the default interface
(created by an OLE server) to add the methods and hence created the
dispatch as Interfaceobject.CreateDispatch("Servename.Application")
I want to add a second interface. So, after adding the second interface,
the .odl file looks like this. Now, if i make the foll. calls in the
container, the second call for CreateDispatch
(where i'm using the Classname) returns a null dispatch pointer.
I don't want to include the IID of the second interface (defined int he
server) in the container. Is there any other way to do this???
Its a bit urgent,
So, can u pls. reply me asap,
Best Regards,
Nirmala.
// SevWiz2Int.odl : type library source for SevWiz2Int.exe
// This file will be processed by the MIDL compiler to produce the
// type library (SevWiz2Int.tlb).
[ uuid(30F40D09-A9E4-11D2-9BC3-0000E20DCA29), version(1.0) ]
library SevWiz2Int
{
importlib("stdole32.tlb");
// Primary dispatch interface for CSevWiz2IntDoc
[ uuid(30F40D0A-A9E4-11D2-9BC3-0000E20DCA29) ]
dispinterface ISevWiz2Int
{
properties:
// NOTE - ClassWizard will maintain property information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_PROP(CSevWiz2IntDlgAutoProxy)
//}}AFX_ODL_PROP
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CSevWiz2IntDlgAutoProxy)
[id(1)] void JustCheck();
//}}AFX_ODL_METHOD
};
// Class information for CSevWiz2IntDoc
[ uuid(30F40D08-A9E4-11D2-9BC3-0000E20DCA29) ]
coclass SevWiz2Int
{
[default] dispinterface ISevWiz2Int;
};
// Primary dispatch interface for CSecond
[ uuid(30F40D1B-A9E4-11D2-9BC3-0000E20DCA29) ]
dispinterface ISecond
{
properties:
// NOTE - ClassWizard will maintain property information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_PROP(CSecond)
//}}AFX_ODL_PROP
methods:
// NOTE - ClassWizard will maintain method information here.
// Use extreme caution when editing this section.
//{{AFX_ODL_METHOD(CSecond)
[id(1)] void CheckSec();
//}}AFX_ODL_METHOD
};
// Class information for CSecond
[ uuid(30F40D1C-A9E4-11D2-9BC3-0000E20DCA29) ]
coclass Second
{
[default] dispinterface ISecond;
};
//{{AFX_APPEND_ODL}}
//}}AFX_APPEND_ODL}}
};
------------------------------
Date: Tue, 12 Jan 1999 15:35:34 +0100
From: Marek Grolms <Marek.Grolms@UL.DS.MFCR.CZ>
Subject: Trouble with Query result
hello ,
sorry for my bad English.I have questation about programing with DMO -
SQL server.
SQLOLE_LPBSTR pstrOutput ;
hr = pSQLDatabase->ExecuteWithResults("sp_who",&SQLresult ); this is OK
hr = SQLresult->GetColumnLong(5,0,&a);this is OK
hr = SQLresult->GetRangeString(pstrOutput,1,1,2,2); error
Do I must allocation memory for pstrOutput ?
Thanx
marek
------------------------------
Date: Tue, 12 Jan 1999 16:48:39 -0000
From: Geoffrey Howie <gh197@DOC.IC.AC.UK>
Subject: WCHAR
Hello,
I am using NetUserGetInfo() which requires that a server name and user name
are passed as Unicode strings (LPWSTR).
I don't know how to manipulate Unicode strings at all - All i need to know
is how to convert a char[] to LPWSTR.
TIA,
Gef Howie
------------------------------
Date: Tue, 12 Jan 1999 19:45:50 -0000
From: "Chanian, Raj K" <ChanianRK@ANC.CO.UK>
Subject: Re: CString += operator not working?
Raj Chanian
<chanianrk@anc.co.uk>
OO Developer
Boss 2000 Project
ANC Limited
Tel 01782 568 930
visit us at <www.anc.co.uk>
> -----Original Message-----
> From: Anders W=E5hlin [SMTP:wahlin@ERV.ERICSSON.SE]
> Sent: Monday, January 11, 1999 8:37 AM
> To: MSVC@PEACH.EASE.LSOFT.COM
> Subject: Re: CString +=3D operator not working?
>=20
> I have also had problems when appending a CString object to another
> CString.
> This works however:
>=20
> CString csString, csDestination;
>=20
> csDestination =3D "Hello";
>=20
> csString=3D " World!";
>=20
> csDestination =3D csString; // FAILS!?
csDestination +=3D csString; // Try this
> csDestination =3D (LPCTSTR)csString; // WORKS!!
>=20
> I don't know why.
>=20
> /Anders W
>=20
> =
----------------------------------------------------------------------
> ----
> 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: Wed, 13 Jan 1999 01:23:09 +0530
From: "Kameswara Rao M." <fd95522@BITS-PILANI.AC.IN>
Subject: Query on RUNTIME_CLASS() !!
Hai ...,
It would be the greatest help a man can ever do if u solve my prob.
---> I derived "CEquipment" from "CObject" & using CObList to store
it. The code
CEquipment* ptemp = (CEquipment *) pDoc->EquipmentList(pos);
ASSERT(ptemp->IsKindOf(RUNTIME_CLASS(CEquipment));
is causing a Assertion failure.
*) I used IMPLEMENT_SERIAL() for "CEquipment"
*) I declared CObList EquipmentList;
?) should "CObList" object also should be said IMPLEMENT_SERIAL().
please help me.
Thanx to everyone who spend their time knowing my problem ..
Yours friendly,
Kameswara Rao M.
-------------------------------------------------------
------------------------------
Date: Wed, 13 Jan 1999 00:28:46 +0100
From: =?iso-8859-1?Q?J=FCrgen_Weis?= <juergen.weis@APPLIED-IT.CH>
Subject: Cyclic thread - How To?
Hello.
I want to implement a cyclic worker-thread: A thread that's activates
himself every x seconds a does his work.
Could anybody give me a hint how to do it?
Thanks for any help.
J黵gen Weis
---------------------------------------------
AIT
Uetliberghalde 1
CH-8045 Z黵ich
T. +41-1-451 56 86
F. +41-1-463 58 77
email: juergen.weis@applied-it.ch
---------------------------------------------
------------------------------
Date: Tue, 12 Jan 1999 20:29:36 -0500
From: Rick Zhang <otv_zhang@163.NET>
Subject: SetviewportOrg
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 22:07:09 -0500
From: Richard Pickett <rpickett@NORTELNETWORKS.COM>
Subject: Re: Cyclic thread - How To?
Hello Jurgen,
Create an event in your primary thread that is going to signal your
worker thread to stop working, make sure the event is not triggered. =
Then
start the worker thread. Here's what the worker thread function will =
look
like:
UINT WorkerThread( LPVOID pvoid )
{
HANDLE* phandle =3D pvoid;
while( ::WaitForSingleObject( *phandle, 500 ) =3D=3D WAIT_TIMEOUT ) //
set the wait time to be whatever you want it to be I'm using half a =
second
(500 milliseconds)
{
// Do your work here, it hits this spot every 500
milliseconds (or whatever time you put in) plus how long it takes to =
execute
the code you put here
}
// OK main thread just signaled us to quit working so let's exit
return TRUE; // or whatever you want the thread's return code to be
}
The code above will wait half a second then execute the code in the
while block, then wait again. It will keep doing this until you set =
the
event in the main thread that created the event and started the worker
thread. If you would like more timers in the worker thread, write me =
back,
I've been doing a little experiment with timers and threads and think =
I've
come up with a clean solution.
At any rate, write me back directly if you need some more help, or
to just let me know how it worked out.
Thanks,=09
Richard W. Pickett Jr.
Windows NT Server System Engineer
rpickett@NortelNetworks.com <mailto:rpickett@NortelNetworks.com>=20
-----Original Message-----
From: J=FCrgen Weis [SMTP:juergen.weis@APPLIED-IT.CH]
Sent: Tuesday, January 12, 1999 5:29 PM
To: MSVC@PEACH.EASE.LSOFT.COM
Subject: Cyclic thread - How To?
Hello.
I want to implement a cyclic worker-thread: A thread that's
activates
himself every x seconds a does his work.
Could anybody give me a hint how to do it?
Thanks for any help.
J=FCrgen Weis
---------------------------------------------
AIT
Uetliberghalde 1
CH-8045 Z=FCrich
T. +41-1-451 56 86
F. +41-1-463 58 77
email: juergen.weis@applied-it.ch
---------------------------------------------
=09
------------------------------------------------------------------------=
--
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 .
------------------------------
End of MSVC Digest - 11 Jan 1999 to 12 Jan 1999 (#1999-12)
**********************************************************
--
※ 转载:.BBS 荔园晨风站 bbs.szu.edu.cn.[FROM: 192.168.0.4]
[回到开始]
[上一篇][下一篇]
荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店