|
I want to copy all my favourites to some other USB Drive through programatically.
For that if i use SHFileOperation option to copy all tha favourites into my drive...The copied files are not copied as Internet shortcuts they just copied as files.
For that I retrive URLs and want to create internet shortcuts for that URLs...
Do u hav any idea regarding this favorites importing to our program ?
|
|
|
|
|
I got this code from MSDN,
#include <windows.h>
#include <shlobj.h>
#include <intshcut.h>
HRESULT CreateInternetShortcut(LPTSTR pszShortcut, LPTSTR pszURL)
{
IUniformResourceLocator *purl;
HRESULT hr;
hr = CoInitialize(NULL);
if(SUCCEEDED(hr))
{
hr = CoCreateInstance( CLSID_InternetShortcut,
NULL,
CLSCTX_INPROC_SERVER,
IID_IUniformResourceLocator,
(LPVOID*)&purl);
if(SUCCEEDED(hr))
{
IPersistFile* ppf;
hr = purl->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
if(SUCCEEDED(hr))
{
hr = purl->SetURL(pszURL, 0);
if(SUCCEEDED(hr))
{
WCHAR wszShortcut[MAX_PATH];
#ifdef UNICODE
lstrcpyn(wszShortcut, pszShortcut, MAX_PATH);
#else
MultiByteToWideChar( CP_ACP,
0,
pszShortcut,
-1,
wszShortcut,
MAX_PATH);
#endif
hr = ppf->Save(wszShortcut, FALSE);
}
ppf->Release();
}
purl->Release();
}
CoUninitialize();
}
return hr;
}
|
|
|
|
|
I used this code But CoCreateInstance cannot create instance in my application ,
i didn't get why it fails?
|
|
|
|
|
whats value of hr? Check if you are missing something from code. Actually it should work, as i've tested it, too.
|
|
|
|
|
the value of hr is -2147467262
|
|
|
|
|
kiranin wrote: the value of hr is -2147467262
I think its for interface not supported.
Check your system matches minimum requirement for IUniformResourceLocator . Thats all I can tell, because this code is working fine for me.
|
|
|
|
|
How can i check it matches the minimum requirement or not?
|
|
|
|
|
Its there in MSDN desciption for interface.
|
|
|
|
|
My Application Cannot Create Instance for IUniformResourceLocator,
Can i know the reasons,
I went throgh the MSDN for IUniformResourceLocator, there jus very small info about thay interface....
|
|
|
|
|
Did you see Interface Information on MSDN?
|
|
|
|
|
I want to add Atl New Object to my project And according to theory it sould be present in Insert Menu But that is not present in my vc++6.0 Enter price Edition...
Can anybody help me how to get it
|
|
|
|
|
Files related to that wizard should present at path Program Files\Microsoft Visual Studio\COMMON\MSDev98\Template\ATL , if not, I think you need to repair/reinstall visual studio.
|
|
|
|
|
Hi, there,
I am thinking of developing a software with some interfaces similar to those in http://www.winpim.com/introduction.htm. Is C++ the suitable tool to do it? If not, what tool/language will be suitable?
Thank you very much!
David
|
|
|
|
|
David L.S. wrote: Is C++ the suitable tool to do it?
Suitable? Yes, quite.
I'm assuming you haven't used C++ or you wouldn't ask.
In that case learning C++ is an adventure.
Then there's MUCHO user-interface stuff to learn if you've never programmed for
Windows (or other OS).
Mark
|
|
|
|
|
Hi, Mark,
I have used C++ for some time but mainly focused on algorithm and only did a little on UI development. All I know is limited to the components provided by VC++, and I really have no idea how to develop those beatiful UI. Do I need special libraries or control components to realize the office2003 or outlook2003 style interfaces? The controls provided in VC++ is not good-looking at all.
Your advice will be greatly apprecaited!
Thank you very much!
David
|
|
|
|
|
Hi David,
I'm sure there are many 3rd-party libraries with really nice controls.
If you prefer to roll your own you can start with Windows common controls. Once you have the
basic logic working for those they can be extended to make them "pretty", including drawing all
or portions of the controls yourself (owner-drawn controls).
The controls provided in VC++ look ugly in their basic form but many have style and extended style
flags to add to the look and feel. Plus, many of the common controls (tree view, list control,
tool bars, for example) require you to provide icons, bitmaps, etc. at run time so they don't
look so nice in the designer views.
I've always wondered to what extent Microsoft uses their own common controls in their products
like Office and how much is custom controls.
Mark
|
|
|
|
|
Hi, Mark,
I will try the owner-drawn property and see what level I could reach. Thanks a lot for your info and I really appreciate your help.
David
|
|
|
|
|
Hello @
I am trying to include a hyperlink in one of the dialog box. I did went thru some samples eg. http://www.codeproject.com/miscctrl/hyperlink.asp[^]
But my problem is that the hyperlink occurs as a part of another message of DDX_Text. Is there any way I can include the hyperlink in the existing DDX_Text instead of creating a separate DDX_Control for the same?
Thanks
Jam
|
|
|
|
|
Do you really need to use DDX for a hyperlink control?
If you really need to dynamically change the text and the control doesn't support it then you
should be able to set the text some other way, via the control's interface (class).
EDIT: I may have misunderstood your question. The hyperlink control in the example (you posted
a link to) doesn't require a separate control object. Use CHyperLink instead of CStatic.
Mark
|
|
|
|
|
jamni wrote: But my problem is that the hyperlink occurs as a part of another message of DDX_Text. Is there any way I can include the hyperlink in the existing DDX_Text instead of creating a separate DDX_Control for the same?
just replace CStatic with CHyperlink Control..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Ok Thanks a ton !! CHyperlink did the trick!
Jam
|
|
|
|
|
if i want to see which edition of vc++ i am using how can i see that
|
|
|
|
|
Help/About.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
abrakadbra wrote:
if i want to see which edition of vc++ i am using how can i see that
do you need the it programmatically?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|