|
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
|
|
|
|
|
Hi Experts,
I am trying to move a DLL build in C++ from my desktop to Pocket PC
applications.
I build a new project in VS2005 C++, for "Smart Device", "MFC Smart Device
DLL", choose Pocket PC. And I copied all the source files (.h and .c .cpp) to
this new project. I have the error when i tried to compile it:
Error 1 fatal error C1083: Cannot open include file: 'mbctype.h': No such
file or directory C:\Program Files\Microsoft Visual Studio
8\VC\ce\atlmfc\include\afxv_w32.h 227
The DLL built for desktop application works fine (using VS2003). I checked
the Project properties, and found that in VS2003, i set "Use Managed
Extensions" to "No" under "configuration properties", but there is no such
setting options in VS2005.
Could you please tell me how i can solve this problem?
Thanks a lot!
Vicvic
Thanks!
vic
|
|
|
|
|
Use Unicode Character Set
HOHOHOHOO
|
|
|
|
|
Binary presentation of data
Hi all;
We all know that data stored in PC in binary code 1 or 0 ;
I need to know how we can to get binary code of file or
any thing
Thanks;
AMR-CIS
|
|
|
|
|
please be more precise... you need to get what exactly, and what for ?
is it for a display purpose ?
as you said : "We all know that data stored in PC in binary code 1 or 0" so why would you need to convert into binary, as whatever you manipulate so is already in that way in memory ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well, to read binary from a file, use fopen to open a file, and fread to read unformated data from the file.
for the "any thing", you will need to be more precise in your question.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Can someone point me in the right direction for doing my first ActiveX control in Visual Studio .Net (MFC C++).
I have a MFC application that uses the USB joystick port, but would now like to convert it to an ActiveX.
Many thanks,
|
|
|
|
|
Hi all,
Iam working with a ListControl whose parent is a dialog. In the cell (1,1),I want to place a tree control which on doubleclicking should open up(ie: the width & height of this tree control exceeds the dialog boundary).
Will move the treecontrol & place it over the cell(1,1) position.
Now If I fix & width & I height of my treecontrol,I want the same size to be displayed,even if the parent dialog is smaller.
ie: If the childControl size is bigger than,the parentcontrol size ,it should overflow the parentcontrol boundary.(like if we click on a comboBox).
How can I achive this behaviour.
Any ideas
Thanks..
|
|
|
|
|
The dropdown listbox from a combobox is actually created as a top level window, a child of the desktop, and it is moved into place and shown when needed. You could do the same with your tree control.
"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!
|
|
|
|
|
>>The dropdown listbox from a combobox is >>actually created as a top level window, >>a child of the desktop, and it is moved >>into place and shown when needed.
How could I do this?.would you be able to explain it by a piece of code...
|
|
|
|
|
Hi,
I did as follows in that order & I get the child control to exceed the parent window.
childControl.SetParent(GetDesktopWindow());
childControl.ShowWindow(true);
childControl.BringWindowToTop();
childControl.SetFocus();
childControl.MoveWindow(500,300,400,200);
But now the problem is ,I don't get the childControl as an activeWindow(Can't select,edit anything etc).
Thanks..
|
|
|
|