Click here to Skip to main content
16,008,942 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHiding the caption bar's close box of a wizard. Pin
CMFC6.0VS.NETUser11-Jul-01 9:30
CMFC6.0VS.NETUser11-Jul-01 9:30 
GeneralRe: Hiding the caption bar's close box of a wizard. Pin
Bret Faller11-Jul-01 13:44
Bret Faller11-Jul-01 13:44 
GeneralRe: Hiding the caption bar's close box of a wizard. Pin
CMFC6.0VS.NETUser12-Jul-01 4:32
CMFC6.0VS.NETUser12-Jul-01 4:32 
GeneralRe: Hiding the caption bar's close box of a wizard. Pin
CMFC6.0VS.NETUser12-Jul-01 7:52
CMFC6.0VS.NETUser12-Jul-01 7:52 
Generalsimple polymorphism error Pin
Jake Palmer11-Jul-01 9:21
Jake Palmer11-Jul-01 9:21 
GeneralRe: simple polymorphism error Pin
Michael Dunn11-Jul-01 9:36
sitebuilderMichael Dunn11-Jul-01 9:36 
GeneralRe: simple polymorphism error Pin
Jake Palmer11-Jul-01 11:01
Jake Palmer11-Jul-01 11:01 
GeneralATL (BSTR) to VB Pin
Dan Madden11-Jul-01 9:19
Dan Madden11-Jul-01 9:19 
I have a DLL that when I use it in VBS it works fine everytime...but when I use VB, it works the first time, but the second call returns TRASH. Can anyone explain why?? Here is a code snippet:

STDMETHODIMP CSetShare::get_pNetDiskEnum(BSTR sServer, BSTR *pVal)
{
// NetserverDiskEnum Function to
// Enumerate list of remote Server Drive Letters.

const int ENTRY_SIZE = 3; // Drive letter, colon, NULL
LPTSTR pBuf = NULL;
DWORD dwLevel = 0; // level must be zero
DWORD dwPrefMaxLen = -1;
DWORD dwEntriesRead = 0;
DWORD dwTotalEntries = 0;
NET_API_STATUS nStatus;
CComBSTR cstr1;

//
// Call the NetServerDiskEnum function.
//
nStatus = NetServerDiskEnum((LPSTR)sServer,
dwLevel,
(LPBYTE *) &pBuf,
dwPrefMaxLen,
&dwEntriesRead,
&dwTotalEntries,
NULL);
//
// If the call succeeds,
//
if (nStatus == NERR_Success)
{
LPTSTR pTmpBuf;
if ((pTmpBuf = pBuf) != NULL)
{
DWORD i;
DWORD dwTotalCount = 0;
//
// Loop through the entries.
//
for (i = 0; i < dwEntriesRead; i++)
{
assert(pTmpBuf != NULL);

if (pTmpBuf == NULL)
{
// On a remote computer, only members of the
// Administrators or the Account Operators
// local group can execute NetServerDiskEnum.
//

break;
}
//
// Print drive letter for each drive;
// the number of entries actually enumerated; and
// the total number of entries available.
//

cstr1 += pTmpBuf;
pTmpBuf += ENTRY_SIZE;
dwTotalCount++;

}
cstr1 += pTmpBuf;
}
}
else
cstr1 = "System Error: No Such Machine";


if (pBuf != NULL) // Free the allocated buffer.
NetApiBufferFree(pBuf);

*pVal = (BSTR)cstr1; // Conversion to BSTR Type for VB

return S_OK;

}


Thanks in advance,

Dan
GeneralRe: ATL (BSTR) to VB Pin
Michael Dunn11-Jul-01 9:32
sitebuilderMichael Dunn11-Jul-01 9:32 
GeneralRe: ATL (BSTR) to VB Pin
Dan Madden11-Jul-01 10:17
Dan Madden11-Jul-01 10:17 
GeneralCapturing DOS output Pin
11-Jul-01 9:09
suss11-Jul-01 9:09 
GeneralRe: Capturing DOS output Pin
Ben Burnett11-Jul-01 10:19
Ben Burnett11-Jul-01 10:19 
GeneralRegistering file types that aren't doc/view types Pin
11-Jul-01 7:53
suss11-Jul-01 7:53 
GeneralWindows 2000 using WTL Pin
Lilian Chan-Grant11-Jul-01 6:58
Lilian Chan-Grant11-Jul-01 6:58 
GeneralRe: Windows 2000 using WTL Pin
Michael Dunn11-Jul-01 7:20
sitebuilderMichael Dunn11-Jul-01 7:20 
GeneralRe: Windows 2000 using WTL Pin
Lilian Chan-Grant11-Jul-01 8:15
Lilian Chan-Grant11-Jul-01 8:15 
GeneralCString parsing Pin
RobJones11-Jul-01 6:42
RobJones11-Jul-01 6:42 
GeneralRe: CString parsing Pin
Carlos Antollini11-Jul-01 6:57
Carlos Antollini11-Jul-01 6:57 
GeneralRe: CString parsing Pin
RobJones11-Jul-01 7:04
RobJones11-Jul-01 7:04 
GeneralRe: CString parsing Pin
Carlos Antollini11-Jul-01 7:16
Carlos Antollini11-Jul-01 7:16 
GeneralRe: CString parsing Pin
RobJones11-Jul-01 7:26
RobJones11-Jul-01 7:26 
GeneralRe: CString parsing Pin
#realJSOP12-Jul-01 3:05
professional#realJSOP12-Jul-01 3:05 
GeneralDundas Ultimate Diagram Pin
Jim Weiss11-Jul-01 6:26
Jim Weiss11-Jul-01 6:26 
GeneralCompile Error, Help!!! Pin
Nick Armstrong11-Jul-01 5:11
Nick Armstrong11-Jul-01 5:11 
GeneralATL Pin
KingsGambit11-Jul-01 5:11
KingsGambit11-Jul-01 5:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.