|
DavidCrow wrote: Sure there is.
Well sort of.
HiEverybody, use the "Class View" and select the class and then use the "Properties" window.
|
|
|
|
|
Thanks , I finally solve my issue with your help !
|
|
|
|
|
Hi everybody,
i like to redirect the Output of a process ( Console ) to my "Server".
During i create the ChildProcess, i set the STARTUP_INFO's Output,Input and Error Handler
to my own Handler and set the Flags to STARF_USESTDHANDLER.
CreateProcess() is called with the parameters to open a new console window and BOOL bInheritHandles is also set to TRUE.
If the process is created, CreateProcess() return TRUE, but the application dies directly.
( Verified in the TaskManager )
Does CreateProcess and CREATE_NEW_CONSOLE in a Console-Project make trouble?
Or why won't it work ?
Big thanks for help
|
|
|
|
|
|
Hi, thanks for your reply
I tested the program with a Microsoft-Example and i see the (propably) error :
PDCurses retrieves the number of columns and rows of the console window and gets 1x1
which is too small
PDCurses gets this informations with a getenv("LINES");
Propably LINES and COLS are environment variables, especially for consoles.
And with a redirected output it's not calculated.
I tested already to set the LINES and COLS by setting the STARTUP_INFORMATION
dwXSize and dwYSize to values over 200 pixels
No effect
|
|
|
|
|
baerten wrote: PDCurses
Sorry I dont have any idea about the PDCurses. if LINES and COLS are environmental varibles you guss, just confirm it with the some utility like process explorer.
|
|
|
|
|
I have created an MFC application with doc/view support, SDI having editview window.
I want to know what is the position (Co-ordinate) of the cursor every time the position of the cursor is changed.
How to achieve this?
Thanks and regards.
|
|
|
|
|
Hi,
handle the ON_MOUSEMOVE Message. Then you get the coordination of the mouse by
creating a COORD and assign it to the LPARAM ( if not the WPARAM )
CPoint point(LOWORD(lParam),HIWORD(lParam));
There are seriously syntax error in my example ( i'm not on a developer maschine )
but it works
|
|
|
|
|
Sorry, but I am not talking about Mouse Cursor Position.
I meant to retrieve the coordinates of the selected text
initial and final.
|
|
|
|
|
GetEditCtrl().GetSel()
Or maybe you will have to catch some notifications, like EN_CHANGE .
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
I am telling again, I want Co-Ordinates not the index of the cursor.
I mean to say that X and Y distance in PIXEL from the top left corner from the view window for the current scroll position.
Apology if I could not communicate properly earlier.
|
|
|
|
|
Use the EM_GETSEL , EM_LINEFROMCHAR , and EM_LINEINDEX messages.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry, but none of the above returns the Co-Ordinates.
I want the coordinates not the index of the cursor.
Is there any function or property which returns the X and Y distance of the cursor from top-left corner of the view window?
|
|
|
|
|
Anurag Gandhi wrote: I want the coordinates not the index of the cursor.
And the distinction is? What I suggested to you would provide you with the row/column of the cursor.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
very sorry if you have been miscommunicated.
row/column number doesnot mean the distance in pixel.
Thanks anyway.
|
|
|
|
|
Anurag Gandhi wrote: ...distance in pixel.
It would help if you conveyed ALL the information in your OP rather than drag it out needlessly.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Anurag Gandhi wrote: I want the coordinates not the index of the cursor.
if you have the index call the PosFromChar() function to get the coordinates.
|
|
|
|
|
If you want to get mouse cursor position then you have to add WM_MOUSEMOVE message handler to your view class.
then you will get a function like following..
void ClassView::OnMouseMove(UINT nFlags, CPoint point)
{
// Act with the point
}
///////////////////////////////////////////////////////////////
if you want to get key cursor position then you can use following........
POINT pt;
GetCursorPos(&pt);
//// See details in MSDN /////////////
|
|
|
|
|
Md. Ali Naser Khan wrote: If you want to get mouse cursor position...
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I believe you meant the caret, not the cursor.
Maybe try GetCaretPos()?
Mark
<ph:data>
Last modified: 46mins after originally posted --
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm new in MFC.
How to dynammically change control size in CFormView?
I do this:
void CSalesmanView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
CTabCtrl * tab = (CTabCtrl *)this->GetDlgItem(IDC_TABMAIN);
if (tab != NULL)
{
tab->SetWindowPos(this,0,0,cx,cy,nType);
}
}
But nothing is happening;
Thanks.
-- modified at 9:08 Friday 7th September, 2007
|
|
|
|
|
SOLVED:
tab->MoveWindow(0,0,cx,cy);
|
|
|
|
|
Mine is a unicode application.I have some part of the code like,
WCHAR wsz [MAX_PATH]; // buffer for Unicode string
// Ensure that the string consists of ANSI characters.
MultiByteToWideChar (CP_ACP, 0, pszLinkFile, -1, wsz, MAX_PATH);//pszLinkFile is a variable of type LPCTSTR.
I got an error as following,
error C2664: 'MultiByteToWideChar' : cannot convert parameter 3 from 'const unsigned short *' to 'const char *'
Please help me out in this.
-- modified at 8:23 Friday 7th September, 2007
|
|
|
|
|
revanth1985 wrote: pszLinkFile is a variable of type LPCTSTR.
That is the problem: LPCTSTR type depends if UNICODE has been defined or not. If it has been defined, then it will be a unicode string otherwise a standard char array. So, in your case UNICODE is probably defined, which means you are trying to convert a string which is already a UNICODE to a UNICODE string.
|
|
|
|
|