|
can not find different code for "earlier record" and "new entry".
check if "add new" function is called for twice, try add a flag to ensue it is called for only once:
MyClass::ClickButton()
{
//the bool value is initialized as 0 before in constructor.
b_AddNew=1;
AddNewFunction();
}
MyClass::AddNewFunction()
{
if(b_AddNew==0) return;
b_AddNew=0;
do
{
//your code
}while(...);
}
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.
-- modified at 13:00 Saturday 1st April, 2006
|
|
|
|
|
I can't find what is wrong. But you should place the while-statement at the beginning of the loop. Your loop will show wrong data or crashes if you open an empty file.
Dr-Kuulun
|
|
|
|
|
hi Dr-Kuulun,
I received your response. I will try to solve out problem. Thanks for give me a reply.
Regards
kedar
Girish
Software Developer
|
|
|
|
|
hello everyone,
my application is MDI application develop in 1998. when i want to find or replace something it find it reverse ,if cursor is at just start or just end , it did not work.
i have tried to make my own find portion by defining structure FINDREPLACE
but failed.
but when i make a new application , it works perfectly well
plz tell me the solution
how i can resolve this problem . basically it's a MFC function
is ther could be any pointer problem??????
plz response
sachin gupta
sachin gupta
|
|
|
|
|
Hi,
I want to draw a line
(2 points , start of line ->lbutton down, mouse move (rubberband), end of line->lbutton down)
Its drawing perfectly. I have put the rubberband effect in mose move handler, but my rubberband line is not clearly visible. Its like dotted line and that too not clear. Why is that so? I have put pDC->SetROP2(R2_NOTXORPEN ); I tried with R2_NOT or some other combinations too.
My background color is black. I have also giving the code of OnEraseBkgnd handler.
My code is as follows.
void CMysplashView::OnLButtonDown(UINT nFlags, CPoint point)
{
CClientDC dc(this);
if(theApp.drawGraphic)
{
if(!fpoint)
{
m_ptold=point;
fpoint=true;
SetCapture();
}
else
{
CPen pen (PS_SOLID, 1, RGB(255,255,255));
CPen *oldpen = dc.SelectObject(&pen);
dc.MoveTo(m_ptold);
m_pt=point;
dc.LineTo(m_pt);
dc.SelectObject(oldpen);
fpoint=false;
ReleaseCapture();
}
dc.SetPixel(point, RGB(255,255,255));
}
CView::OnLButtonDown(nFlags, point);
}
BOOL CMysplashView::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
pDC->GetClipBox(&rect);
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), BLACKNESS);
return 1;
}
void CMysplashView::OnMouseMove(UINT nFlags, CPoint point)
{
if(GetCapture()!=this)
return;
// TODO: Add your message handler code here and/or call default
if(theApp.drawGraphic)
{
if(fpoint)
{
CDC *pDC=GetDC();
CPen pPen(PS_SOLID,1,RGB(0,0,0));
CPen *pPenOld = pDC->SelectObject(&pPen);
pDC->SetROP2(R2_NOTXORPEN );
m_pt = point;
pDC->MoveTo(m_ptold);
pDC->LineTo(m_pt);
pDC->MoveTo(m_ptold);
pDC->LineTo(m_pt);
pDC->SelectObject(pPenOld);
ReleaseDC(pDC);
}
}
CView::OnMouseMove(nFlags, point);
}
Thanks
Lee
|
|
|
|
|
Hi yang__lee ,
what's theApp.drawGraphic? I get many erros?
anyway I run your code It draw a background black and when I click lButton in the screen it draw
dot
maybe it is some helpful to you please check function mousemove
do you need to draw line in the form with LButton click ?
|
|
|
|
|
I am developing an app, which creates a DUN entry programmatically. The issue I am facing is that, how do I set-up the modem properties like baud rate, h/w flow control, etc. for the modem device I have specified for the entry. Also, how do I change the default settings for a modem like init strings, etc.?
Thanks,
Krishnan
|
|
|
|
|
1) Call GetCommState( handle, &dcb ); to get the existing port settings into DCB .
2) Modify the DCb structure accordingly to set new values.
3) Call SetCommState to set the new values back to port.
rgds...mil10.
|
|
|
|
|
What I need is to set the modem properties for the dial-up connection I create programmatically. The GetCommState fn works if I have handle to the serial port. I just need to set-up the connection so that whenever the user dials the connection, the correct settings are used to connect with the modem.
|
|
|
|
|
hi
can anyone tell me how can i include the default FTP Server program (EVC++ has a default FTP server program by the name of FTPD) in my project.
i am woking with windows Ce Sockets. and i have used evc++ for coding.
reply
Ekta Ahuja
ahuja.ekta@gmail.com
|
|
|
|
|
Are there registry available to any user?
I mean that, if on a station are several users with different rights(admins, users, etc.) is any registry key that anyone can change, without giving specific rights to it?
|
|
|
|
|
Any key under HKEY_LOCAL_MACHINE .
Steve
|
|
|
|
|
|
|
No, there is no key that all users can see and have write access to. HKLM is writable only by power users and admins. You'll need to use the All users\Application data directory to share data this way.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hello,
how is the = operator to be implemented in a class derived from CObject?
I derived two classes with one element inside:
<br />
class CA : CObject<br />
{<br />
int a;<br />
<br />
void operator = (const CA& src) {};<br />
}<br />
<br />
class CB : CA<br />
{<br />
int b;<br />
}<br />
The first class overwrites the = operator with an empty function.
The following code has a mystic result:
<br />
CA obA;<br />
CB obB;<br />
<br />
obA.a=1;<br />
obA.b=2;<br />
<br />
obB=obA;<br />
The element b is copied, a not. Why? And what do the = operator in CObject? Why is b copied? Do I have to implement the operator in Class CB too?
Many questions no answer!
Thanx
Markus
Dr-Kuulun
|
|
|
|
|
class CA : CObject
{
int a;
CA & operator = (const CA &);
}
good luck
Vytas
|
|
|
|
|
|
Yes it is wrong. Both objects should be instances from the last derrived class type CB.
Dr-Kuulun
|
|
|
|
|
I'm currently working on a project which needs to read contents from an ANSI text file and save into another text file in UTF-8 format, in fact it needs to convert about a thousand files from ANSI to UTF-8 and those old ANSI files must remain unmodified. Any suggestions? I'm not familiar with text encoding stuff...
|
|
|
|
|
|
|
hello
I have MFC dialog based application and have many checkboxes
and radio buttons in it, but the background color of the dialog is white, therefore i also want to set the bk color of radio buttons and checkboxes white, otherwise they look ugly
can you help ?
thank you.
|
|
|
|
|
|