Click here to Skip to main content
15,905,508 members
Home / Discussions / COM
   

COM

 
GeneralRe: programming autocad : GetAttributes Pin
Steve S19-Aug-03 0:44
Steve S19-Aug-03 0:44 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 2:58
JP GOBLET19-Aug-03 2:58 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 3:44
JP GOBLET19-Aug-03 3:44 
GeneralRe: programming autocad : GetAttributes Pin
JP GOBLET19-Aug-03 4:02
JP GOBLET19-Aug-03 4:02 
GeneralRe: programming autocad : GetAttributes Pin
Steve S19-Aug-03 4:37
Steve S19-Aug-03 4:37 
QuestionWhat is wrong with this code!!! Pin
adsilva12-Aug-03 0:36
adsilva12-Aug-03 0:36 
AnswerRe: What is wrong with this code!!! Pin
Stephane Rodriguez.12-Aug-03 0:51
Stephane Rodriguez.12-Aug-03 0:51 
AnswerRe: What is wrong with this code!!! Pin
Steve S12-Aug-03 0:51
Steve S12-Aug-03 0:51 
What the method returns is an HRESULT, which simply reveals success or failure.
Your IDL (or ODL) for the method needs to be


HRESULT MachineID([out,retval]long *pSerialNo)

and you need to modify the C++ declaration and code

STDMETHODIMP CCSerialno::MachineID(long* pRes)
{
// TODO: Add your implementation code here
TCHAR bufVolumeLabel[255] = _T("");
DWORD Size=255;
DWORD SerialNo;
long Slnum=0;
DWORD MCL;
DWORD Flags;

TCHAR bufFileSystem[255] =_T("");

for (int iCounter=0;iCounter < 26; i++)
{
if (GetDriveType((LPCTSTR)(HardDiskLetters[iCounter]))==DRIVE_FIXED)
if (GetVolumeInformation((LPCTSTR)(HardDiskLetters[iCounter]),
(LPTSTR)(bufVolumeLabel),Size,&SerialNo,&MCL,&Flags,(LPTSTR)(bufFileSystem),Size))
{
Slnum=Slnum+SerialNo;
}
}
if (pRes!=NULL)
{
*pRes = Slnum;
return S_OK;
}
return E_INVALIDARG;
}



Steve S
GeneralRe: What is wrong with this code!!! Pin
Stephane Rodriguez.12-Aug-03 1:00
Stephane Rodriguez.12-Aug-03 1:00 
GeneralRe: What is wrong with this code!!! Pin
Steve S12-Aug-03 1:01
Steve S12-Aug-03 1:01 
GeneralTree Control context menus Pin
Steven M Hunt11-Aug-03 12:36
Steven M Hunt11-Aug-03 12:36 
GeneralRe: Tree Control context menus Pin
Steve S11-Aug-03 22:04
Steve S11-Aug-03 22:04 
GeneralGetting mouse events from Powerpoint Pin
G. Raven11-Aug-03 4:10
G. Raven11-Aug-03 4:10 
GeneralSimilar problem Pin
ScarletEmerald5-Jun-04 16:22
ScarletEmerald5-Jun-04 16:22 
GeneralRecurrence object in Outlook Appointments Pin
Brigg Thorp11-Aug-03 1:44
Brigg Thorp11-Aug-03 1:44 
GeneralPlease help!! Pin
adsilva7-Aug-03 22:15
adsilva7-Aug-03 22:15 
GeneralRe: Please help!! Pin
Stephane Rodriguez.7-Aug-03 23:34
Stephane Rodriguez.7-Aug-03 23:34 
GeneralRe: Please help!! Pin
adsilva7-Aug-03 23:56
adsilva7-Aug-03 23:56 
GeneralRe: Please help!! Pin
Stephane Rodriguez.8-Aug-03 0:00
Stephane Rodriguez.8-Aug-03 0:00 
GeneralRe: Please help!! Pin
adsilva8-Aug-03 0:08
adsilva8-Aug-03 0:08 
GeneralRe: Please help!! Pin
Stephane Rodriguez.8-Aug-03 0:35
Stephane Rodriguez.8-Aug-03 0:35 
GeneralRe: Please help!! Pin
adsilva8-Aug-03 0:52
adsilva8-Aug-03 0:52 
GeneralRe: Please help!! Pin
Stephane Rodriguez.8-Aug-03 1:16
Stephane Rodriguez.8-Aug-03 1:16 
GeneralRe: Please help!! Pin
adsilva8-Aug-03 1:45
adsilva8-Aug-03 1:45 
GeneralRe: Please help!! Pin
Stephane Rodriguez.8-Aug-03 2:07
Stephane Rodriguez.8-Aug-03 2:07 

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.