|
|
can u just google it first.
Величие не Бога может быть недооценена.
|
|
|
|
|
if it is a resource dialog, just set the type to bitmap and select the image in the properties window.
If it is a coded control you need to pass in the BS_BITMAP flag with the flags to CreateWindow and then send the button a message with BM_SETIMAGE and a loaded HBITMAP or HICON with preferably PostMessage otherwise SendMessage
|
|
|
|
|
You got answers last time you asked this question[^]. Did it not work? What problems did you encounter?
|
|
|
|
|
Hi, whenever i run any code of C++ in Eclipse, it says binary not found??
|
|
|
|
|
(never used eclipse, but I assume its working is somewhat standard )
1- do you compile and link the code with no error ?
2- is there some kind of setting telling where the IDE (eclipse) can find the application when you want to "run" it ?
3- can you look in the folder where the source code is if there are obj files and resulting application ?
Other than that, I've got no clue.
Watched code never compiles.
|
|
|
|
|
What binary? Do you have the C++ CDT[^] installed?
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, n it is eclipse itself i guess
|
|
|
|
|
err.... not properly.
Eclipse itself is an empty interface with some API.
The CDT (C developmenet toolkit) is a (set of) plug-in that should be installed on top of it.
But there are also eclipse-cdt bundles (hence you're possible terminology confusion)
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hello,
is there any other function to rename folder as _wrename(old_name, new_name);
Thanks for any help
Arrin!
|
|
|
|
|
ShFileOperation (or IFileOperation ) is your friend.
look at the documentation on MSDN.
Watched code never compiles.
|
|
|
|
|
Hi,
thanx for answer!
Arrin!
|
|
|
|
|
Hi,
i forgot to say that this is a directory in a LAN?
In this case, do i have to do the same, to use same function SHFileOperation for network operations???
When i tray to do this, i receive an error like this "Invalid File path"??
Thanks
Arrin
|
|
|
|
|
Beware to string escapes: LAN names like \\server\share\dir\file.ext should be "\\\\server\\share\\dir\\file.ext".
It is one of the most common errors.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hi,
thanks for answer, is that ah way to resolve a network drive to this LAN name?
My Letter is this one P on network, "P:\project\projectname.pf" how to resolve this name to "\\server\project\"??? Is there any solution for this??
I select this folder over an File Dialog, and they give me this path back, but how to convert him to this LAN name!
Thanks for any help!
Arrin
|
|
|
|
|
Hi,
when i try to use ShFileOperation i receive a error like "Folder is open by another application"???
My only problem that this dont work on LAN, over LAN!
In a local drive its all ok!
Arrin
|
|
|
|
|
An alternative to SHFileOperation is using MoveFile[^] or MoveFileEx[^] APIs. These functions can rename either a file or a directory.
|
|
|
|
|
Hi,
thanx for answer!
Arrin!
|
|
|
|
|
Try
MoveFile(LPCTSTR currentNameOfFolder,LPCTSTR newNameOfFolder);
Example:
MoveFile(_T("D:\\TestFolder\\RenameMe"),_T("D:\\TestFolder\\MyNewName"));
|
|
|
|
|
i am creating a function IsFolderExists(LPTSTR str)
str = "C:\New Folder"; //It Fails to get the Window Folder
but when i
str = "C:\\New Folder"; //It gets the Windows Folder
am i doing wrong, or \\ is required. If required then how to build a path
Example : C:\New Folder into C:\\New Folder. Help.....
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
IsFolderExists(lpCmdLine)
return TRUE;
}
void IsFolderExists(LPTSTR str)
{
WIN32_FIND_DATA wfd;
HANDLE hFile;
hFile = FindFirstFile(str,&wfd);
if ( hFile != INVALID_HANDLE_VALUE )
{
if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!=0)
MessageBox(NULL,_T("Is Directory"),_T(""),MB_OK);
else
MessageBox(NULL,_T("Is File"),_T(""),MB_OK);
}
else
{
MessageBox(NULL,_T("Neither File or Folder"),_T(""),MB_OK);
}
}
When i drag a folder [ NewFolder] on myapp.exe it works but
when i drag a folder having space [ New Folder ] it doesn't work.
please help...
Some Day I Will Prove MySelf :: GOLD
modified on Saturday, January 22, 2011 12:42 AM
|
|
|
|
|
The "\" is known as the (or one of?) "escape" character.
that means that if you want to put a tab, for example in a string you would put "\t" to indicate a tablature; that means that the string will look at the "\" and the next character after that and see a "t" and will understand it as a "tablature" (same thing for quotes and double quotes)
so, in general, when a string (CString) encounters a "\" in a string it will check the next character and see if it means something.
the question is how can I put a literal "\" in string without being recognize as an escape character ?
the anwser is to double the "\" ...
str = "C:\\Windows";
When hard-coding paths in string one should always put "\\", but, for example, if you have a UI with an edit box to type in the path, you don't need to use the "\\" you can just use the "\".
Watched code never compiles.
|
|
|
|
|
Of course '\' is the only C/C++ escape character for literal strings.
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]
|
|
|
|
|
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
IsFolderExists(lpCmdLine)
return TRUE;
}
void IsFolderExists(LPTSTR str)
{
WIN32_FIND_DATA wfd;
HANDLE hFile;
hFile = FindFirstFile(str,&wfd);
if ( hFile != INVALID_HANDLE_VALUE )
{
if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!=0)
MessageBox(NULL,_T("Is Directory"),_T(""),MB_OK);
else
MessageBox(NULL,_T("Is File"),_T(""),MB_OK);
}
else
{
MessageBox(NULL,_T("Neither File or Folder"),_T(""),MB_OK);
}
}
When i pass the Folder name from command line like,
myapp.exe C:\Windows -result is neither file or folder but when used as
myapp.exe C:\\Windows -result is Is Directory.
How to solve this. Help.
Some Day I Will Prove MySelf :: GOLD
|
|
|
|
|
You should also print out the contents of wfd.cFileName to see exactly which file or directory you are displaying attributes for.
I must get a clever new signature for 2011.
|
|
|
|
|
how can I put a literal "\" in
string without being recognize as an escape
character ?
the anwser is to double the "\" ...
s t r = " C : \ \ W i n d o w s " ;
i agree with you. But i want to do it programatically. I want to replace \ with ''\\''. Please help
Some Day I Will Prove MySelf :: GOLD
|
|
|
|