|
Hi,
I am creating a shell namespace extension to show FTP files. I implemented cut / copy and paste using CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTOR. I implemented IDataObject and IStream for this. After copying, when I choose to paste the files, I am getting all the files, But the problem is that, the directory structure is not retained.
If I am copying a folder say "Test", which contains 2 files
1. a.txt
2. b.txt
When I choose paste, I am getting 2 files ( a.txt and b.txt ) and a folder ( Test ) in the same place. In fact it should have been folder "Test" and the two files inside "Test". But that is not happening.
I believe I am missing something here...
Could somebody please help me in resolving this.
Thanks and Kind Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi,
My project uses a telephony hardware which comes with its own initializing software. Each time i run my app, i've to run the said s/w for initializing the h/w. So, i think it'll be better if my app itself runs it on startup. I've lookd up the MSDN and ended up on Createprocess( ). I burnd my head a lot, but its not workin, probably, the parameters i passd r incorrect.. plz help me out.
thanks,
-- ano
-- modified at 0:38 Friday 25th November, 2005
|
|
|
|
|
Hi,
Use ShellExecuteEx
Bye
Cool Ju
Dream Ur Destiny
|
|
|
|
|
hi
you can use create process as follows.
suppose app u want to run is saved on c: and its name is app.exe
then u can try this
STARTUPINFO si={0};
PROCESS_INFORMATION pi={0};
if(!CreateProcess(NULL,"c:\\app.exe",NULL,NULL,FALSE,CREATE_NEW_CONSOLE,NULL, NULL,&si,&pi))
{
printf("\nError in creating the process");
}
else
printf("\nBe happy");
sanket patel
|
|
|
|
|
Hi
Does anyone know how to get IShellBrowser interface of a open file dialog in Ms-office applications . I set up a hook and handle the message WM_GETISHELLBROWSER . But i dont know the lparam and wParam values of the message . Can anyone Please help me in this regard
|
|
|
|
|
|
The second parameter can be used as a string. It is an LPVOID, so you can easily pass a char* pointer there.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
|
Kixdemp wrote: How can I read the contents of a file? I got the ReadFile() function, but none of it's parameters is a string! Does anyone know?
if it normal text file... better use CStdioFile class
"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
|
|
|
|
|
|
I use the CreateProcess() in VC.At frist, I defined a CString to get the filepath and filename.for example :
CString SelectedFile;
CFileDialog FileDialogBox(TRUE,NULL,"*.dxf",OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,szFileFilter,this);
if(FileDialogBox.DoModal()==IDOK)
{
SelectedFile=FileDialogBox.GetPathName();
}
Then in the CreateProcess() ,I want to run another programmer called "draw.exe".
My question is ,how the CreateProcess() get the value of SelectedFile when run the "draw.exe".
My purpuse is specifying the filepath and filename fristly ,and runing the "draw.exe" to load it.
Thank you
|
|
|
|
|
Pass SelectedFile as the second parameter.
CreateFile("draw.exe", SelectedFile, ...);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thank you for your help.
I have worked it out.The second parameter shuould turn to the (LPSTR)type. So it may be (LPSTR)(LPCTSTR)SelectedFile.
Thank you.
|
|
|
|
|
Hello everyone!
OK, I finally tried the VC++ 2003 Everett I had in my closet and it worked!
I want to make a program now, but it requires code generation... I know how to do the code, but how do I compile it? In C# we used the CodeDom class if I remember correctly and it compiled it for us, but how do I do it in MFC? Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
You can't. Any machine that runs .NET has a compiler in the framework. That is not true of C++, which compiles to native code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
It just plain does not work that way. You could try to use gcc if you're compiling standard C++, but I'd say that your best option is to use C++/CLI and then use .NET to generate code on the fly.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
My overall opinion is that you're screwed here. I have no idea what GCC files you need, and once you have them, they will create an exe that you can run. You're not going to be able to compile code within the process that you're running.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
How many characters can a CEdit Control can obtain. In my App if I keep store data into CEdit, Cedit won't display data after a certain amount of time.
Thanks
|
|
|
|
|
Hi
Because the usage of DDX conversion to CString the edit box has the same limitations.
I have read somewhere that this would be around 30.000 byte in VC6.0 . I'm not 100% certain if this is true or if this limitation still stands in VC7.1 or VC8.0
You could probably load more data into an window without the usage of DDX functions or CString values.
codito ergo sum
|
|
|
|
|
Thank you for you replay. How could I use a CEdit control without DDX?
I use
m_pEdit->SetSel( -1, -1 ); // curser to text end
m_pEdit->Replace( strAddedText );
It displays for a while, then stucked.
Any solution?
|
|
|
|
|
Hi,
you've got to do it the hard way, dont use CString use a char buffer to access the edit box.
But char buffers are a very hard way to deal with strings so it would be better to use the std::string class. (this requires #include <string>
You will need to get the text from the control then append your extra data and next send the text back to the control. To simplefy this I wrote 2 wrapper funtions SetText and GetText . This gives the following code:
std::string CMyDlg::GetText(UINT uiControl)
{
CWnd* pWnd = GetDlgItem(uiControl);
if(pWnd)
{
std::string sTemp;
int iLen = pWnd->GetWindowTextLength();
char* pBuffer = new char[iLen+1];
pWnd->GetWindowText(pBuffer, iLen+1);
sTemp.assign(pBuffer, iLen);
delete pBuffer;
return sTemp;
}
return "";
}
void CMyDlg::SetText(UINT uiControl, std::string sText)
{
CWnd* pWnd = GetDlgItem(uiControl);
if(pWnd)
{
pWnd->SetWindowText(sText.data());
}
}
void CMyDlg::AddText(std::string sAdd)
{
std::string sText = GetText(IDC_MY_EDIT);
sText += sAdd;
SetText(IDC_MY_EDIT, sText);
}
This should work ...
codito ergo sum
|
|
|
|
|
Thank you for your reply. but I figured out a easy way, CEdit class member function SetLimitText(xxxx); set to -1 is maximum. It works fine. by default, it stops when getting 30000 bytes.
Good Luck
|
|
|
|