|
You can't use IContextMenu::InvokeCommand() for "Send To" selections. If you pass the "Send To" ID (which is always the same) Windows crashes your app. You need to use a drag & drop interface, but I can't see how to do that because I can't find out what was selected from the menu.
I'm working on building me own menu now, but I can't get and drives listed. eg. "3 1/2 Floppy, .."
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I can't seem to get the floppy listed either at a closer look, either
the flags to EnumObjects() are wrong, or windows add the floppy in addition to what is in the sendto folder. (I guess the later is correct...but who knows)
/Magnus
|
|
|
|
|
Did a little testprog and got the same effect you did.
Eg. i get the same ID back no mather what i choose in the sendto menu.
But passing that id to InvokeCommand() does trigger the right selection.
(dont know what kind of voodoo happens behind the back)
Maybe it works differently on different windows version.
(I run XP and IE6)
/Magnus
|
|
|
|
|
Magnus H wrote:
You are talking about "SendTo" and "OpenWith" and these are 2
different things.
"OpenWith" is implemented as a contextmenu extension so it can be
reused.
Thanks for your reply.
Yes you are right and I have "Open With" working ok, but even that needs some tricks to display correctly, I assume because it has bitmaps and is owner drawn.
Magnus H wrote:
The "SendTo" you have to build yourself, just enum the contents using
SHGetSpecialFolderLocation() with CSIDL_SENDTO.
Yes that's how WndTabs works. And to execute a "Send To" menu item it uses drag & drop code. This all seems quite complex, especially seeing that I can get the "Send To" menu displayed ok without iterating CSIDL_SENDTO, display the OD bitmaps etc, I just can't find out how to execute the selected menu item.
Do you know how to find out about "Send To|Drive/Folder" items iterating CSIDL_SENDTO?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hi,
If you could help that would be great.
I am trying to make changes to a html page using IMarkupSevices and IHTMLElement.
I get the document, create the IMarkupServices and make the change. I can see the change in the HTML page but when I come to save the changes the original page is saved to file NOT the changes I have made.
Here are the code snipets.
The html document is from a CHTMLView class
////////////////////////////////////////////
//Create and make the change to HTMLDocument
IHTMLDocument2 *pDoc;
IDispatch* pDisp = GetHtmlDocument();
HRESULT hr;
hr = pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDoc );
if (pDoc)
{
CComQIPtr<imarkupservices, &iid_imarkupservices=""> pMS;
pMS = pDoc;
if (pMS)
{
CComPtr<imarkuppointer> pMkStart, pMkFinish;
pMS->CreateMarkupPointer(&pMkStart);
pMS->CreateMarkupPointer(&pMkFinish);
IHTMLElement* pElement;
LastPara( &pElement ); // returns the last element in the document
if( pElement )
{
pMkStart->MoveAdjacentToElement(pElement, ELEM_ADJ_BeforeBegin );
pMkFinish->MoveAdjacentToElement(pElement, ELEM_ADJ_BeforeBegin );
}
pElement->Release();
IHTMLElement *pNewElement;
OLECHAR id[] = OLESTR("id=anID");
pMS->CreateElement(TAGID_P, id, (IHTMLElement**) &pNewElement);
pMS->InsertElement(pNewElement, pMkStart, pMkFinish);
pNewElement->Release();
OLECHAR* text = L"Text to add";
pMS->InsertText(text, -1, pMkStart );
}
pDoc->Release();
}
////////////////////////////////////////////
//Save the document
IHTMLDocument2 *pDoc = NULL;
IDispatch* pDisp = GetHtmlDocument();
HRESULT hr;
hr = pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDoc );
if (pDoc)
{
CComPtr<ipersistfile> pPersistFile;
hr = pDoc->QueryInterface(IID_IPersistFile, (void**) &pPersistFile);
if(! FAILED(hr) )
{
CString csPath = "C:\\Temp\\test.htm";
MAKE_WIDEPTR_FROMANSI(wszCodeFile, csPath.GetBuffer(csPath.GetLength()));
pPersistFile->Save(wszCodeFile, TRUE);
if ( SUCCEEDED(hr) )
{
hr = pPersistFile->SaveCompleted(wszCodeFile);
}
pDoc->Release();
}
}
|
|
|
|
|
Hi,
I have made a connection using TAPI, now can i use Winsock functions and send and receive data using that
Sameer
|
|
|
|
|
I think you should be using RAS API instead (see RasDial and friends), which establishes an IP channel thru a modem connection. TAPI is usually restrained to handle link-level connections, not IP stuff.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
Can you suggest some site or example. Actually i have a
TCP/IP application, but my two computers just have
a modem (USB), so i want that one dials into other
and then the application starts..
Please suggest
Thanx
Sameer
|
|
|
|
|
Hi,
Could anyone pl give me some links where i can find some simple graphics editor source codes written in c/c++?
Regards
Neha
|
|
|
|
|
try www.planet-source-code.com
sonork: 100:18407
|
|
|
|
|
I am newly learning windows programming. I am trying to create a sort of simple application. When I try and link my project I get an error reading - fatal error RC1004: unexpected end of file found
I am not sure how to deal with this. Any suggections? The error stems from the header file:
// define for the application icon
#define ICON_T3DX 100
// define for the application cursor
#define CURSOR_CROSSHAIR 200
// define for the application music
#define SOUND_ID_MUSIC 1
// defines for the top level menu OPTIONS
#define MENU_OPTIONS_ID_PRINT 1000
#define MENU_OPTIONS_ID_EXIT 1001
// defines for the top level menu HELP
#define MENU_HELP_ABOUT 2000
#define MENU_HELP_INSTRUCTIONS 2001
I am using the header to help with the implementation of resources.
If anyone can help me resolve this error, that would be great.
Thanks a lot!!!
|
|
|
|
|
did you include the header? i've done that alot
~SilverShalkin
|
|
|
|
|
#include <stdafx.h>
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I've tried doing that. I get another error, "the file cannot be opened. I checked for it in the IDE file directory and it isn't thete. Any other suggestion?
|
|
|
|
|
Sorry... I did find and include th file in the project afterwards but ut still gives the same error- unexpected end of file found.
|
|
|
|
|
You need to #include stdafx.h for all your cpp files
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
i have seen the samples in msdn, but all of them is written by vb.net.
c++ : my dream
|
|
|
|
|
There is a ATL-wizard that will create an ATL-based VS.NET Add-In for you... It includes code for creating a Toolbar.
(No more MFC-based Add-ins, it seems...)
Peace!
-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
(Try Check Favorites Sometime!)
|
|
|
|
|
can anyone please tell me how do i put this to boxes in my dev studio :NET
Picture [New Window]
they had disappeared...
and i cant get them back
i cant find any option
tanks
Casa.Sapo.pt
|
|
|
|
|
I haven't used VS.net so I don't know if it's changed from VS6, but try right-clicking in an empty part of the toolbar area, and put a tick next to "WizardBar" in the popup menu
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
|
this is my code:
#include <iostream>
using namespace std;
char *pchar[6];
char character[6] = "hello";
int main()
{
strcpy(pchar, &character);
return 0;
}
that is "all" my code, no more no less. the problem accures on line:
strcpy(pchar, &character);
im not very sure on what this'll do, what i am trying to do is, have pchar point to the address of character. i thought that if there was more than one character i should use strcpy(), but im not very sure.
how would i accomplish this? "see any problems, or better way of doing things, just note it "
Thanks!
~SilverShalkin
|
|
|
|
|
Two problems:
1) pchar is an array of char*, not char. So you will not be able to access the elements in the pchar array as a string. Which means that you will not be able to send that array to strcpy.
What you would actually do with an array like pchar is point to 6 different strings. Then when you wanted to use one of the strings you would access the string in the array like so:
strcpy(pchar[0], ...);
2) character is a char array, which is equivalent to one char*. Therefore you do not need to take the address of the character array, you could directly pass it into strcpy like this:
strcpy(..., character);
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
but i want to point to character, if i dake the address (&) off, it wouldnt be point to character would it?
so i would have to declare my pchar like
char *pchar[6];
pchar[0] = &character[0];
pchar[1] = &character[1];
pchar[2] = &character[2];
pchar[3] = &character[3];
pchar[4] = &character[4];
pchar[5] = &character[5];
?
i hope thats wrong... thats allot to type for somthing so small
Thank!
~SilverShalkin
|
|
|
|
|
Lets assume for a minute that you did do that.
You could then do this:
printf("%s\n",pchar[0]);
printf("%s\n",pchar[1]);
printf("%s\n",pchar[2]);
printf("%s\n",pchar[3]);
printf("%s\n",pchar[4]);
printf("%s\n",pchar[5]);
and the results would be:
hello
ello
llo
lo
o
<<there would="" be="" a="" blank="" line="" here="">>
in summary an array of characters IS a pointer to a sequence of characters.
so if we were to do this instead
char characters[6] = "hello";
char* pchar = characters;
char* pchars = &characters[0];
then examine the values of all three variables in the debugger.
they would all be identical.
Hope this helps in your struggle with pointers.
Roger.
|
|
|
|