|
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
|
|
|
|
|
Thnaks, this did the job, but why did my function work on NT4/2000/XP. but on Win98 (and I presume on Win95) not, this was what confused me......?
Thnaks once again
Grüß Phil
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
The docs say that ::IsWindow() returns non-zero if the argument is a valid window. In one case, the O/S returns TRUE. In another case, the O/S is returning (possibly) the window handle, or something else, that is non-zero.
As a rule, the following:
BOOL condition = ::Windows_API_Call(...);
...
if (condition) {
...
}
is preferable to
if (condition == TRUE) {
...
}
since the Windows API (where BOOL is defined) tends to play fast-and-loose with BOOL return values. Often, they define the return value of an API call as BOOL (which you assume has only two values, TRUE and FALSE), when it would be better to specify it as a DWORD. The return value in that case means one thing when it is non-zero, and something else when it is zero.
Gary R. Wheeler
|
|
|
|
|
I have this code wich creates a Grid, this works using a wrapper class.
CdxDBGrid m_grid;
m_grid.Create(_T("TestGrid"),WS_CHILD|WS_VISIBLE, CRect(1, 2, 3, 4), this,
1);
So the question How do I achive the same as above but with a pointer. Or how do I create a View with my pointer.
IdxDBGridPtr m_pGrid
|
|
|
|
|
<br />
CdxDBGrid *m_pgrid;<br />
<br />
m_pgrid = new CdxDBGrid;<br />
if (!m_pgrid)<br />
{<br />
return error;<br />
}<br />
<br />
m_grid->Create(_T("TestGrid"),WS_CHILD|WS_VISIBLE, CRect(1, 2, 3, 4), this,1);<br />
<br />
delete m_pgrid;<br />
<br />
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
First I appreciate your answer. But What I really want to know is, if it is a good idea to use a Grid that resides in a DLL. And if so How do I create an Object of it. I did this but with MFC and the autogenerated wrapper classes and everything works OK but I don`t know how to use it in a ATL/WTL project. This is because if I try to use the generated class I get some error about undefined class.
|
|
|
|
|
How do I set my combos height wich resides in a DialogBox
|
|
|
|
|
First make a call GetDlgItem with the handle of the parent dialog and the ID of your combo box. This will return a handle to the combo box to you.
You can then use that handle in a call to MoveWindow to resize and move the combo box.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
The problem is when I click on the combos down arrow, it won`t display the list. The list does contains some items. But I can`t see them.
|
|
|
|
|
Bring up your dialog in the resource editor. Click on the dropdown and pull the sizing box downward to the size you want.
|
|
|
|
|
Thakn you for your answer.
Seems like everything it`s dificult not knowing how to do it
|
|
|
|