|
Hi Everyone,
When i build my newly ported(VS6.0 to 2008) code from VS2008 UI, It builds fine.
When i build it using
MSBuild XXX.sln /t:Clean /p:configuration=Release
MSBuild XXX.sln /l:FileLogger,Microsoft.Build.Engine;logfile=MyLog.log;Build /p:configuration=Release
I get 100's of
nafxcw.lib(winctrl1.obj) : error LNK2005: "public: virtual int __thiscall CStatic::Create(char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int)" (?Create@CStatic@@UAEHPBDKABUtagRECT@@PAVCWnd@@I@Z) already defined in mfc90.lib(mfc90.dll)
nafxcw.lib(winctrl1.obj) : error LNK2005: "public: virtual __thiscall CStatic::~CStatic(void)" (??1CStatic@@UAE@XZ) already defined in mfc90.lib(mfc90.dll)
I used the NODEFAULTLIB option in UI. With this option, UI is also failing to build.
If somebody ran into same issue, please advise.
|
|
|
|
|
Hi,
i sometimes get a overflow at runtime when using boost::regex_match...
here's what i'm doing (This code works!):
CString path = "abcd";
boost::regex r("bc");
boost::tmatch what;
if(boost::regex_match(path, what, r))
{
}
else
{
}
When i'm changing the code to
boost::regex r("*bc");
i'll get the error?
I have also tried 'BOOST_REGEX_NON_RECURSIVE' or 'BOOST_REGEX_RECURSIVE'.
Thanks
|
|
|
|
|
boost::tmatch what;
if(boost::regex_match(path, what, r))
Variable what has not been initialized, is this correct?
The best things in life are not things.
|
|
|
|
|
Yes, that's correct.
My code is like the first sample of this link.
|
|
|
|
|
Sorry, but I cannot see anything wrong there. I guess you need to use the debugger and try to trap the error.
The best things in life are not things.
|
|
|
|
|
On a side issue, try to make r static const . The static is particularly important: the regular expression should only be "compiled" once, not every time.
Steve
|
|
|
|
|
Thanks, but that did not matter...
This is the exact error message:
Unhandled exception at 0x7c81eb33 in Hierarchy Explorer.exe: Microsoft C++ exception: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::regex_error> > at memory location 0x0012ddc4..
|
|
|
|
|
I knew it wouldn't help, it was a side issue. Can you post a small self-contained program that exhibits the problem?
Steve
|
|
|
|
|
Your regular expression isn't valid. What's more, the program is trying to tell you what's wrong. I used the following code:
void Go()
{
try
{
CString path = _T("abcd");
static const boost::tregex r(_T("*bc"));
boost::tmatch what;
if(boost::regex_match(path, what, r))
{
}
else
{
}
}
catch (const boost::regex_error &e)
{
cout << e.what() << endl;
throw;
}
}
The following error is the result:
The repeat operator "*" cannot start a regular expression. The error occured while parsing the regular expression: '>>>HERE>>>*bc'.
The regular expression you're probably after is: .*bc
Steve
|
|
|
|
|
Thats it!
I will have to give the boost syntax more attention... thank you!!
|
|
|
|
|
The syntax isn't boost specific, it's standard regular expression syntax.
Steve
|
|
|
|
|
You're right.
I've played a while with the syntax... you can use it for almost enything!
Actually I have been looking for filter like it is used in SQL queries. I Only wanted to use the *, ?, bracket, AND, OR-statements.
Are regular expressions perhaps a bit too complex for that purpose?
I don't want people to study regular expressions before using my program.
Do you perhaps have a recommendation to me?
|
|
|
|
|
A basic understanding of regular expressions is kind of an must have these days.
Steve
|
|
|
|
|
Hi ALL,
outside a while loop, I declare a 3-D vector array
vector<struct Person> Psodu;
Psodu.reserve(10);
vector<vector<vector<struct Person> > > structPersonVar(2, vector<vector<struct Person> >(2,Psodu));
in the while loop, i have to change the size of the array in every iteration.
First, I use the following code to release the memory
<br />
for(int j=0; j < 2; j++)<br />
{<br />
for(int k =0; k < 2; k++)<br />
{<br />
vector<struct Person>().swap(structPersonVar[j][k]);<br />
}<br />
vector<vector<struct Person> >().swap(structPersonVar[j]);<br />
}<br />
<br />
vector<vector<vector<struct Person> > >().swap(structPersonVar);<br />
<br />
Then, I resize the array
structPersonVar.resize(20);
for(j=0; j < 12; j++)
{
structPersonVar[j].resize(2);
for(int k =0; k < 2; k++)
{
structPersonVar[j][k].reserve(10);
}
}
I am not very sure whether i am correct by doing in this way,though it works fine with testing program.
|
|
|
|
|
Hello ALL,
Initially, I declare Var[1][1] as
vector<vector<string> > Var(1, vectort<string> (1));
later, I want to expand Var to be Var[5][6]
How to do this.
Thanks
modified on Monday, April 18, 2011 11:10 AM
|
|
|
|
|
You want Var to grow to 5 and each element in Var to grow to 6. If i got it correctly, this can be a solution.
vector<vector<string> > Var(1, vector<string>(1));
Var.resize(5);
for (int i=0; i<5; ++i)
{
Var[i].resize(6);
}
|
|
|
|
|
My Configuration is VS2008 MFC statically linked app. I have been compiling my app over a 1000 times and am intune with the size of the exe. It has slightly more than doubled in size as of this week ever since the windows update on April 14. For the time being I am compiling at my alternate computer that has "Automatic Windows Update" turned off and get the usual size of the executable. Has anyone else observed this. I have compiled other projects and have noticed the same pattern - exe doubles in size.
|
|
|
|
|
try turning the MAP file on as a link option, on both machines and compare the output
is this release or debug?
|
|
|
|
|
Thank you for responding barnyman.
This is a release build (both of them). Since reporting the problem I have some additional information. I ran both executables (the big and the small one) on the same computer and used the ProcessMonitor tool to determine and compare the dll's that each was loading. The results show the larger exe is loading 4 additional dll's. They are:
dwmapi.dll
msimg32.dll
winmm.dll
gdiplus.dll
I am not using any code the needs these dll's.
In my projects settings: Linker->Input->Ignore Specific Libray settings, I blocked all of the lib files that depend on these dll's and can't compile the project. This tells me there is some new dependency that has formed.
In searching the Internet I learned that programmers that have moved to VS2010 are having the same problem. It seems there are some MFC files that have some built in dependencies to the MFC feature pack even though their project is not using them. I suspect that is what is going on with my project even though I am still using VS2008. The most latest Windows update made that happen. (I have used the MFC feature pack in some other projects but don't do that anymore. I can do it all without it.)
This experience gives new meaning to the concept of VC_EXTRALEAN and dare I say WIN32_LEAN_AND_MEAN from back in the day. More to come.
Once again thanks for your time barneyman.
Art
|
|
|
|
|
Please let us know if you find a way around this.
|
|
|
|
|
The problem has been fixed with the recent June 15, 2011 Windows update. Back to normal. What a relief!
|
|
|
|
|
Thanks for letting us know.
|
|
|
|
|
Hi,
I am facing a strange problem with the existing code. it suddenly started failing. The problem happens only in one of the machines, while the same code works in other machines.
It fails at the below line.
obj1 = new _objifptr(_uuidof(objif));
I did check that __uuidof returns the correct uuid. but fails when "new _objifprt" is called. The .dll, .tlb and .pdb are all available in the working directory. They have been registered using regasm successfully.
I see that the errors thrown are
FileLoadException followed by TypeInitializationException.
Please help with your thoughts.
Thanks,
Dhana.
|
|
|
|
|
I Want to draw one line in two windows, when I move my mouse in one window, I draw one line from top to bottom。
There is another window at the bottom of this window,I also want to draw one line in this window, if I Sendmessage to do it,
It looks like draw two lines。
|
|
|
|
|
You need to give some more details about this, the normal way is to capture the details of the line(s) in your program somewhere (e.g. on mouse moves) and then render the actual details in your paint procedure(s), and each window should have its own paint handler.
|
|
|
|