|
I would try it to do it this way:
1) When clicking the left button, create a temporary CBitmap object, compatible with a memory DC. Using this memory DC, draw the wanted area on the CBitmap.
2) When moving the mouse
a) If the CBitmap was previously drawn, draw the CBitmap in its old position using a XOR mode (that is clearing the previous drawing)
b) draw the CBitmap in its new position in XOR mode
3) When releasing the left button: clearing the drawing of the CBitmap object in its old position ( = drawing in XOR mode), update the data, delete the temporary CBitmap object, redraw the window.
Fold With Us!
Sie wollen mein Herz am rechten Fleck
Doch seh ich dann nach unten weg
Da schlägt es links
|
|
|
|
|
Whell, i'll try to explain what really i want:
I got to two OXY scales, (two dimensions). So One OXY, and another O'X'Y'. The first is local coordinate system and the second is real (global) coordinate system. I Got three equivalent points in that systems. So how to get know the position on the area, using this three point, and create projection to the real( global) coordinate system? I hope i explained it corectly. In other words i got the GPS,and the Map in Local coordinate systems, and i want to translate the data from gps, to set the point on the map correctly.... Ufff, i have to learn english better....
Please Help...
|
|
|
|
|
|
I had a similar problem a couple of years ago.
I ended up learing a lot of matrix & vector maths I'd forgotten about years previously.
But that was transforming points from one coordinate system to another, with O'X' and O'Y'
not necessarily orthogonal (at 90<super>o).
But if your coordinate systems are parallel, and you want to go from one system to another...
Transforming point P...
P1 = P - O
P1.x /= (OX).x
P1.y /= (OX).y
P2.x *= (O'X').x
P2.y *= (O'X').y
P' = P2 + O'
I ended up with my own matrix & vector classes, with a function that took 3 coords in one
system (O,X,Y), 3 in the next (O',X',Y') and produced a matrix to transform between them:
M = dxfMatrix::Warp(A,B,C, A',B',C')
P' = MP
But its not publishable! Maybe this counts as teasing...
If you need any specific help, let me know.
Iain.
|
|
|
|
|
Hello, I think you understand me right Thanks "that was transforming points from one coordinate system to another, with O'X' and O'Y'
not necessarily orthogonal (at 90o)" - That's exactly what i need!!!
The transforming point from one system to another, with three or more controll points. Where can i find the formulas or something,or open source or any information
|
|
|
|
|
Rassul Yunussov wrote:
Where can i find the formulas or something,or open source or any information
Well, I had to struggle a lot, against a lack of information. I can't email you the
code, as it is too entangled in commercial stuff & confidential. Sounds like an
article needing to be written!
If you want a head start, I would go start learning about matrices again...
Eigen Vectors[^].
Iain.
|
|
|
|
|
Hi:
if I have defined a push button as an Icon is there any way to show an info prompt when I put the mouse over this button?
Thanks.
|
|
|
|
|
|
|
Hi,
OS:Win2000
using VC++ .NET 2003
I have some sample code (from msdn) to read and write to the serial port. The code works perfectly when I put it into a console program. However, when I put excactly the same code into an Windows Form Application the program "hangs" at the reading routines. Do other reading routines apply to Windows Forms Applications? I simply can´t understand why it doesn´t work...
BYTE Byte;<br />
DWORD dwBytesTransferred;<br />
<br />
SetCommMask (hPort, EV_RXCHAR | EV_CTS | EV_DSR | EV_RLSD | EV_RING);<br />
<br />
while (hPort != INVALID_HANDLE_VALUE) <br />
{<br />
WaitCommEvent (hPort, &dwCommModemStatus, 0);<br />
<br />
SetCommMask (hPort, EV_RXCHAR | EV_CTS | EV_DSR | EV_RING);<br />
<br />
if (dwCommModemStatus & EV_RXCHAR) <br />
{<br />
do <br />
{<br />
ReadFile (hPort, &Byte, 1, &dwBytesTransferred, 0);<br />
<br />
if (dwBytesTransferred == 1)<br />
this->label1->Text = S"string";<br />
<br />
} while (dwBytesTransferred == 1);<br />
}
|
|
|
|
|
Your main thread is blocking on the WaitCommEvent.
Typically, code like this would be placed into a separate tread where it would not interfere with the processing of other information, such as mouse movements, painting, keyboard events, etc.
|
|
|
|
|
i already stored the name of the active window processes inside a listbox..how do i get to select and show the process that was selected?
about C++ and MFC
|
|
|
|
|
Hi,
Did you mean how to select Items from the list box?
Use CListBox::GetSel function to select the current item in the list box. If you want get all the item selected from list box, you get the total number of counts use GetCount function and check all the items is whether select or not
Regards
Selvam
|
|
|
|
|
nope..what i meant is that after selecting the particular name in the listbox, i would like open the corresponding application that coincides with the name...
i used enumwin() to get the running application process and store its name to the listbox...but how can i show the window that corresponds to the application name selected?
about C++ and MFC
|
|
|
|
|
While Enumeration of Window Store the Name of Window along with corresponding HWND or HANDLE.
when User select the Window to close just search the your local array for handle and send Close Message.
Hope you understand this
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks!but can i have a sample code of the array...here's how i stored the values
::enumwndfn(CWnd * wnd)
{CString s;
wnd->GetWindowText(s);
m_TaskList.AddString(s);
}
Bool CALLBACK CDlg::enumwndfn(HWND hWnd, LPARAM lParam)
{
CDlg* me = (CDlg *)lParam;
return me->enumwndfn(CWnd::FromHandle(hWnd));
}
called by : EnumWindows(enumwndfn, (LPARAM)this);
Thanks!
about C++ and MFC
|
|
|
|
|
Do this thing
I think you m_TaskList is type CStringArray change it to CPtrArray.
and Create a Struct
struct MyArry
{
CString WindowName;
CWnd Wnd;
};
and Instead
spiced wrote:
::enumwndfn(CWnd * wnd)
{CString s;
wnd->GetWindowText(s);
m_TaskList.AddString(s);
}
use this thing
::enumwndfn(CWnd * wnd)
{
CString s;
wnd->GetWindowText(s);
MyArry tmp;
tmp.WindowName=s;
tmp.Wnd=*wnd;
m_TaskList.add(tmp);
}
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
I developed an application in VC++, and it is crashing in the release mode.I enabled Debbuging in the release mode, and I hv attached the dump of my Call Stack.
I dont know, why CWinApp object is NULL.Can anybody pl. help me in solving this...
TBMS3! __sbh_free_block + 369 bytes
TBMS3! free + 35 bytes
operator delete(void * 0x0145c030) line 349 + 9 bytes
CPlex::FreeDataChain(CPlex * const 0x00000000) line 45 + 6 bytes
CMapPtrToPtr::RemoveAll(CMapPtrToPtr * const 0x00000000 {CMapPtrToPtr}) line 94
CHandleMap::DeleteTemp(CHandleMap * const 0x00000000) line 239 + 8 bytes
AfxUnlockTempMaps(int 1) line 50
CWinThread::OnIdle(CWinThread * const 0x00000000 {CWinThread h=??? proc=???}, long 5120804) line 591
CWinApp::OnIdle(CWinApp * const 0x00000000 {CWinApp ???}, long) line 494
Also, earlier it was giving errors related to vector destructor iterator.
Wherever I used delete [] ptr, the application was failing. Even though I am not using delete [] from within my code, the MFC framework is using that a lot. Is there any way by which I can force the compiler to include vector destructor, and scalar destructor.
I am working in VC++ 6.0
--Rgds--
|
|
|
|
|
|
Hello everybody!
First of all, thanks for your answer Blake Miller!!!
I didn´t explain the situation correctly.
I mixed up with the example!!
I´ll try to explain it correctly...
I´m using CreateProcess to create a new process, with the
CREATE_NEW_PROCESS_GROUP flag set in the argument "dwCreationFlags",
to create a new process group.
Let´s suppose that PROCESS_A creates a new process,
with CREATE_NEW_PROCESS_GROUP flag set. This new created
process (PROCESS_B) is the 1º process of the process group.
It´s true that both the 1º process of a process group and
the process group itself have the same ID. So the ID of
the process group and the PID of PROCESS_B are the same.
If the PROCESS_B creates a new process (PROCESS_C) with
CREATE_NEW_PROCESS_GROUP flag cleared, both PROCESS_B
and PROCESS_C will belong to the same group.
PROCESS_B knows the ID of its process group, as it´s
its own PID. But...
-How can PROCESS_C get the process group ID?
(without using IPC or passing it through command line
arguments)
-Is there any function which returns the process group ID
of the calling process?
Summing up...
I only what to know how to get the ID of the process
group, to which a process belongs.
Thanks and bye.
|
|
|
|
|
Hi all:
How can I get specific folder's sector position?
|
|
|
|
|
|
Thanks!But I'm not familiar with ASM, Is there any other language can implement that (c\c++)
|
|
|
|
|
Hi,
You may use ASPI or SPTI to read CD sector.
Scan TOC to locate specific folder descriptor ( see ISO 9660 ).
To send ASPI command you may use "SendASPI32Command" function from winaspi.dll, or use DeviceIOControl to send SPTI command.
Regards,
Slava.
|
|
|
|
|
void MyDialog::m_SetFont( )
{
if(0 == strcmp(g_szCurrLang, "English"))
{
m_stfontObj= (HFONT)GetFont();
}
else
{
/* curFont+=*g_szCurrLang;
curFont+=*g_szCurrKbd;*/
curFont+="UrduPhonetic";//name of the phont
}
if(m_stfontObj!=NULL)// || (0 == strcmp(g_szCurrLang, "English")))
{
}
else
{
CString strName_Font;
strName_Font=" "+curFont;//TO CONCATENATE THE Font name with the format
m_stfontObj = CreateFont(-40, 0, 0, 0, FW_DONTCARE,
FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE, LPCTSTR(curFont)); //strName_Font
CFont* my_pCurFont = CFont::FromHandle(m_stfontObj);
this->SetFont(my_pCurFont,TRUE);
CFont * my_fetchedfont =this->GetFont();
}
}
this is my fuction to get the font by name UrduPhonetic and then want to display the characters on the buttons with the font
and in my button class
i am writing as
void MybutCls::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
short b_caps=GetKeyState(VK_Caps);
short b_shift=0;//GetKeyState(16);
MyDialog *puclmydialogRef=NULL;
puclmydialogRef=(MyDialog*)GetParent();
SelectObject( lpDrawItemStruct->hDC,(((MyDialog*)GetParent())->GetFont())->m_hObject);//set the font handler to drawitem handler
//draws a frame control of the specified type and style.
::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem,DFC_BUTTON,DFCS_BUTTONPUSH|BS_DEFPUSHBUTTON);
if((0x8000 ==(0x8000 & GetKeyState(16))&& !b_caps))//||(0x8000 !=(0x8000 & GetKeyState(16))&& caps))
{
if(lpDrawItemStruct->CtlID==IDC_BUTTON49)
::DrawText(lpDrawItemStruct->hDC,"!",1,&lpDrawItemStruct->rcItem,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
if(lpDrawItemStruct->CtlID==IDC_BUTTON45)
::DrawText(lpDrawItemStruct->hDC,"_",1,&lpDrawItemStruct->rcItem,DT_SINGLELINE|DT_VCENTER|DT_CENTER);
}
but its not displaying the symbol from the obtained font on my ownerdraw buttons but its jst displaying thestring which i give in the "" such as "!"
can any one help me
Its very urgent
|
|
|
|
|