Alphabetical Class Index   File Members   Compound Members   File List  

Hoops3dStreamProperty.h

00001 //
00002 // Copyright (c) 2002 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Header: /files/homes/master/cvs/hoops_master/docs_hoops/HoopsAtl/ref_manual/Attic/_hoops3d_stream_property_8h-source.html,v 1.1.2.2 2004/06/28 20:59:56 rob Exp $
00013 //
00014 
00015 #ifndef __Hoops3dStreamPROPERTY_H_
00016 #define __Hoops3dStreamPROPERTY_H_
00017 
00018 #include "resource.h"       // main symbols
00019 #include "guidlist.h"
00020 EXTERN_C const CLSID CLSID_Hoops3dStreamProperty;
00021 
00023 // CHoops3dStreamProperty
00024 class ATL_NO_VTABLE CHoops3dStreamProperty :
00025     public CComObjectRootEx<CComSingleThreadModel>,
00026     public CComCoClass<CHoops3dStreamProperty, &CLSID_Hoops3dStreamProperty>,
00027     public IPropertyPageImpl<CHoops3dStreamProperty>,
00028     public CDialogImpl<CHoops3dStreamProperty>
00029 {
00030 public:
00031     CHoops3dStreamProperty();
00032 
00033     enum {IDD = IDD_Hoops3dStreamPROPERTY};
00034 
00035 //DECLARE_REGISTRY_RESOURCEID(IDR_Hoops3dStreamPROPERTY)
00036 static void FixGuid(char *in1, char *in2, unsigned short *out1, unsigned short *out2)
00037 {
00038     char res[256];
00039     strcpy(res, "{");
00040     strcat(res, in2);
00041     strcat(res, "}");
00042     mbstowcs(out2, res, strlen(res)+1);
00043     mbstowcs(out1, in1, strlen(in1)+1);
00044 }
00045 
00046 
00047 static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
00048 {
00049  
00050  
00051         _ATL_REGMAP_ENTRY entries[2];
00052 
00053         unsigned short key1[256];
00054         unsigned short data1[256];
00055      
00056 
00057         FixGuid("PROPID", CLSID_HOOPS3DSTREAMPROPERTY_CLASS, key1, data1);
00058 
00059         entries[0].szKey = key1;
00060         entries[0].szData = data1;
00061         entries[1].szKey = 0;
00062         entries[1].szData = 0;
00063 
00064 
00065 
00066     return(_Module.UpdateRegistryFromResource(IDR_Hoops3dStreamPROPERTY, bRegister,entries));
00067 }
00068 
00069  
00070 
00071 DECLARE_PROTECT_FINAL_CONSTRUCT()
00072 
00073 BEGIN_COM_MAP(CHoops3dStreamProperty) 
00074     COM_INTERFACE_ENTRY(IPropertyPage)
00075 END_COM_MAP()
00076 
00077 BEGIN_MSG_MAP(CHoops3dStreamProperty)
00078     CHAIN_MSG_MAP(IPropertyPageImpl<CHoops3dStreamProperty>)
00079     COMMAND_HANDLER(IDC_BROWSE, BN_CLICKED, OnClickedBrowse)
00080     COMMAND_HANDLER(IDC_EMBED, BN_CLICKED, OnClickedEmbed)
00081     MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
00082 END_MSG_MAP()
00083 // Handler prototypes:
00084 //  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00085 //  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00086 //  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
00087 
00088     STDMETHOD(Apply)(void);
00089  
00090 
00091     LRESULT OnClickedBrowse(WORD hNotifyCode, WORD wID, HWND hWNdCtl, BOOL &bHandled);  
00092  
00093     
00094     char m_filename[4096];
00095     bool m_embed;
00096  
00097     LRESULT OnClickedEmbed(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
00098  
00099 
00100     void ConvertToChar(char *mbstr, const wchar_t *wcstr, size_t count);
00101  
00102 
00103     LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
00104  
00105 };
00106 
00107 
00108 
00109 #endif //__Hoops3dStreamPROPERTY_H_