|
Compiling in VC6 with STLPORT 5.1.0 and MFC
I'm experiencing the following messages.
Anybody can help to solve this ?
xxx.obj : error LNK2001: unresolved external symbol "private: static void __cdecl stlpmtx_std::D__A::_M_deallocate(void *,unsigned int)" (?_M_deallocate@D__A@stlpmtx_std@@CAXPAXI@Z)
xxx.obj : error LNK2001: unresolved external symbol "private: static void __cdecl stlpmtx_std::D__A::_M_deallocate(void *,unsigned int)" (?_M_deallocate@D__A@stlpmtx_std@@CAXPAXI@Z)
xxx.obj : error LNK2001: unresolved external symbol "void __cdecl stlpmtx_std::__stl_throw_out_of_range(char const *)" (?__stl_throw_out_of_range@stlpmtx_std@@YAXPBD@Z)
xxx.obj : error LNK2001: unresolved external symbol "void __cdecl stlpmtx_std::__stl_throw_length_error(char const *)" (?__stl_throw_length_error@stlpmtx_std@@YAXPBD@Z)
Setting _STLP_DEBUG, things change just sligthly:
xxx.obj : error LNK2001: unresolved external symbol "public: static void __cdecl stlpdmtx_std::priv::__stl_debug_engine<bool>::_M_detach(class stlpdmtx_std::priv::__owned_list *,class stlpdmtx_std::priv::__owned_link *)" (?_M_detach@?$__stl_
debug_engine@_N@priv@stlpdmtx_std@@SAXPAV__owned_list@23@PAV__owned_link@23@@Z)
xxx.obj : error LNK2001: unresolved external symbol "public: static void __cdecl stlpdmtx_std::priv::__stl_debug_engine<bool>::_Invalidate_all(class stlpdmtx_std::priv::__owned_list *)" (?_Invalidate_all@?$__stl_debug_engine@_N@priv@stlpdmtx_std@
@SAXPAV__owned_list@23@@Z)
xxx.obj : error LNK2001: unresolved external symbol "public: static void __cdecl stlpdmtx_std::priv::__stl_debug_engine<bool>::_Assert(char const *,char const *,int)" (?_Assert@?$__stl_debug_engine@_N@priv@stlpdmtx_std@@SAXPBD0H@Z)
Maybe this could help: I've got on codeproject list a (now broken) link to a solution: http://www.codeproject.com/file/win32findfile.asp?df=100&forumid=13624&exp=0&select=925545#xx925545xx
Following it, I found this notes. However them does not suggest me any solution.
http://sourceforge.net/search/?ml_name=crayzedsgui-cvsmk2&type_of_search=mlists&group_id=93749&words=unresolved
Thank in advance ...
Andrea
|
|
|
|
|
Are there equivalent classes in WTL that replaces the MFC CFile-based classes?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There is a CFile class written by Bjarke it must help you in your work.
You can find that here
http://viksoe.dk/code/atlfile.htm
::_-_
I believe in luck and i find that the harder I work,
the more I have of it _-_::
|
|
|
|
|
John, check out CAtlFile . Personally, I use STL streams (std::ifstream and std::ofstream ).
|
|
|
|
|
I need to use the _access function in io.h, but when I #include it, I get the following linker errors:
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __set_errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __get_errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __get_osplatform already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __osplatform already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(calloc.obj) : error LNK2005: _calloc already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
If I *don't* #include io.h, I get a compiler error saying _access isn't defined.
If I try to #include atlmincrt.h, the compiler tells me it can't find the file, yet the ATL include folder exists in the VC++ Directories, and the file is in that folder.
Is there a secret atl include file that solves this problem?
-- modified at 16:42 Saturday 9th December, 2006
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you getting this error for Release builds only?
Try removing _ATL_MIN_CRT in Project -> Settings, C++ tab, from the Preprocessor definitions box. [edit]This is for VC6, but their might be something similiar in VS2005, but I don't have access to it right now[/edit]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
What Steve said. Is VS2005, open the project settings and in the General section make sure the Minimize CRT Use is ATL is set to No.
|
|
|
|
|
That was it. Many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm using VS2005 Standard
I'm completely new to WTL, and have downloaded 8.0.6034 from sourceforge. How do I "install" the app wizard stuff? The installer appears to be a javascript file, but when I try to load it in IE, nothing happens. The documentation doesn't appear to say how to run these setup files.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Close Visual Studio and just double-click the "setup80.js" script.
|
|
|
|
|
Many thanks.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I don't know if this applies to 8.0, but it did to 7.x: If you want to use the ATL (& MFC)-implementation of CString, then make sure to include atlstr.h just after atlbase.h (at the very least before any of the wtl-includes). WTL has its own CString-implementation, which it'll enable if ATL::CString isn't present by the time of inclusion. This can create all kinds of bizarre type mismatches if you include atlstr.h after WTL.
--
-= Proudly Made on Earth =-
|
|
|
|
|
I want to create a child(?) window on a form that overlaps the non-client area of the main window. Similar to the Office 2007 application button (see http://images.tomshardware.com/2006/03/10/office_2007_beta_2_02.jpg).
I have tried setting the window style to WS_POPUP, but the window is still clipped to the client area of the frame. The only way I can get around this is to use a screen DC, but that doesn's seem like the right thing to do (and I have to manually determine when the window shoudl be visible so I don't draw over other windows.
Any hints would be greatly appreciated.
|
|
|
|
|
i developed an ActiveX control with ATL,vs2005
When I try to open my ActiveX Control with Dependency Walker in client machine
i got the following error:
"Failed to load due to a mismatched machine type with one or more of the dependent modules"
It need "CoreDll.dll".
I saw below article on MSDN to troubleshoot the issue
http://msdn2.microsoft.com/en-us/library/aa459142.aspx
but it looks like it is all about Windows CE and .Net compact framework. I am using Windows XP SP2.
Any help is appreciated.
|
|
|
|
|
Instead of client m/c, use dependency walker on development m/c to detect all dependencies, and ship them along with activex.
|
|
|
|
|
use dependency walker on development m/c
"atl80.dll" and "msvcr80.dll" are needed ,i ship them along with the activex ,but it can not work.
|
|
|
|
|
Hi all,I want to use bho to catch the message of mouse right click.It seems there exists one way:
Using ATL.I followed MSDN:rewrite SetSite,and then assign FindConnectionPoint,then advise,at last catch events to invoke,the following is example codes in invoke():
switch (dispidMember)
{
case DISPID_HTMLELEMENTEVENTS_ONCLICK:
CComPtr< IDispatch > pDisp;
IHTMLDocument2*pHTMLDoc;
mWebBrowser2->get_Document(&pDisp);
if (pDisp!=NULL)
{
pDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pHTMLDoc);
pHTMLDoc->elementFromPoint(myPoint.x,myPoint.y,&pElement);
}
...
}
But,how can I know myPoint,where can I get it?
|
|
|
|
|
pDispParams parameter of IDispatch::Invoke would have that infromation.
|
|
|
|
|
I have the same question.
Could you pls let me know how to get the point from DISPPARAMS* pDispParams
|
|
|
|
|
I not created any object in my program, but I found memory leak. Why?
I wonder whether the stl in VC6.0 can be available.
The source code is as follow. If you run it in VC6.0, you may find the memory leak prompt in output box. Why?
// TestMemLeak.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <vector>
#include "srmcritsec.h"
#define _CRTDBG_MAP_ALLOC
#include<stdlib.h>
#include<crtdbg.h>
typedef struct ipqam
{
char szName[50];
char szIpAddr[50];
char szDistrictName[50];
char szNote[255];
}IPQAM;
typedef struct freqpoint
{
char szName[50];
// added by yangyi,2006-8-23
int32 Modulate;
int32 Freq;
int32 Symbolrate;
char szNote[255];
}FREQPOINT;
/*
****************************************************************
struct : interfreqpoint
****************************************************************
*/
typedef struct interfreqpoint
{
FREQPOINT freqpoint;
// CSrmCritSec sec;
interfreqpoint();
interfreqpoint(const interfreqpoint & obj);
~interfreqpoint();
interfreqpoint & operator=(const interfreqpoint & obj);
}INTERFREQPOINT;
interfreqpoint::~interfreqpoint()
{
}
/*
function : constructor
*/
interfreqpoint::interfreqpoint(const interfreqpoint & obj)
{
*this = obj;
}
/*
function : constructor
*/
interfreqpoint::interfreqpoint()
{
this->freqpoint.Freq = 0;
this->freqpoint.Modulate = 0;
this->freqpoint.Symbolrate = 0;
this->freqpoint.szName[0] = 0;
this->freqpoint.szNote[0] = 0;
}
/*
function : overload =
*/
interfreqpoint & interfreqpoint::operator=(const interfreqpoint & obj)
{
strcpy(freqpoint.szName,obj.freqpoint.szName);
strcpy(freqpoint.szNote,obj.freqpoint.szNote);
freqpoint.Freq = obj.freqpoint.Freq;
freqpoint.Modulate = obj.freqpoint.Modulate;
freqpoint.Symbolrate = obj.freqpoint.Symbolrate;
return * this;
}
/*
****************************************************************
struct : interipqam
****************************************************************
*/
typedef struct interipqam
{
IPQAM qam;
std::vector<interfreqpoint> freqpointarray;
// CSrmCritSec sec;
interipqam(const interipqam & obj);
interipqam();
~interipqam();
interipqam & operator=(const interipqam & obj);
}INTERIPQAM;
interipqam::interipqam(const interipqam & obj)
{
*this = obj;
}
interipqam::~interipqam()
{
freqpointarray.clear();
}
interipqam::interipqam()
{
qam.szDistrictName[0] = 0;
qam.szIpAddr[0] = 0;
qam.szName[0] = 0;
qam.szNote[0] = 0;
}
interipqam & interipqam::operator=(const interipqam & obj)
{
INTERFREQPOINT objFp;
int32 nCnt = obj.freqpointarray.size(),nLoop = 0;
strcpy(qam.szDistrictName,obj.qam.szDistrictName);
strcpy(qam.szIpAddr,obj.qam.szIpAddr);
strcpy(qam.szNote,obj.qam.szNote);
strcpy(qam.szName,obj.qam.szName);
freqpointarray.clear();
for(nLoop = 0;nLoop < nCnt; nLoop++)
{
objFp = obj.freqpointarray.at(nLoop);
freqpointarray.push_back(objFp);
}
return *this;
}
int main(int argc, char* argv[])
{
_CrtDumpMemoryLeaks();
printf("Hello World!\n");
return 0;
}
yangyi
|
|
|
|
|
The source code is as follows.
#include "stdafx.h"
#include <stdio.h>
#include <vector>
#define _CRTDBG_MAP_ALLOC
#include<stdlib.h>
#include<crtdbg.h>
typedef struct ipqam
{
char szName[50];
char szIpAddr[50];
char szDistrictName[50];
char szNote[255];
}IPQAM;
typedef struct freqpoint
{
char szName[50];
// added by yangyi,2006-8-23
int Modulate;
int Freq;
int Symbolrate;
char szNote[255];
}FREQPOINT;
/*
****************************************************************
struct : interfreqpoint
****************************************************************
*/
typedef struct interfreqpoint
{
FREQPOINT freqpoint;
// CSrmCritSec sec;
interfreqpoint();
interfreqpoint(const interfreqpoint & obj);
~interfreqpoint();
interfreqpoint & operator=(const interfreqpoint & obj);
}INTERFREQPOINT;
interfreqpoint::~interfreqpoint()
{
}
/*
function : constructor
*/
interfreqpoint::interfreqpoint(const interfreqpoint & obj)
{
*this = obj;
}
/*
function : constructor
*/
interfreqpoint::interfreqpoint()
{
this->freqpoint.Freq = 0;
this->freqpoint.Modulate = 0;
this->freqpoint.Symbolrate = 0;
this->freqpoint.szName[0] = 0;
this->freqpoint.szNote[0] = 0;
}
/*
function : overload =
*/
interfreqpoint & interfreqpoint::operator=(const interfreqpoint & obj)
{
strcpy(freqpoint.szName,obj.freqpoint.szName);
strcpy(freqpoint.szNote,obj.freqpoint.szNote);
freqpoint.Freq = obj.freqpoint.Freq;
freqpoint.Modulate = obj.freqpoint.Modulate;
freqpoint.Symbolrate = obj.freqpoint.Symbolrate;
return * this;
}
/*
****************************************************************
struct : interipqam
****************************************************************
*/
typedef struct interipqam
{
IPQAM qam;
std::vector<interfreqpoint> freqpointarray;
// CSrmCritSec sec;
interipqam(const interipqam & obj);
interipqam();
~interipqam();
interipqam & operator=(const interipqam & obj);
}INTERIPQAM;
interipqam::interipqam(const interipqam & obj)
{
*this = obj;
}
interipqam::~interipqam()
{
freqpointarray.clear();
}
interipqam::interipqam()
{
qam.szDistrictName[0] = 0;
qam.szIpAddr[0] = 0;
qam.szName[0] = 0;
qam.szNote[0] = 0;
}
interipqam & interipqam::operator=(const interipqam & obj)
{
INTERFREQPOINT objFp;
int nCnt = obj.freqpointarray.size(),nLoop = 0;
strcpy(qam.szDistrictName,obj.qam.szDistrictName);
strcpy(qam.szIpAddr,obj.qam.szIpAddr);
strcpy(qam.szNote,obj.qam.szNote);
strcpy(qam.szName,obj.qam.szName);
freqpointarray.clear();
for(nLoop = 0;nLoop < nCnt; nLoop++)
{
objFp = obj.freqpointarray.at(nLoop);
freqpointarray.push_back(objFp);
}
return *this;
}
int main(int argc, char* argv[])
{
_CrtDumpMemoryLeaks();
printf("Hello World!\n");
return 0;
}
yangyi
|
|
|
|
|
If you hide the for loop in InterIpqam::opertator=(),and then you rebuild and debug it, you maynot find the memory leak prompt in output box. Why?
I am very puzzled.
yangyi
|
|
|
|
|
- When you post code, can you (please) use a setting where your
#include angle brackets don't get converted to tags - the "Ignore HTML tags in this message (good for code snippets)" checkbox should be checked - There will be no memory leaks in the code you've posted - it doesn't actually use any of your
struct s - I added some code to instantiate some
interipqam items and assign them - there were no memory leaks that I could see. I think you can be reasonably confident that std::vector works as advertised, at least as far as allocating memory goes.
|
|
|
|
|
Firstly, thanks for your answer.
Secondly, let me go on with my question.
Of course, I know it not creat any objects, so it doesn't have any memory leak.
But in vc's output when you debug it, you may find memory leak prompt info.
I copy the prompt info here.
Detected memory leaks!
Dumping objects ->
{42} normal block at 0x00441F70, 33 bytes long.
Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD
{41} normal block at 0x00441FC0, 40 bytes long.
Data: < |L > 14 7C 4C 10 16 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
So I wonder why?Can u tell me the cause? Thanks
yangyi
|
|
|
|
|
I didn't have any memory leak information when I ran your code. However, to find the source of those leaks, you could try using _CrtSetBreakAlloc to get the runtime to break when the relevant memory allocation is performed. Looking at your text, you need to look for allocations 41 and 42 (the numbers inside the curly brackets).
However, I think you'll find those allocations are made by the C runtime library *before* your code is ever called (I compiled a console application with the line int* a = new int; and that was allocation number 88), so they aren't allocations you need to worry about, because the runtime library clears them *after* your code exits.
|
|
|
|