|
I need to select first item in virtual list control (CListCtrl with LVS_OWNERDRAW style set). Is any notification handler exists that notifies then CListCtrl finished collect data?
Sorry, if I confuse you with explanation
Thanks in advance
|
|
|
|
|
I have a program which deals with tabular data. Is there a quick and simple way to output data in excel file format?
Happy programming!!
|
|
|
|
|
I believe it's fairly simple using Excel as a COM object, i.e. only if Excel is installed on the machine.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
The quick and dirty way is to output it as a CSV format. Excel can then read the CSV format.
Michael
|
|
|
|
|
Yes that is the idea at the moment but we would prefer to output to the format directly which might also avoid complications of text that has comma as part of it.
Happy programming!!
|
|
|
|
|
When using the Trace statement in MFC where does it output it. coz ive tried look for it when in the debugger and it wont out the string inside my Trace statement. can anyone help me? thank you very much...
john
|
|
|
|
|
It's output to the output window, which may not be visible. It's output only in debug builds, and possibly only when you run in debug mode.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
|
Note that TRACE is a layer over OutputDebugString. See the docs on it for more info.
|
|
|
|
|
I'm writing a program that gives each user his/her own option, but I need to know when a user logs on to kick the option in, or when a user switches to another user(doesn;t log off) and then switches back without logging off or on. I've been searching for days and can find nothing on it. Anything at all will be greatly appreciated. Thx
|
|
|
|
|
Do you mean when the user logs on/off Windows or your program ?.
If it's windows, i think you'll need to write a GINA, a replacement to the windows security access (the logon dialog, shutdown, etc..) I've written one a few weeks ago for Windows NT 4/2000
There is an example on msdn, search for GINA.
Is not an easy task, I'm not sure this is the of solution you are looking for.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Yes For WIndows, I WIll look it up thanks
|
|
|
|
|
No I don't want to do that, I just need to know if the user who is , logged on and when they log on, or switch to another user.
|
|
|
|
|
Sorry, I don't get it, could you explain more ?.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Do a search on MSDN for WTSRegisterSessionNotification
Michael
|
|
|
|
|
Can't Find anything on that
|
|
|
|
|
I did.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
Got me a little closer, thx, I see how to declare the program to recienve the notification, but how do I actually recieve the notification? do I have to make a loop or something to check for a notification every few seconds?
|
|
|
|
|
I'm trying to write an undo feature for a drawing program. I have an array of CPoint's called ShapePts[100]. I made another array of CPoint's Undo[100]. When the program deletes a point it finds the closest point to the mouse. So, I was thinking just store the point in another array before it gets deleted.
/* This is the MainFrame.h declaration */
CPoint Undo[100];
int nUndo;
void CMainFrame::OnLButtonDown (UINT nFlags,
CPoint MousePt)
{
int ShortDist;
if (nFlags & MK_SHIFT)
{
// Shift key down. So delete closest point.
if (nPts > 0) // - only if have one
{
// Step: Find point closest to MousePt
Pos = ClosestPoint (MousePt,ShapePts,nPts, ShortDist); <-- returns int
Undo[nUndo] = ShapePts[nPts]; // nPts and nUndo were initialized to
// zero in MainFrame contructor
// Step: Shift points down one array component index
for (int i = Pos + 1; i < nPts; i++)
{
ShapePts[i-1] = ShapePts[i];
}
nPts--; // adjust count
} // end if
}
else
{
if (nPts >= 99) // array full
return; // do nothing
else
{
ShapePts[nPts] = MousePt;
nPts++;
CString s;
s.Format("Last pt d, %d)",MousePt.x, MousePt.y);
myStatusBar.SetText (s,1,SBT_NOBORDERS);
}
}
Invalidate();
}
void CMainFrame::OnRButtonDown (UINT nFlags, CPoint MousePt)
{
CPoint ScreenPt;
int ShortestDist, i;
// Step 1: Find position of closest pt in array
Pos = ClosestPoint (MousePt, ShapePts, nPts, ShortestDist);
if(nFlags & MK_SHIFT)
{
ShapePts[nPts] = Undo[nUndo];
nPts++;
for(i = 0; i < nUndo; i++)
{
Undo[i-1] = Undo[i];
}
nUndo--;
}
else
{
SetCapture();
// Step 2: Move the cursor to that position
ScreenPt = ShapePts[Pos];
ClientToScreen (&ScreenPt);
SetCursorPos (ScreenPt.x, ScreenPt.y);
}
}
Where am I going wrong. If you need more info please let me know.
-CDudd
|
|
|
|
|
I don't get why your undo is a collection of points, but why not use a deque, then you can upll undos from one end, and drop them from the other as you push them in when you reach the size you want.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm thinking of getting married for companionship and so I have someone to cook and clean." - Martin Marvinski, 6/3/2002
|
|
|
|
|
There isn't a point at Undo [nUndo]. All the points exist between 0 and nUndo - 1. You can correct this problem by decrementing nUndo prior to the Undo [nUndo] line. Also, since you are getting the top element off the undo stack, there is no need for that block of code shifting the undo stack down.
After you get it working, look into std::deqeu. It would really simplify the code.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Could you help me ?
I need that user can save a orders as RTF or DOC file without using the CRichEdit. ??
Wiizi
|
|
|
|
|
AFAIK, RTF is a text format, so it shouldn't be too hard to write. Check http://www.wotsit.org/, there's prolly a description there.
And if words were wisdom, I'd be talking even more. The Offspring, I Choose
|
|
|
|
|
|
Does Visual C++ have any support for regular expressions? Or do I need to find someone else's regex code? Any suggestions?
~Cam Desautels (BinaryUprising.com)
|
|
|
|