|
Geez !! You stay with your idea even if thousands of people already told you that sharing a CDC or CWindowDC is a very bad idea. A DC is relative to the context in which it is used, so, you cannot just send it to another computer and use it there. It is a really really bad design idea.
Explain your problem (not what you think that it may be a solution): what do you want to do exactly by sending this CWindowDC. You told me already it was for sharing pictures. But that's crazy ! In that case why not just send the file in which the picture is, this is far more elegant (and less complicated).
|
|
|
|
|
but I think it is a good way to make a remote desktop...
I don't like sending pictures.
If there is any better way that is FAST without sending files. please tell me.
I looked at VNC source files too, but that way is so slow too.
I am confused...
Please help me...I'm not standing on my Idea...
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
You can not, I repeat CAN NOT share a DC across a thread boundry, process boundry, and heaven forbid, machine boundry.
VNC works by communicating bitmaps, Remote Desktop shares data at a much lower level, but writing your own would proably require many man-years worth of work. I suggest you stick with VNC as it is as much an industry standard as you'll likely to get.
|
|
|
|
|
I want to draw a virtual v-bar and virtual h-bar when dialog sizing,and resize its all control when mouse up,How to implement? I want to avoid flicking when changing dialog size because of too many control changing size and position.
My dialog is made up three child dialog,and all controls are on child dialog. So I want to redraw all controls only when releasing left mouse button. How to implement?
Can any one provide me with sample code or links?
Thank in anvance.
-- modified at 5:15 Tuesday 4th April, 2006
|
|
|
|
|
chybin wrote: I want to avoid flicking when changing dialog size because of too many control changing size.
Have you tried SetRedraw . Another option to avoid flickering of child controls is to set WS_CLIPCHILDREN and WS_CLIPSIBLINGS on.
Nibu thomas
Software Developer
|
|
|
|
|
|
if both have been tried and you still get flickering, then there must be something you are doing wrong??
piece of code:
SetRedraw (FALSE);
SetRedraw (TRUE);
RedrawWindow (NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE | RDW_ALLCHILDREN);
GetDesktopWindow ()->RedrawWindow (rectOld, NULL, RDW_INVALIDATE | RDW_UPDATENOW |
RDW_ERASE | RDW_ALLCHILDREN);
hope this helps
add on:
if your dialog contains 3 child dialog, try to set the flags (clip children & siblings) on each dialog....
Ask not what your application can do for you,
Ask what you can do for your application
-- modified at 10:28 Tuesday 4th April, 2006
|
|
|
|
|
Hi,
How do u make use of record sets.I've seen the links but its too complicated for my simple application.
According to my application,I just have to display the database i.e MSACCESS with edit boxes.No updations nothing.Its a dialog based application with modal dialog boxes.
What are the functions that I need to use for this ie displaying the data in modal dialogboxes.
Can anyone help me in this
bye
swapna_signsin
|
|
|
|
|
Suppose in ur DB a table is there as
Swapna(name varchar(20), addr varchar(20), telno double);
open recordset as
CRecordset rs(yourDbPntr);
//change following query according to ur requirement
bool bsuccess = rs.open(opentype, _T("SELECt * FROM Swapna"), options);
if (!bSuccess)
return;
int nRecCnt = rs.GetRecordCount();
int i=0;
cString strValue;
while (i != nRecCnt)
{
rs.GetFieldValue(i, strValue);
//Write ur code here
//ex: editBox.SetWindowText(strValue)
}
Good Luck
|
|
|
|
|
hi,
Thankyou for u'r response,but Imake use of MSACCESS Database.So does this work with that
bye
|
|
|
|
|
Hi,
Thanks for u'r response, but I make use of MSACCESS Database,so does this code work then.
bye
swapna_signsin
|
|
|
|
|
r u connected with ur DB if yes then this should work
|
|
|
|
|
Still STUCKED into same problem???
|
|
|
|
|
HI,
Iam actually very confused as to how to proceed.
|
|
|
|
|
tell me one thing have u successfully got connected with ur DB
(whatever ACCESS or something else) have u gone thru the link which i gv u
about connection strings, If u r connected with ur DB then whats the problem??
try what i told u before to get the value from record set
& use setwindowtext method.
I think unneccessarily u r getting confused.
who told u that if ur application is dialog based u can't connect to DB.
|
|
|
|
|
CADODatabase Eror
Code=80004005
Code meaning=Unspecified error
Source=Microsoft OLE DB Provider for IDBC Drivers
Description =[MYSQL][ODBC 3.51 Driver]Can't connect to MySQL server on '61.247.251.95'(10060)
I got this error while i connect database from remote system ?
can any one please help me?
my database connection string
_T("Driver={MySQL ODBC 3.51 Driver};Server=61.247.251.95;Port=3306;Database=ist_encoder;User=root;Password=isakura;Option=4");
Where did i gone wrong?
JAYARAJ
|
|
|
|
|
is your database remote one?
if yes, did you add your PC's IP address to the database from host?
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
how to add your PC's IP address to the database from host?
please help me .
JAYARAJ
|
|
|
|
|
is the website (which contains the mysql database) yours?
if yes, go to cpanel, then you can see "add IP address" somewhere, or contact your server for help.
if not, you have to ask owner of the site to do that for you.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|
|
I am using VC++/MFC .
I am checking the remote database connection in LAN.
JAYARAJ
|
|
|
|
|
Hi all,
This is the code, I've written in my Button class:
void CMyButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
CDC dc;<br />
dc.Attach(lpDrawItemStruct->hDC);<br />
CRect rt;<br />
rt = lpDrawItemStruct->rcItem;<br />
<br />
UINT state = lpDrawItemStruct->itemState; <br />
if ( (state & ODS_SELECTED) )<br />
dc.DrawEdge(rt,EDGE_SUNKEN,BF_RECT);<br />
else<br />
dc.DrawEdge(rt,EDGE_RAISED,BF_RECT);<br />
<br />
dc.SetTextColor(m_colText);<br />
<br />
CString strTemp;<br />
GetWindowText(strTemp);<br />
<br />
dc.DrawText<br />
(strTemp,rt,DT_CENTER|DT_VCENTER|DT_SINGLELINE);<br />
<br />
if ( (state & ODS_FOCUS ) )<br />
{<br />
int iChange = 3;<br />
rt.top += iChange;<br />
rt.left += iChange;<br />
rt.right -= iChange;<br />
rt.bottom -= iChange;<br />
dc.DrawFocusRect(rt);<br />
}<br />
dc.Detach();<br />
}
The focus rectangle is still there even it is lost the focus. How should I handle this ?
IMPORTANT
**********
If you could see my previous post, titled "MDI and ResizeParentToFit()", and give your thoughts, it would be more helpful.
It is here:
http://www.codeproject.com/script/comments/forums.asp?msg=1433452&forumid=1647&mode=all&userid=2355322#xx1433452xx[^]
Thanks in advance,
Saravanan AR
|
|
|
|
|
|
Hi Sarvan AL
Whats (m_colText)?
antway your code worked.It draw a yellow color
|
|
|
|
|
Hi inculdeh10 & WhiteSky,
I missed the the following code. Thats why I got the focus rectangle always.
dc.FillSolidRect(rt, GetSysColor(COLOR_BTNFACE));
Thanks a Lot,
Sarvan AL
-- modified at 4:02 Tuesday 4th April, 2006
|
|
|
|
|
I have a module in VC++6.0. it enumerates all desktop items and displays each item.tested this module on Win 2000 and Win XP.
After displaying each window i want to close each launched desktop item window by doing the following:
CWnd* pWnd = FindWindow(NULL, strName);//strName is name of window launched.
if(pWnd)
{ pWnd->PostMessage(WM_CLOSE,0,0);
}
but i get the foll error:
error C2065: 'CWnd' : undeclared identifier
i tried including the foll in the stdafx.h file
#define _WIN32_WINNT 0x0500
#include <windows.h>
still i get the same error.
What do i need to include to overcome this problem?
Kindly reply at the earliest.
Sincerely
Giftsana
|
|
|
|