|
kevinalphaxz wrote: I want to have many friends
That's not a question!
|
|
|
|
|
if i try to include fstream.h and vector.h like this
#include <fstream.h>
#include <vector.h>
some error occured, what should i do?
|
|
|
|
|
The standard library include files don't end in ".h". Use #include <vector> instead, for example.
Steve
|
|
|
|
|
Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ????
Sorry My bad Steve ... are you talking about the vector header file??? If you are ... my bad.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Could you be more specific about the error that occurs? Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ????
Steve is right, you shouldn't use .h with the standard C++ Library. Older compilers may ship with both fstream.h and fstream, but VS05 does not.
Before C++ got standardized, C++ headers files were still like C headers, with .h extension. But the standard C++ put all those header files under std namespace, so they rename all of them without .h extension.
|
|
|
|
|
Like I said .... " My bad " ....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Cause, I don't agree with Steve about the .h .... I mean I use it all the time and it work ????
Then you don't have VS2005. The standard headers do not have .h, and the non standard headers are finally gone in VS2005.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If we hav URL how to create Inernet shortcut link to that URL programatically?
|
|
|
|
|
, Can you explain in detail ?
|
|
|
|
|
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
|
|
|
|