|
Hi,
Just wanted to say thank you and it works like a charm.
|
|
|
|
|
not working(automation error).
|
|
|
|
|
The reason that this is happening is because VC++ 2005 Express does not
have resource editor. WTL App Wizard is trying to open dialog template
in resource editor, and that fails.
It is not as bad as it looks - all files and the project are created
after this error, and if you open the project in VC++ 2005 Express, it
will build just fine.
Cheers,
Nenad
Share our software. Love Programming, Love Life.
|
|
|
|
|
Managed to get as far as linking. BTW in case it helps someone, the resource compiler also needs the WTL and PSDK include directories defined in Configuration properties/Resources/General/Additional include directories and don't forget to add the additional library directories too in Configuration properties/Linker/General too. Oddly, I also had to add winuser.h to my wizard-generated .rc file to avoid compiler errors.
However I'm now stuck with this linker error;
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
Can anyone help?
JG
|
|
|
|
|
Answering my own question to save anyone else the effort.
This error occurs if you are using CRT functions that require CRT startup code. Changing "Minimizing CRT use in ATL3" to "No" fixed it. Hoorah, it now works.
|
|
|
|
|
where can I setup the order of the lib files?
Thanks
|
|
|
|
|
I got everything working, and can compile the WTL sample programs. I tried out the radasm resource editor suggested on this web page, but am having problems. This resource editor is the same one that is packaged in the C++-IDE MingGW Studio at http://www.parinyasoft.com.
It edits the rc files OK, but after saving the rc file, it is completly changed. After the change the Visual C++ 2005 express edition resource compiler won't compile the resource.
I used the radasm resource editor ResEd.exe to edit the MDI.rc file in the MDIDocVw sample. This is the error I get when I try to compile with the new rc file.
".\MDI.rc(17) : error RC2104 : undefined keyword or key name: IDOK"
OK this is a pretty simple error, so I added definitions for IDOK and all other missing key names to the resource.h file, now I get this error.
"rc.exe has generated errors and will be closed by Windows."
Has anyone modified a resource file with ResEd.exe and gotten it to succesfully compile with WTL and Visual C++ 2005 Express edition?
|
|
|
|
|
you must include "atlres.h"(WTL\include)
Try compile from command prompt,for example:
rc /v mdi.rc
|
|
|
|
|
Even if atlres.h is included, problem is still remains...
ResEd corrupts toolbars in VC resource files.
Maybe anyone knows another resource editor or what to do with ResEd?
|
|
|
|
|
Tested with WTL7.5 and WTL8.0.
Thanks.
Emil NEAGU
|
|
|
|
|
After following all your steps i tryed to compile a project (MSIE toolbar) which was writen in VC 2003.net. And i get the following error (plus errors because this _Module is not defined). Any help would be appriciated.
C:\Program Files\Microsoft Platform SDK\Include\atl\atlcom.h(3242) : error C2065: '_Module' : undeclared identifier
|
|
|
|
|
may be too late to reply this. anyway, i met same problem.
and here are some way to use CWindow class in MFC project.
you need to include atlbase.h and atlwin.h
and you need to create global variable of class CComModule (or derived) named _Module.
So minimum instrumentation needed to use ATL is the following:
stdafx.h or some other header
#define _ATL_APARTMENT_THREADED
class CExeModule : public CComModule
{
public:
LONG Unlock();
DWORD dwThreadID;
};
extern CExeModule _Module;
// _Module is visible in the atl headers now
and the implementation - WinMain() or some other initialization code
_Module.Init(NULL, m_hInstance);
_Module.dwThreadID = GetCurrentThreadId();
(thanks Dmitri Zhukov)
|
|
|
|
|
I used the wizard to generate a WTL MDI project with the Browser as the View type. On linking I get the error: cannot find atl.lib
Can we get around this too?
|
|
|
|
|
Change properties.
Project -> Properties -> Configuration Properties ->
General -> Project Defaults -> Use of ATL
"Static link to ATL"
Regards,
MB
|
|
|
|
|
Hello,
I followed all the instructions (including the one in the link you posted), and when I try to compile a WTL project, this is what I get:
<br />
atlbase.h(365) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int<br />
atlbase.h(365) : error C2078: too many initializers<br />
atlbase.h(365) : error C2143: syntax error : missing ';' before '<class-head>'<br />
atlbase.h(383) : error C2059: syntax error : ')'<br />
atlbase.h(383) : error C2143: syntax error : missing '(' before ')'<br />
I had the platform SDK (full install, Win2003 SP1) already installed on the PC before installing VC++ Express... Might this be the cause?
Best Regards,
FL.
|
|
|
|
|
No working form me. I have error's like Guybrush. I follow your instructions but not working. I install first Visual C++ 2005 Express Edition and after that PSDK.
|
|
|
|
|
Please send your atlbase.h to me. mailto:baryon at gmail.com
|
|
|
|
|
There are a editor miss in the code of atlbase.h.
correct:
<br />
#define AllocStdCallThunk() HeapAlloc(GetProcessHeap(),0,sizeof(_stdcallthunk))<br />
not good
<br />
#define AllocStdCallThunk() <br />
HeapAlloc(GetProcessHeap(),0,sizeof(_stdcallthunk))<br />
I will update this page to fix it
|
|
|
|
|
OK it's good now.
Thanks.
|
|
|
|
|
Hi, thanks for the reply.
I installed VC++ Express in my office's computer and I won't be there till Tuesday. I will keep you informed about it.
Many thanks,
FL
|
|
|
|
|
Sorry for the delay in replying.... It works now, of course... Many, many thanks!
Also, I am interested in using WTL with GCC so, if you decide to make a guide for it, I am one of those (many) people that are going to be VERY happy about it
|
|
|
|
|
I wonder if it would be possible to use WTL with MinGW. The nice thing about this approach is that using tools like MinGW Studio you have a small (50 MB), fast, free, self contained Development environment that can be used from an usb stick.
Since now I didn't know, that ATL ships with the platform sdk - I thougt it to be part of Visual Studio. So I copied the relevant headers to a new include dir.
But the compiler seemes to have some problems with #pragma statements, that are ms-vc-specific. Besides this warnings it refused to compile at all deep in some atl-headers. Is there a solution?
|
|
|
|
|
It can be done, I've done it in 2003, but unfortunatelly I don't have the work anymore. I had to patch atl 3.0 and wtl and the include files from mingw.
The only issue was __declspec(selectany), you have to use __attribute__(weak) or something like that, and the linker will use only one instance of that variable.
So a patch to atl, a patch to wtl and a patch to mingw's include files it's all that you have to do, the latter part is tricky because you need to find public reference for your changes.
I could do it again if there is demand for it...
|
|
|
|
|
cristianadam wrote: I could do it again if there is demand for it...
please do so! wtl with mingw would be great!
thanks in advance, sebastian
-------------------------------------------
My website: http://www.hartwork.org
|
|
|
|
|
I can not find atl in "include" folder, but there has a folder called "include\Win64\atl", I have installed "Core SDK", "Internet Development SDK" and "MDAC SDK", which compoment do I have to install?
Eric
|
|
|
|