thanks guys, here is my situation. i have a class which hold a tree control(activex control), sure tree control offer setItemData(item, data), getITemData(item, &data); here data's type is converted to long*. i wanna store the interface pointer address in the item data, and get it back when i need. VARIANT DelegateGetData(item) { long *data; getItemData(item, data); CComVariant vt; vt.plVal = data; return vt; } CComVariant vt = DeletgateGetData(item); CComPtr spData((IMyInterface*)vt.plVal);//it there any better way here???
HeartFriend
Posts
-
VARIANT convertions [modified] -
VARIANT convertions [modified]i have a variable whose type is long*. i wanna assign it to a CComVariant variable. //put value into variant CComPtr< IMyInterface > spInter; long *p = (long*)spInter.p; CComVariant vt; vt.plVal = spInter.p; //how to get value from variant CComPtr< IMyInterface > spNew; spNew = (IMyInterface*)vt.plVal; (i can do this because i know the value type in variant, but how could i do if i don't know the type? should i call changetype() first?but what should i pass into ChangeType(???) as parameter? -- modified at 1:18 Wednesday 16th August, 2006
-
about xml efficiencyif i have to manager hundreds (maybe even thousands)of xml files, now i wanna offer my user a search function, is efficiency a serious problem f i use SAX or DOM to search for information the user query for? should i open the file just in plain text mode?
-
how to handle message of grandchild windowdoes the message first reach the DialogB then the ControlA last arrive ControlAA?if it's true ,could i handle it in DialogB? how?
-
how to handle message of grandchild windowWindowA->DoModal(popup DialogB)
DialogB | |----------ControlA ............| ............-------------ControlAA
i wanna handle ControlAA's message in DialogB and don't wanna write a custom class for ControlA, is it possible? i think i could achieve this by changing the default dialog procudure? how to change the dialog procedure? -- modified at 0:23 Friday 14th October, 2005 -
GUI Frameworkwhere can i get it?
-
Excel Automation problemi'm wonder whether CComPtr is equal with IXXXPtr(raw interface wrapper class)? for example: Excel::_ApplicationPtr spApp; HRESULT hr = spApp.CreateInstance(L"Excel.Application"); // this will succeed //CComPtrExcel::\_Application spApp; //HRESULT hr = spApp.CoCreateInstance(L"Excel.Application"); //this will fail i guess in most cases this should be equal ,right? -- modified at 2:24 Thursday 8th September, 2005
-
what's xml payload?i'm a xml newbie. i'm reading a book about XSLT, here is a paragraph i can't understand XM+L Namespaces 1.1 became a Recommendation on 4 February 2004, and the XSLT 2.0 specification makes provision for XSLT processors to work with this version, though it isn't required. Apart from the largely cosmetic change from URIs to IRIs mentioned earlier, the main innovation is the ability to undeclare a namespace, using a namespace undeclaration of the form «xmlns:prefix=""». This is particularly intended for applications like SOAP messaging, where an XML payload document is wrapped in an XML envelope for transmission. Without namespace undeclarations, there is a tendency for namespaces used in the SOAP envelope to stick to the payload XML when this is removed from the envelope, which can cause validation failures and other problems. For example, it can invalidate a digital signature attached to the document. what's xml payload?
-
how to write a xml data reduced file?i have a xml file , it looks like this: . . . i wrote a xdr file like this , but it doesn't work, i know there must be something wrong with my schema file, could u help me correct this file?
-
how to use xml schema in c++ programming?i have a xml schema file and a xml file which is to be validated? how to use them in my vc program?
-
when should i implement interface IExternalConnectioni don't quite understand the useness of it. when should i implement this interface and when should not.
-
how to debug script file?hi, Christian Graus, thanks for yor reply. how could i pop up a message dialog in jscript? which function should i call? by the way i call the script function in this way. this might be in another thread or process, are u sure popup message dialog works in this case? CComPtr spScript; ..... CComDispatchDriver spDisp; spScript->GetScriptDispatch(scriptfilename, &spDisp); spDisp.Invoke1(L"fun1", &v);
-
how to debug script file?i have a vc project in which i call the function in a script file(test.cfg), it's a jscript file, now i met a problem, so i wanna debug the script file, but i don't know how to do this, i add debugger in the file, but it doesn't work. can anyone help me?thanks in advance
-
how to convert a directory path to a relative path to another directorythanks for all you guys :).
-
how to convert a directory path to a relative path to another directoryfor example: DirA = "c:\windows\system" DirB = "c:\private\doc" A realtive to B = ..\..\private\doc how to implement this? thanks in advance.
-
how to debug exe service?in my app, i call an exe service. but i can't set break point in the exe service. how to do it? thanks in advance
-
what's the right way to do this?class CDialogPage1 : public CDialogImpl <CDialogPage1> { enum { IDD = IDD_DLG1 }; ... } class CDialogPage2 : public CDialogImpl <CDialogPage2> { enum { IDD = IDD_DLG2 }; ... } class CSettingDlg : public CDialogImpl <CSettingDlg> { public: enum { IDD = IDD_SEETINGDLG }; .... ??? GetDialog(UINT DIALOG_IDD) { //return m_page1 or m_page2 according to the param } private: CDialogPage1 m_page1; CDialogPage2 m_page2; }
how to write this GetDialog function? or maybe i should change CDialogPage1 & CDialogPage2 , make them inherit from the same class? could anyone give me some hints? -
question about macro definevoid func(UINT nOperation) { #if (nOperation == OPERATION_1) #define OPERATION(spObj, nParam) fun1(spObj, nParam) #elif (nOperation== OPERATION_2) #define OPERATION(spObj, nParam) func2(spObj, nParam) #elif (nOperation== OPERATION_3) #define OPERATION(spObj, nParam) func3(spObj, nParam) nFrameNo) #else #define OPERATION(spObj, nParam) #endif .... OPERATION(spObj, n) // whatever nOperation be, it always call fun1,why??? }
-
midl error , anyone met this before?midl\oleaut32.dll : error MIDL2020 : error generating type library : LayOut failed : NSMyInterface(0x80029C83) Error executing midl.exe. is it a bug of microsoft platform sdk? should i update my sdk? i'm using win2003 sp1 ,PSDK 2003 Feb
-
how can i support Text copy/paste via DataObjecti have a class which has partly implement the IDataObject interface. i don't know how to finish the GetData(...) method what should i do in it so it can support text copy/paste?