|
strCSV = L"|" + strCSV+ char(13) + char(10);
csvFile.Write(strCSV,strCSV.GetLength());
that is how i inserting.
|
|
|
|
|
Try it :
CString cszOut;
cszOut.Format(_T("|%s\r\n"), strCSV);
csvFile.Write(cszOut, cszOut.GetLength() * sizeof(TCHAR));
virtual void BeHappy() = 0;
|
|
|
|
|
strCSV = L"|" + strCSV+ char(13) + char(10);
csvFile.Write(strCSV,strCSV.GetLength());
that is how i inserting.but new line not appearing?
|
|
|
|
|
CString cszOut;
cszOut.Format(_T("|%s\r\n"), strCSV);
csvFile.Write(cszOut, cszOut.GetLength() * sizeof(TCHAR));
its workig for me great thanx.
|
|
|
|
|
Hello everybody,
in my MDI application, I use a theApp.MainFrame->SetRedraw(FALSE); to freeze the mainframe during the child window creation, to avoid creation flickering.
When I close the child, I use the same technique.
If the user hits the ESC key, I make the theApp.MainFrame->SetRedraw(FALSE); then I close the child.
This technique works great for the creation of the child, but at the destruction it makes a big error.
The mainframe seems transparent for all kind of inputs.
The mainframe is correctly redrawn but mouse and key inputs are directly send to the window "under" my application (Visual Studio when i debug, for example) and this other window gets the focus.
Has anyone an idea?
Big thanks
|
|
|
|
|
Does the effect (lost focus) exist
when you do not set anything at the child closing ?
virtual void BeHappy() = 0;
|
|
|
|
|
No, then all is working correctly
That's strange to me
|
|
|
|
|
Could you try it ? :
{
CWnd* pcWnd = AfxGetMainWnd();
pcWnd->LockWindowUpdate();
...
pcWnd->UnlockWindowUpdate();
}
virtual void BeHappy() = 0;
|
|
|
|
|
I removed the LockWindowUpdate / SetRedraw(FALSE) (both won't work correctly) out of the closing-traitement.
The first childwnd is created nicely, but if I open a second one, than the SetRedraw doesn't affect.
I see the new frame a half-second on another position as the correct end-position.
That seems ugly
Before I used a GetDesktopWindow()->SetRedraw(FALSE) ... that worked great, but it's very risky.
If an error occurs, the Desktop-Window is never been redrawn correctly
How would you fix this kind of workarround. Simply create a child window, which will be displayed only after all sub-controls are created and the their positions are well moved.
Big thanks
|
|
|
|
|
Maybe, you could create the childs invisible (~WS_VISIBLE )
and then call ShowWindow(..) for them ?
virtual void BeHappy() = 0;
|
|
|
|
|
Hi,
I have using a source code representing a class hierarchical like the following:
class c1
{...};
class c2 : public c1
{...};
now there is a method in another class which has argument like:
void Func1(vector<c1*>& vC1);
How could I pass the following vC2 to this method
vector<c2*> vC2;
Is there any way to typecast the vector<c2*> to vector<c1*>?
|
|
|
|
|
|
|
Maybe, it would be better (possible)
to collect your c2 -pointers to a vector<c1*> vC1; instead ?
virtual void BeHappy() = 0;
|
|
|
|
|
Short answer - no. Just because c2 is convertible to c1 doesn't mean that types dependent on c2 (like vector in this case) can be converted to equivalent types dependent on c1.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi,
I want to draw very small red,green color circle.
So i use Ellipse fuctionality.
But its draw as hollow.
I want filled circle with different brush color.
How can i do that?
Anu
|
|
|
|
|
Create the colored brush using CreateSolidBrush .
Use SelectObject to select the brush into the device context used in the first parameter of Ellipse .
|
|
|
|
|
Ellipse has 4 parameters.X,y,width,height only.
Anu
|
|
|
|
|
|
To fill the Ellipse when you draw it, you need first to create a Brush of the correct colour and then load it into the current Device Context. Then when you call the Ellipse function it will fill it with the correct colour.
Something like this ....
CBrush brMine;
CBrush *pOldBrush = NULL;
brMine.CreateSolidBrush(crRed);
pOldBrush = pDC->SelectObject(&brRed);
Then draw your Ellipse.
Ali
|
|
|
|
|
Try this...
CDC *pDC = GetDC();
CRect rect;
GetClientRect(rect);
CBrush brush;
brush.CreateSolidBrush(RGB(255,0,0));
CBrush *pOldBrush= pDC->SelectObject(&brush);
pDC->Ellipse(rect);
pDC->SelectObject(pOldBrush);
::ReleaseDC(m_hWnd,pDC->m_hDC );
|
|
|
|
|
CDC::FillRgn()
CRgn::CreateEllipticRgn()
read the docs of the function onemore time.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I am trying to make one, convert it to char, and then view it using XV
xlimit = 256;
ylimit = 256;
n = 2;
Do = 80;
for(i = 0; i < xlimit; i++)
for(j = 0; j < ylimit2; j++){
filter[i][j] = pow ( (pow((i - xlimit), 2) + pow ((j - ylimit2), 2)), 0.5);
filterpad[i][j] = 1 / (1 + pow ( (filter[i][j] / Do), 2 *n));
}
return filterpad;
I know everything is right, except this function,
when i do return filterpad i am just getting a black screen( all 0's)
|
|
|
|
|
How did you obtain the function?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How is filterpad declared?
Is the array local to the function?
If so it will not work as the stack will be cleared in the function epilog when it returns.
|
|
|
|