|
Wow, I had no idea.
Could you point me to one of those articles you mention? I mean, I'd like to see under what circumstances a vector of auto_ptrs does not work as expected, so that I can steer clear of such scenarios. The auto_ptr class has a simple and straightforward copy constructor/assignment operator; it's hard to imagine that it wouldn't work as expected under typical usage.
Thanks,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
|
Microsoft Access has an option where you can compact a database and I would like to do that with ADO. There is a function in CDaoWorkspace that can do that but I am using ADO in my application. Does anyone know how implement this compact option with ADO?
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I want to write a CdialogBar like in AutoCad 2002. So if the DiologBar is dock to the top or button it should use the window width automaticlly. In the DiolagBar there are other object, that should also resized when it's docked.
by(t)E
sändy
|
|
|
|
|
Ok. I have a regular dll that calls an MFC extension. I know - an old thing but I got new complication (new for me at least). So I have that export from the extension with CDynLinkLibrary in it to add extension to the resource chain of the regular, right?
And I call it only once and everything is just fine UNTIL I create my own new worker thread in the extension using _beginthreadex . This thread can't find resources of the extension in which it was created - now what? Anybody have any ideas?
Thanks a lot in advance!
|
|
|
|
|
This is part of faq
add infront every function that accessing resources in dll.
AFX_MANAGE_STATE(AfxGetModuleState());
|
|
|
|
|
I know about faqs and I know about this basic stuff. I'm not that dumb. Eveybody knows it.
But the thing you are refering to is about regular dlls, right? But but but but but....
Please reread my post. The problem is NOT in regular dll it is in the extension dll that is used by regular dll. AND it is not a part of a call from regualr dll - it is in a thread that was started by EXTENSION dll.
|
|
|
|
|
Hi @all,
maybe a simple question to most of you, but I never did this before while coding...
What's the easiest and best way to copy all files inside a folder to a target device (e.g. drive D: )? And what classes or functions do you use? MFC stuff is welcome!
Thx a lot!
Stefan
When I was young my mother told me to clean up my room, I told her -1!
|
|
|
|
|
One solution is to loop through all files inside a directory via FindFirstFile() and FindNextFile() and then call MoveFile() and/or CopyFile().
Kuphryn
|
|
|
|
|
Use the SHFileOperation function for easy copying.
|
|
|
|
|
_Theo_ wrote:
Use the SHFileOperation function for easy copying
Great. That's exactly I was looking for... Thanks!
When I was young my mother told me to clean up my room, I told her -1!
|
|
|
|
|
How do I detect end of file using CFile..
e.g CFile infile;
while( ???????????????? )
{
// do something
}
Thanks.
|
|
|
|
|
See the documentation of CFile::Read() . If its return value is less than the amount of bytes requested, you've reached EOF. This method can also throw a CFileException , whose m_cause member contains the cause of the exception. Compare it with CFileException::endOfFile to check for attempts to read past EOF.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
CFile has no eof function. To test for eof you should check the return value from the read function. if the return value is less than the number of bytes you requested to be read, then the end of file has been reached.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Hi, does anyone knows how to handle events from dynamically created ActiveX controls ?
In my particular case, I've created an aray of MSComm controls. I use it to control many modems on the PC. I can open the com ports, send data and everything works fine. My problem is when it comes to handling the OnComm event. I have no idea about how to do that.
If anyone have an example or a reference of how to manage event from dynamic ActiveX, it would be apretiated.
Tank you.
|
|
|
|
|
Does anyone know of some good articles about developing in VC++ with a project-based architecture using MFC? With MDI and SDI, you can either have a single-document or multiple documents opened at one time. I need something like Visual Studio where you have a single project opened, but mutiple files and potentially several control bars (like the Workspace, Output, etc.).
I know this has been covered somewhere, perhaps even on CP.
|
|
|
|
|
Well, one model to use could be the way VC6 does it (some other irrelevant info is also there):
http://www.codeproject.com/macro/openvc.asp[^]
Basically the workspace is a CDocument derived class and probably manages all the rest of it. I don't have the time to do a search on CP, but there are probably plenty of articles on doing similar things here.
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
|
My Class A has a function named
SaveSelectedItems()
I'm trying to call that function from Class B.
when I call it I get the message SaveSelectedItems, undeclared identifier. I'm not sure how this could be done.
|
|
|
|
|
Class B will need an instance of Class A, or the function in Class A will need to be declared as static.
|
|
|
|
|
In your class B function where you are calling this Class A function, create an instance of class A and use that instance to call SaveSelectedItems()
|
|
|
|
|
Thank you for your reply.
|
|
|
|
|
help confused:
i want to realize a vectorgraph editor like proxysource design.
how to do it?
|
|
|
|
|
I read your bio and you are not even close to being able to write such a program. Proxysource design was probubly written by a team of programers, and or it took a very long time (and experence).
If you are serious about writing such a program I suggest you use it and study how it appears to work (for clues), then work on it a piece at a time.
Write down what you need to learn in order to reach your goal(s), what you need to learn. I would start with the graphical aspect of the problem (GDI), if you can not draw the objects (part of the front end) then you can use that imformation to write the code generation part.
You might try SorceForge.net to see if any body is working on a case tool and either join the development team or study what they are doing.
Could I write it in a reasonable amount of time? No!
Could I write it? Yes!
Trust in the code Luke. Yea right!
|
|
|
|
|
I have been using a modeless dialog for indicating the progress of a task. In the dialog is a CProgressCtrl, and a cancel button. I have recently added a CListCtrl as well.
Everything works fine as long as you do not move the dialog, or click in the list control. Once you do this, things start to get wierd. Usually, there is a 2-3 second delay when clicking on something, or moving the window. During this delay, nothing is happening with the task that the dialog is showing the progress of. It should be continuing on, but nothing happens. The screen does not draw correctly either.
Each time I manually break, the stack points to my function that is pumping messages (it gets called periodically during the task). The PeekMessage seems to be "stuck" for some reason. Again, this only happens if the dialog is moved, or when clicking on a control within the dialog.
Any ideas on why this may be happening? Any work-arounds?
<br />
while (::PeekMessage (&msg, NULL, 0,0, PM_NOREMOVE)) {<br />
<br />
if (pbrcv != NULL && msg.message == WM_MYMSG1){<br />
*pbrcv = true;<br />
}<br />
if (!AfxGetApp()->PumpMessage()) {<br />
::PostQuitMessage(0);<br />
return false;<br />
}<br />
} <br />
LONG lIdle = 0;<br />
while (AfxGetApp()->OnIdle (lIdle++))<br />
;<br />
}<br />
Thanks,
DaveQ
|
|
|
|