|
it's been deprecated (due to thread safety reasons), but never removed from the CRT (how could it?) !
if the compiler doesn't find it, you have a problem in your VS2005 installation
|
|
|
|
|
Interesting, I didn't know this. I thought it was deprecated for buffer overflow reasons.
|
|
|
|
|
Yes, it was because of the possibility of buffer overflow.
-Randor
|
|
|
|
|
Even if strcpy() were available (it is, just not by default), you do realize that m_EMPRESA will only hold 6 characters, not the 13 that sEmpresa holds.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Have you read the docs? The first sentence on the strcpy page reads:
These functions are deprecated because more secure versions are available; see strcpy_s, wcscpy_s, _mbscpy_s.
|
|
|
|
|
Hi,
I'm using VC++6.
I'm having an application which has dependency with many other libraries.
I've added the libraries to the application workspace using
project->dependencies.
I'm getting compiler error c1083. "fatal error C1083: Cannot open include file: 'filename.h': No such file or directory"
But the file exists.
If i include the path in Include files(Tools->Options->Directories), Iam getting the error for some other file.
The files are library files. If i build the library there is no error. The error occurs only if i build the application.
What could be the root cause?
Thanks & Regards,
Sanju
|
|
|
|
|
I'm not sure if I fully understand what you mean. First you mention a header file. Then you mention a library file. Which one is it? *.h and *.lib paths are not part of the same list of paths, as far as I know. There should be a section for each of them. That said, it would typically be better to add the include paths to your project file, not in the global settings as it makes your application more portable in development when you move from computer to computer, environment to environment.
Edit: I just reread it, and maybe you mean that once you solve the header issue, you get a library issue. If that's the case, then you will have to edit the library paths as well. I'm unsure which setting it is in VC6, but in VC2005, it's under "Configuration Properties --> Linker --> General --> Additional Library Directories".
|
|
|
|
|
Hi,
Thanks for the reply.
I'll explain the issue in detail.
I have an MFC AppWizard Exe application and i've say 2-3 MFC Win32 static library applications. I've added the library applications as dependencies in the exe application using Project->Dependencies.
Suppose fileX.h and fileY.h is in lib1.
file2.h in lib2, file3.h in lib3.
Then in fileX.h i've added #include "file2.h" and
in fileY.h i've added #include "file3.h".
If i build lib1 i'm not getting any compiler error.
But if i build the application which has dependency on lib1, i'm getting error c1083, saying
"fatal error C1083: Cannot open include file: 'file2.h': No such file or directory".
But the file exists. Then i included the file path of file2.h using Tools->Options->Directories. Then the error for file2.h is gone but it shows error for file3.h. What could be the problem?
Thanks & Regards,
Sanju
|
|
|
|
|
OK, a few things.
First of all, do not add your folders to Tools->Options->Directories. That's going to bite you later on, since that's pretty much the global folder reference. Instead, you need to add everything to the include directories under your project properties. It should be in the C/C++ section of the properties.
Second of all, say project 1 depends on project 2 which depends on project 3. If you include project 3 folders in project 2, then, project 2 will compile. If you include project 2 folders in project 1, it will not compile, because you also need to include project 3 headers in project 1 (which may be in an entirely different folder). I suggest you dump your lib headers in a common include folder so every project can simply include that folder.
|
|
|
|
|
Do you have it written as
#include <filename.h> // error C1083
// or
#include "filename.h"
|
|
|
|
|
Hi,
Thanks for the reply.
It is written as #include "filename.h"
Thanks & Regards,
Sanju
|
|
|
|
|
Can you show the "include" line of the code?
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Hi,
Thanks for the reply.
It is given as #include "filename.h"
Thanks & Regards,
Sanju
|
|
|
|
|
We have a straight Win32 developed application (no MFC, etc.). We've implemented dockable toolbars, but when they float there is a taskbar button that appears along with the application button. Each floating toolbar has its own button.
Can anyone recommend a way to remove this button, or somewhere I should look to see why I'm getting this button in the first place? I swear I read a Code Project article on just this thing several months ago, but have been unable to find it.
I'd also like the floating toolbars to keep the focused look, even when using the main application. Currently, the title bar of the toolbar gets the unfocused color to it. Again, I thought I read this in CodeProject somewhere, the same article, but can't find it!??!
Thanks,
|
|
|
|
|
There are some window styles that you have to remove (and some that you may have to set) to get rid of the taskbar icon. Search here for the WS_EX_APPWINDOW style for more details.
You can handle your own NC_PAINT messages (Non-Client Paint) to draw your own taskbar, and you can always draw using the "Active" colors. There are some articles available here about custom caption bars - look there for good places to start.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for the reply. I've had a chance to tackle this issue again. Using Spy++, the WS_EX_APPWINDOW style is not set in my toolbar control. However, maybe one of them is reponsible for putting it on the taskbar? I can't figure it out. Here are the results of Spy++ (VS2005) on my undocked toolbar, which shows a taskbar button that I don't want.
Styles of the window holding the toolbar control:
WS_CAPTION, WS_POPUP, WS_VISIBLE, WS_CLIPSIBLINGS, WS_SYSMENU, WS_THICKFRAME
Extended styles:
WS_EX_LEFT, WS_EX_LTRREADING, WS_EX_RIGHTSCROLLBAR, WS_EX_TOOLWINDOW, WS_EX_WINDOWEDGE
And here are the styles of the toolbar control itself:
WS_CHILDWINDOW, WS_VISIBLE, TBSTYLE_TRANSPARENT, TBSTYLE_FLAT, TBSTYLE_WRAPABLE, TBSTYLE_TOOLTIPS, CCS_NODIVIDER, CCS_ADJUSTABLE, CCS_NOPARENTALIGN CCS_NORESIZE, CCS_TOP
Extended styles:
WS_EX_LEFT, WS_EX_LTRREADING, WSs_EX_RIGHTSCROLLBAR
Any clues? I can't figure anything out...
Thanks again, Tom
|
|
|
|
|
So this does not output any char from the file:
vector <fstream>::iterator vi;
std::vector<fstream> vFilestreams;
for (vi=vFilestreams.begin(); vi!=vFilestreams.end(); vi++)
{
(*vi).open(vFileList[i].c_str(),ios::in);
}
for (j=1;j<=20;j++)
{
for (vi=vFilestreams.begin(); vi!=vFilestreams.end(); vi++)
{
*vi>>current_char;
}
} Why do I not get anything in current_char ?
|
|
|
|
|
I don't know what current_char is, but did you remember to close the filestream? I believe you either have to close or flush it in order to get the text to show when you open it.
|
|
|
|
|
it is indeed a char . And I do not see it change in the debugging window, so basically, I do not think that the iterator works. I tried with typecasting it on a fstream, without success.
|
|
|
|
|
What I mentioned was a completely different issue. I asked if you had flushed the buffer, but you haven't answered that question.
Also, your iterator has nothing to do with the char variable. The iterator would contain the ifstream objects.
|
|
|
|
|
Cyrilix wrote: I asked if you had flushed the buffer
Why would I have to flush the buffer ? AFAIK, the >> operator does not require the buffer to be flushed !! As a proof of it, if I do the same on a single fstream without the vector, it works perfectly !
Cyrilix wrote: your iterator has nothing to do with the char variable. The iterator would contain the ifstream objects
Of course. I never mentioned the iterator should coutain char variables ?!
|
|
|
|
|
Rage wrote: std::vector<fstream> vFilestreams;
Can you change that to <fstream*> and try? btw,you push fstream object straight into the vector? it did compile for you? what compiler are you using?
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
i don't see anything wrong in using directly a vector of fstream, except perhaps that they will get copied and then decrease the performances... but of course it would compile.
|
|
|
|
|
It could compile on a VC 6.0(We know about mr6 ), but it wont work ultimately. so should be his problem.
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
VuNic wrote: btw,you push fstream object straight into the vector?
Yes
VuNic wrote: it did compile for you? what compiler are you using?
Obviously. VC6.
|
|
|
|
|