This is exactly what I am trying to do. Nice perception I must say :) You have any idea to make it work?
Sameer Thakur
This is exactly what I am trying to do. Nice perception I must say :) You have any idea to make it work?
Sameer Thakur
Hi I am trying to split the header of a list control into multiple sub-header, but not finding a way to do so… To put in other words… I have added say 3 columns named col_1, col_2, col_3 in list control. Now I want to split col_2 into say col_2_sub_1 and col_2_sub_2. Whats the way to do so? Any help would be appreciated. Regards
Sameer Thakur
Hi all. Here are the two classes one base and other Derived ( virtually inherited from Base) Class Base { Public: Virtual void FunB(){} }; Class Derived: virtual public Base { Public: Virtual void FunD(){} }; When I derived class Derived virtually from Base, and when I saw the memory layout of objects of Derived in debug window; I saw two separate vfptrs; one for Base and one for Derived. But if I do not derive class Derived virtually from Base, then there is only single vfptr in object of Derived class? Why an extra vfptr is added/required in case of virtual inheritance?
Sameer Thakur
Hi all. Here are the two classes one base and other Derived ( virtually inherited from Base) Class Base { Public: Virtual void FunB(){} }; Class Derived: virtual public Base { Public: Virtual void FunD(){} }; When I derived class Derived virtually from Base, and when I saw the memory layout of objects of Derived in debug window; I saw two separate vfptrs; one for Base and one for Derived. But if I do not derive class Derived virtually from Base, then there is only single vfptr in object of Derived class? Why an extra vfptr is added/required in case of virtual inheritance?
Sameer Thakur
Hi Rechi. Thanks for reply. I searched SystemParametersInfo() function in MSDN. I saw all the parameters which one can either access or change through that function. But unfortunately I did not find the parameter which will help me to change the properties that I want to change.
Sameer Thakur
Hi. I want to change some of the display properties of a computer through code. I want to change the properties which appears on Right click on desktop-->Properties-->Appearance Tab-->‘Effects..’ button on right bottom corner. In that I want to uncheck all the options except ‘Show window contexts while dragging’ option. How can I achieve this through code?
Sameer Thakur
Hi. I want to know how I can create an array/object at runtime if I don’t know about its data type. For example, I have an array Say Arr, but I don’t have any information about the data type of elements it stores. It might be an array of int, float, char or even user defined data type (user defined class). I can get the information about its class or data type by using ‘type_info’, but how can I create an array/object of same data type at runtime? Like if I want to copy the contents of an array Arr into another array say ‘NewArr’; of the same type at runtime, how can I create that second array NewArr, i.e. what should I specify as a data type of ‘NewArr’?
Thanks Sameer Thakur
Hi. I am calling a function from a third party DLL which takes 4 Parameter as a LPSTR. These 4 parameters I have in CString format. So I am using following code to convert CString to LPSTR. CString strServer = “xyz.com” LPSTR server = strServer.GetBuffer(strServer.GetLength()); strServer.ReleaseBuffer(); long lRetVal = ThirdPartyDLLFun(server,…….); When I call that 3rd party DLL function in debug mode I get lRetVal = 0 as a return value. But with same inputs the return value if something else in Release mode. What could be the reason? Thanks
Sameer Thakur
Hi all. I want to add some custom menus in ‘Microsoft Front page’ application and also I want to handle click events on those custom menus. Like… I want to add custom menu and on click event of it, I want to open the currently selected image from Front page in MS-Paint. This is something possible through ‘Add Ins’. Can anybody please educate me more about creating ‘Add In’ Dlls, where to keep or how to register these Dlls with Front page? A sample code for Add In Dlls would be most appreciated. Thanks
Sameer Thakur
Excellent. :)
Sameer Thakur
In Vista there is a concept of User Account Control (UAC) by which it prevents any major changes in registry (though you are logged in as an Admin). To enable registry changes, we need to provide higher privileges to the application. To do this there is a tag in manifest.xml … Here we are granting the “highestAvailable” privilege to the application/DLL which ultimately grants the permission to ur application/DLL to access (Read/Write) registry. Sameer Thakur
I am not sure about the approach that u have specified here. But the following approach will server the purpose of enabling / disabling the tool bar controls. You need to add a function in your view class. For example… Add ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnUpdateFileNew ) at location shown. CMyView.cpp file ======================================================= BEGIN_MESSAGE_MAP(CMyView, CScrollView) //{{AFX_MSG_MAP(CMyView) other message handler functions... ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnUpdateFileNew ) other message handler functions... END_MESSAGE_MAP() Void CMyView:: OnUpdateFileNew(CCmdUI* pCmdUI) { if( some_Condition) pCmdUI->Enable(true); else pCmdUI->Enable(false); } CMyView.h file Public: void OnUpdateFileNew (CCmdUI* pCmdUI); Framework will keep calling OnUpdateFileNew function frequently and will keep the tool bar option enabled or disabled in a way u want.
Sameer Thakur
Logically..... You can add that xml file as a resource in a DLL that u are using as a custom action DLL.(No need to call InitCommonControls() in that case.) By doing that ur DLL will get elevated privileges to read/write registry entries on Vista.
Sameer Thakur
I faced the same problem with my application. I used a manifest.xml in my application as a resource and it solved the problem. Here are the contents of that manifest.xml file. Your application description here. Call InitCommonControls() in the InitInstance() of ur application BOOL CURApp::InitInstance() { InitCommonControls(); -------------------------- ---------------------- } U can follow these steps to include manifest.xml in ur project. Once writing manifest.xml is completed, you will want to add the manifest.xml file to your project in the resource editor. In Visual Studio 6, hit Ctrl+R to add a new resource, select all files and double click manifest.xml to add the file. When you see the custom resource dialog, enter the number "24" as the resource type and hit OK. Once imported, right click on the resource to open the properties window and change the ID to the number "1". Sameer Thakur
Hi all. In my application I am trying to copy an html page from one temp location to another location specified by user. I am using CopyFile() API to copy html pages. But I need to explicitly carryout the image copying along with the .html page copying. I also tried using SHFileOperation API but it also doesn't support implicite copying of images. Is there any other API which copies all the images from particular html pages implicitly when I copy that html page? Thanks
Sameer Thakur
Hi all. In my application I am trying to copy an html page from one temp location to another location specified by user. I am using CopyFile() API to copy html pages. But I need to explicitly carryout the image copying along with the .html page copying. Is there any other API which copies all the images from particular html pages implicitly when I copy that html page? Thanks -- modified at 3:27 Wednesday 18th April, 2007 -- modified at 3:28 Wednesday 18th April, 2007
Sameer Thakur
Hi all. In an owner drawn list box, when I try to set the item height by ... -------------------------------------------------------------------- void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = m_nHeight; } -------------------------------------------------------------------- I have defined m_nHeight as a class memner and its of an int type. I am setting its value with the help of another function... SetItemHeight(int nVal). When I pass the values for m_nHeight to be greater than 255, then the values got truncated... Eg. 1. When I passed 300, the item height was set to 300-256 = 49. 2. When I passed 400, the item height was set to 400-256 = 149. etc. I have taken care to set the proper data types for m_nHeight, and data type of lpMeasureItemStruct->itemHeight is UINT. Then what could be the reason behind this value truncation? Thanks
Sameer Thakur
No initialy I did not. But I have added it now but still the item size is not getting changed.
Sameer Thakur
Yes I have set the property of "Owner Draw" to "variablr" under style tab. Also checked the option of "Has String" under it.
Sameer Thakur
Hi all. I am trying to customize a List box to load the jpg preview images in it. I have managed to load all the jpg files in a list box; one below the other from the selected location. But by default the preview height is 16 pixels. I tried to change it to 200 by following way… void CListBoxEx::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct) { lpMeasureItemStruct->itemHeight = 200; } but the height is remaining the same (16 pixels). How can I set the height to the desired pixel amount? Thanks
Sameer Thakur