|
What object exposes what method?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
powerpoint application object exposes fn Item(VARIANT*)
|
|
|
|
|
Perhaps something this will do...
CString str;
long count = addIns.GetCount();
for(int i=0;i<count;i++)>
{
VARIANT var;
var.vt = VT_I4;
var.lVal = i;
LPDISPATCH lpDisp = TheInterface->Item( &var );
}
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
SRKSHOME wrote: How do I convert integer or long to VARIANT* type in C++?
Directly? You don't.
But if you need to call a function that wants a pointer to a variant (holding a long), then it's straightfoward.
CComVariant varTemp (lMyLongVariable);
HRESULT hr = SomeFunction (&varTemp, other, parameters, here);
Iain.
|
|
|
|
|
It's easier to just use the COleVariant class.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello !!
I have an byte array of this type
BYTE abyTemp [6] = {0x0D, 0x0A, 0x06, 0x00, 0x81, 0x1B}
I need to convert them to string
CString strTemp;
strTemp = "0D0A0600811B"
I tried in this manner
chat ch;
CString str;
for (i=0; i < 6; i ++)
{
ch = byTemp [i];
str += ch;
}
but here i get some special symbols..
|
|
|
|
|
You are adding them as the bytes into your string - which as you see will cause confusion.
Try:
CString MakeHexText (BYTE *byIn, UINT nCount)
{
CString strReturn, strByte;
for (UINT n = 0; n < nCount; n++)
{
strByte.Format (_T("%02x"), byIn [n]);
strReturn += strByte;
}
return strReturn;
}
Iain.
|
|
|
|
|
Thanks its working !!
|
|
|
|
|
Hello.I have a problem with Shell integration. I have created DLL wich add a new menu item into explore popup menu.
When i work with simple menu, i have no problem.But i need insert into explore menu with submenu.I deed it.
An that is the question.How i can process event, when user push my submenu?I use IContextMenu interface, and process
Initialize, GetCommandString, QueryContextMenu and InvokeCommand events.When i add submenu, InvokeCommand event no working on it.
Wait for answer. Thanks for help.
|
|
|
|
|
There's the wonderful Dunn's article series [^] here at CP.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, thanks, this is realy wonderful article, i based on it.
All works fine with simple(one level menus).
When use
InsertMenu ( hmenu, uMenuIndex, MF_STRING | MF_BYPOSITION, uCmdID++,
_T("My menu") );
there is no problem. InvokeCommand work fine.
But i did next
HMENU SubMenu = CreatePopupMenu();
InsertMenu ( SubMenu, uMenuIndex, MF_BYPOSITION,1, _T("My Sub Menu"));
InsertMenu( hmenu, uMenuIndex, MF_STRING | MF_BYPOSITION | MF_POPUP, (UINT_PTR )SubMenu,
_T("My Menu"));
SetMenuItemBitmaps ( hmenu, MenuIndex, MF_BYPOSITION, MenuBMP, NULL );
Menu and submenu is visible, but when i press on my sub menu - program not paused on my breakpoint on InvokeCommand event, but ole error is appeared. What do You think about this?
modified on Wednesday, October 22, 2008 8:17 AM
|
|
|
|
|
I am getting following error with CRecordSet::Update( );
I opened record set with dynaset open, then called AddNew , then calling Update.
|
|
|
|
|
Does the record set contain more than one table? Have you opened either the record set or the database in read-only mode? If you are using a DSN, is it read-only?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
Hello all,
I'm encountering an error 1917 "The RPC call completed before all pipes were processed." while trying to restore an encrypted file by WriteEncryptedFileRaw(), backed up using ReadEncryptedFileRaw(). The error is *not* encountered when trying to restore on an NTFS volume but encountered *every time* trying to restore on a FAT32 volume. I assumed that RAW API will handle the case of "Volume not NTFS so EFS not supported" and decrypt the file and write to the volume as a normal behavior. I couldn't find anything specific to this on MSDN pages.
|
|
|
|
|
How to check programmatically whether password complexity requirement is enabled in local security policy ?
modified on Wednesday, October 22, 2008 7:32 AM
|
|
|
|
|
In my main application, I need to add a new function where people can add lines, circles, and all sorts of doodles to the main view. Imagine the drawing tools in word - similar sort of thing.
I've literally rolled my sleeves up and started coding (on a test copy of the project - not insane!), but I'm sure this is something I can stealreuse the code of from somewhere.
Do you have any pointers to articles, or sites elsewhere I could look? Even a nice toolbar with graphic tool buttons would be a start.
I'm sure a skinny dialog box with line,circle,text buttons, line style, colour picker etc is already done...
Iain.
{edited to change title bar}
modified on Wednesday, October 22, 2008 6:59 AM
|
|
|
|
|
I have a CListCtrl member in my dialog.
During runtime, I fill the control's columns and rows with data
using 'InsertColumn' and 'SetItemText' functions.
Note : This List Control contains 5 rows and 3 columns full of data.
Now, I want a copy of the data of the whole list control in
another ClistCtrl object which I create during runtime using CListCtrl's Create function.
How can I do this since I don't have a 'Copy' function as for data structures
like CStringArray.
|
|
|
|
|
There is no LB_CLONE_FROM_OTHER list control message, so you're going to have to roll your sleeves up and do it yourself.
If you already have code to fill up the first control, can you move that into a function, and call it with either CListCtrl * or a dlg ID?
Or if this will change over time, write a cloning function? Get the number of columns / rows of the first control, set the second one to the same. Call GetItem a lot on the first control, and SetItem a lot on the second?
You'll have to be careful. One thing I can think of is an items lParam - if it is a casted pointer, can you use the same pointer? Or make a new object to point to? Etc. That sort of thing is application specific though.
Iain.
|
|
|
|
|
hi,
i am working on buttons.
could any one explain the mechanism behind the shortcut key for button and its functionality.
i have to use more than 1 button.
hence shortcut key plays an important role.
thanks,
RNarayan
|
|
|
|
|
If this is on a dialog box, it's simple. Loosely, the dialog box message handler grabs keypresses that have the Alt key down also. (eg, Alt-Q). Then it looks in the tab order for a control with that letter in it's text, preceded by an & character. If the control is (eg) a static control, and can't take the keyboard focus, the next control along gets it.
It is a bit more complex when you start mixing in the WS_GROUP style (for radio boxes etc), and && doesn't work...
Try using the resource editor, make a fake dialog, and play for a while.
Iain.
|
|
|
|
|
How to know if a software is installed in the system.
Other than verifying registry entries HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders and HKEY_CURRENT_USER\Software ,is there any other ideal way to find it.
For ex: I want to check if Visual Studio is installed or not. If installed i want to get it's details such as version etc.
modified on Wednesday, October 22, 2008 4:13 AM
|
|
|
|
|
What kind of software? Your software?
|
|
|
|
|
For ex: I want to check if Visual Studio is installed or not. If installed i want to get it's details such as version etc.
|
|
|
|
|
divilin thiyagaraj wrote: For ex: I want to check if Visual Studio is installed or not.
For VS6, you could look for the presence of HKCR\Interface\{96961260-A819-11CF-AD07-00A0C9034965} in the registry.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|