Click here to Skip to main content
16,006,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGarbage collection Pin
roel_23-Jul-03 2:02
roel_23-Jul-03 2:02 
GeneralRe: Garbage collection Pin
KaЯl23-Jul-03 5:55
KaЯl23-Jul-03 5:55 
GeneralRe: Garbage collection Pin
Anthony_Yio24-Jul-03 1:19
Anthony_Yio24-Jul-03 1:19 
GeneralMMC PropertySheet question - need a MMC guru Pin
YaronNir23-Jul-03 1:50
YaronNir23-Jul-03 1:50 
GeneralLimit of 64 characters in tray icon hint. Pin
s_k23-Jul-03 1:26
s_k23-Jul-03 1:26 
GeneralRe: Limit of 64 characters in tray icon hint. Pin
Alexander M.,23-Jul-03 1:34
Alexander M.,23-Jul-03 1:34 
GeneralCLSIDFromProgID with VB6 DLL Pin
Hesham Amin23-Jul-03 1:19
Hesham Amin23-Jul-03 1:19 
GeneralRe: CLSIDFromProgID with VB6 DLL Pin
Mike Dimmick23-Jul-03 4:01
Mike Dimmick23-Jul-03 4:01 
If you actually check the value of hr, you'll probably find it's E_POINTER (0x80004003), because you're passing a NULL pointer.

You're trying to get CLSIDFromProgID to write into location 0.

The following may work rather better:

CLSID cls = { 0 };
HRESULT hr =
    CLSIDFromProgID( OLESTR( "FileDownload.NetDown" ), &cls );
 
CString sMessage;
 
if ( SUCCEEDED( hr ) )
{
    sMessage.Format( _T( "CLSID(1): 0x%08x" ), cls.Data1 );
}
else
{
    sMessage.Format( _T( "ERROR: 0x%08x" ), hr );
}
 
AfxMessageBox( sMessage );
Key things to learn:
  • A pointer must point to some allocated space.
  • LPOLESTR is always a pointer to a Unicode string. Use the OLESTR macro to portably produce a compatible string.
  • HRESULTs can be either success or failure - there are multiple success codes and multiple failure codes. To generically test for success or failure, use the SUCCEEDED and FAILED macros.
  • The documentation only lists common error codes, it does not show all possible error codes.
Hope this helps.
GeneralMCIWnd woes Pin
brian scott23-Jul-03 1:15
brian scott23-Jul-03 1:15 
GeneralRe: MCIWnd woes Pin
RobJones23-Jul-03 5:11
RobJones23-Jul-03 5:11 
GeneralREAD FROM RESOURCE FILE Pin
Cheickna23-Jul-03 0:28
Cheickna23-Jul-03 0:28 
GeneralRe: READ FROM RESOURCE FILE Pin
Iain Clarke, Warrior Programmer23-Jul-03 0:51
Iain Clarke, Warrior Programmer23-Jul-03 0:51 
GeneralRe: READ FROM RESOURCE FILE Pin
Alexander M.,23-Jul-03 1:41
Alexander M.,23-Jul-03 1:41 
QuestionHow to wait Windows to repaint? Pin
Daniel Woo23-Jul-03 0:20
Daniel Woo23-Jul-03 0:20 
AnswerRe: How to wait Windows to repaint? Pin
Frank K23-Jul-03 0:48
Frank K23-Jul-03 0:48 
GeneralSaving/loading bitmaps Pin
Lakitu23-Jul-03 0:11
Lakitu23-Jul-03 0:11 
GeneralRe: Saving/loading bitmaps Pin
Philip Patrick23-Jul-03 1:01
professionalPhilip Patrick23-Jul-03 1:01 
QuestionHow to reach external devices? Pin
cemlouis23-Jul-03 0:02
cemlouis23-Jul-03 0:02 
AnswerRe: How to reach external devices? Pin
Toni7823-Jul-03 0:31
Toni7823-Jul-03 0:31 
AnswerRe: How to reach external devices? Pin
KarstenK23-Jul-03 0:35
mveKarstenK23-Jul-03 0:35 
AnswerRe: How to reach external devices? Pin
Toni7823-Jul-03 1:25
Toni7823-Jul-03 1:25 
GeneralHelp me.....about MDI app Pin
_skidrow_vn_22-Jul-03 23:56
_skidrow_vn_22-Jul-03 23:56 
GeneralRe: Help me.....about MDI app Pin
Iain Clarke, Warrior Programmer23-Jul-03 0:27
Iain Clarke, Warrior Programmer23-Jul-03 0:27 
GeneralIE Programming question! Pin
Small Rat22-Jul-03 23:48
Small Rat22-Jul-03 23:48 
GeneralDialog box pops up and vanishes immediately Pin
Deepak Samuel22-Jul-03 23:43
Deepak Samuel22-Jul-03 23:43 

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.