|
I am working on a ATL Com object. I want to ask what is the difference between ReleaseMinSize and ReleaseMinDependency. I observed that size of ReleaseMinDependency is much less that ReleaseMinSize. I am interested in both reducing size as well as distributing minimum DLL's with my DLL.
Can any one tell the difference
Ahsan
|
|
|
|
|
With RelMinSize your code links to atl.dll and the CRT DLLs. What I do is build RelMinDep so I don't have to worry about shipping other DLLs, then set the compiler optimizations to minimize size (default is maximize speed) and add the linker switch /opt:nowin98 which shaves a few more K off the binary's size.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I did do a few worker/window threads with MFC but I don't have a clue where to start so I can use threads with ATL...
Can someone point me to a tutorial or some doc?
Thanks!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
There is no thread wrapper class, you just use _beginthread() or _beginthreadex() to create new threads.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks Mike!
Although I get this error when trying to use _beginthread()
error C2664: '_beginthread' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void *)'
I did follow the example on MSDN, my function doesn't return any value but it won't work!!!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
As the error message says, your thread func has the wrong signature. It takes a void* (not void) and needs to be declared with the __cdecl calling convention.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Wouldn't it be better to use CreateThread() to minimize the CRT (and perhaps elminate the need for it)?
--
Please state the nature of your medical emergency.
|
|
|
|
|
I don't think I've ever made a non-trivial ATL project that didn't use the CRT. I always use a string function, or an STL collection, or something. So I personally don't care about keeping the CRT out and saving what, 40-50K?
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
All I want to do is to use atlgdi.h but things get bad when I include atlapp.h. I can't get the project to compile, I always get this error:
unresolved externals... CAppModule or CServerAppModule...
Anyone has a bulletproof stdafx.h?
I'm going mad!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
Here's what my typical WTL project uses
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#if !defined(AFX_STDAFX_H__F9127740_BA37_42DC_8669_904CB2CFC7D4__INCLUDED_)
#define AFX_STDAFX_H__F9127740_BA37_42DC_8669_904CB2CFC7D4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define STRICT
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#define _ATL_APARTMENT_THREADED
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
#include <atlcom.h>
#include <atlwin.h>
#include <atlapp.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atlmisc.h>
#include <atlcrack.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__F9127740_BA37_42DC_8669_904CB2CFC7D4__INCLUDED)
<b>Todd Smith</b>
|
|
|
|
|
Whenever you use anything from ATL and WTL (well, anything beyond the simple wrapper classes like CComPtr) you must have a global variable called _Module , similar to how MFC apps must have a global CWinApp object. Just make a dummy project with the AppWizard and copy the #includes from the stdafx.h that the wizard generates.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
That's what I did and I always get an unresolved external with this command:
extern CServerAppModule _Module
I also tried:
extern CAppModule _Module
There's no lib to link, right?
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
Just like with any global variable, you also need to define the variable in one of your CPP files.
CAppModule _Module;
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Sh*t hits the fan when you combine ATL7 and WTL7 in a COM-dll project..
ATL7 uses totally different "module"-strategy than ATL3. WTL7 however relies on the old ATL3-strategy.
What you need to do then is to
#include <atlheaders.h>
#define _Module (*_pModule)
#include <wtlheaders.h<
#undef _Module
--
Please state the nature of your medical emergency.
|
|
|
|
|
Hello,
I have a resizable dialog with a group box control. Resizing is done via WTL's classes & macros. It looks like the group box control's background is not repainted neither initially nor after resize. Does anybody know how work around this problem?
Thanks.
--Daniel
|
|
|
|
|
Groupboxes do not peacefully coexist with the WS_CLIPCHILDREN window style when resizing. You can remove the clip children style from the property page, but be prepared to suffer some screen flicker.
|
|
|
|
|
I am trying to develop an ATL Web Service. It works fine on Win2000, but I want to deploy it on a NT Server machine with .NET framework installed.
Unfortunatelly, trying to add a web reference from a client application to the server will give me http 500 error.
Are there any tricks to be performed or is it just not possible?
Thanks!
Best regards,
Alexandru Savescu
|
|
|
|
|
Is this the same as trying to create a virtual directory for an IIS server on NT 4? If so, I've got a VB script that works.
|
|
|
|
|
It has nothing to do with the virtual directory. I can create that manually and it works fine.
I have also tried to make an ATL Server application (not WebService). Trying to access the srf file gets me the following error "The remote procedure call did not execute"
Any ideas? According to the documentation one can create ATL Server application on NT 4 Server. Maybe there is also something they forgot to mention....
Best regards,
Alexandru Savescu
|
|
|
|
|
I´m trying to show the Folder dialog. Does any body knows where can I get a sample ATL/WTL project with this.
|
|
|
|
|
SHBrowseForFolder() is the API. There are wrapper classes here on CP (but I haven't looked to see which ones use ATL.)
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Yes, I have the following Function wich calls the BROWSEINFO API, but when I run this on Win98 I get an exception, but on winME everything works OK. Can somebody help me solve this problem.
BOOL folderDialog(const HWND parent, const char *topic, char *result, const bool allowNew, const int extraFlags)
{
// CoInitialize must be called to support BIF_USENEWUI.
OleInitialize(NULL);
LPMALLOC pMalloc = NULL;
LPITEMIDLIST pidl = NULL;
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));
// set the bi's default values
bi.hwndOwner = parent;
bi.lpszTitle = topic;
bi.ulFlags = BIF_STATUSTEXT | extraFlags;
if (!allowNew)
{
bi.ulFlags = bi.ulFlags;
}
pidl = SHBrowseForFolder(&bi);
if(pidl != NULL)
{
SHGetPathFromIDList(pidl, result);
// free memory
if (FAILED(SHGetMalloc(&pMalloc)))
{
throw "SHGetMalloc Failed!";
}
pMalloc->Free(pidl);
pMalloc->Release();
OleUninitialize();
return (BOOL)strlen(result);
}
OleUninitialize();
return FALSE;
}
|
|
|
|
|
Check the MSDN. One or more of the functions you are calling may not be implemented by the Win98 shell.
Gary R. Wheeler
|
|
|
|
|
While testing my application (a Win32 dll using WTL/ATL not a COM server, that exports functions to a mfc app) on Win98 I have had the following problem.
Under Windows XP/ Win 2000 the following works fine, and as expected
if(pPage->m_hWnd != NULL && ::IsWindow(pPage->m_hWnd) == TRUE){
_sError.Format("%s %d", "Showing page ", pPage->m_nPageID);
::MessageBox(NULL, _sError,"",MB_OK);
pPage->EnableWindow(TRUE);
pPage->ShowWindow(SW_RESTORE);
bResult = pPage->OnSetActive();
}
however under win 98, ::IsWindow always returns FALSE, regrdless.... has anyone a workaround for this as (I think?) it adds a bit more safety. I have even tried pPage->IsWindow(), but this also fails
Anyone had similar problems?
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
I don't really think this is the problem, but it costs nothing to give it a try: replace your check with
if(pPage->m_hWnd != NULL && ::IsWindow(pPage->m_hWnd)){
... Note the docs say the result on success of IsWindow is nonzero, which is not the same as being equal to TRUE .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|