|
Shell extensions aren't automation servers, they don't need to implement IDispatch. It's odd that the shell is QI'ing for IDispatch in the first place, actually. My first suggestion is to remove IDispatch from the extension coclass.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
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
|
|
|
|
|
Right, I realize that they're not automation servers (I mean that automation servers exists in my library) but every example - including yours - leaves the default ATL stuff there (which extents IDispatchImpl). ATL put it there in the first place and it's never caused problems with the many other shell extensions I've written (what can I say, I'm never content). I agree that it's not needed, though.
I'll try removing that, however, and see what happens. Thanks for the tip.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Even after removing everything related to IDispatch, the problem persists: IShellExtInit::Initialize is called many times, with different addresses for the parameters, until the runtime finally throws an exception, such as the ol' access violation for reading memory at NULL.
The IShellExtInit::Initialize implementation is exactly as yours is.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
i made an ATL/Com project and it works just fine in debug mode but when im trying to build Win32 Release MinDependency, i get this error:
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseMinDependency/Tokenizer.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
any suggestion?
|
|
|
|
|
MSDN Q291952 should solve this;
You could try the MinSize version to verify it builds first.
Steve S
[This signature space available for rent]
|
|
|
|
|
|
This is answered in the VC forum FAQ.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
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 a lot, that solved the problem.
|
|
|
|
|
I'm trying to get a file name. Sound easy enough.
CString strFileName;<br />
static TCHAR szFilter[] = "Comma Delimited (*.csv)\0*.csv\0All Files(*.*)\0*.*\0\0";<br />
<br />
GetDlgItemText(IDC_EDIT_LOOKUP, strFileName);<br />
<br />
CFileDialog dlg(TRUE, NULL, strFileName, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_FILEMUSTEXIST , szFilter, NULL);<br />
<br />
if(dlg.DoModal() == IDOK)<br />
{<br />
TCHAR szFileName[MAX_PATH + 64];<br />
dlg.GetFilePath(szFileName, MAX_PATH + 64);<br />
<br />
SetDlgItemText(IDC_EDIT_LOOKUP, szFileName);<br />
}
The problem is when I call GetFilePath, I get an ATLASSERT, because the window handle is 0. I thought this should be straight forward. Everything else is populated okay, but clicking OK seems to kill the window handle before I get the file name. Or should I be calling a different function.
|
|
|
|
|
Try this in place of dlg.GetFilePath:
lstrcpy(szFileName, dlg.m_szFileName);
|
|
|
|
|
Ed Gadziemski wrote:
Try this in place of dlg.GetFilePath:
lstrcpy(szFileName, dlg.m_szFileName);
I did not bother trying that as its a protected member. But it works.
|
|
|
|
|
m_szFileName is a public member, defined as follows:
TCHAR m_szFileName[_MAX_PATH]; // contains full path name after return
The reason GetFilePath asserted is that you referenced it after the dialog function returned. It no longer has a valid handle at that point.
|
|
|
|
|
Ed Gadziemski wrote:
m_szFileName is a public member, defined as follows:
Yep, I see what I did wrong now. When I browsed to the member, I ended up on the MFC Version, rather than the ATL version. In MFC its protected. I'll know next time to check which one I'm looking at.
Thanks for all your help.
|
|
|
|
|
GetFilePath() is only for use when writing a hook (notice how the method sends a window message). To get the selected file after the dialog is closed, look at the m_szFileName memeber of CFileDialog.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
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. I've since found examples of how its typically used when sub classing, which I suppose what templates are all about.
I'm new to WTL, and am still working out the differences with MFC. Getting there though.
|
|
|
|
|
I am using ATL/COM in visual C++. I want to ask that what is the difference between ReleaseMinSize build and ReleaseMinDependency build. I want to distribute my DLL such that no other DLL should be required. I am also using MFC support for that component.
The difference I noticed between two was that ReleaseMinSize generate DLL larger in size than MinDependency. From this I think that MinSize require no other DLL to be distributed and RealaseMinDependency require DLLS to be given with my DLL.
Any IDeas
Ahsan
Ahsan
|
|
|
|
|
I have a code statements using STL and CString of MFC in VC6:
#include <vector>
#include <afx.h>
int FindString(LPCTSTR lpszFind)
{
/**
strs is defined as vector<CString>,
it is modified out of there
*/
vector<CString>::iterator pos;
pos = find(strs.begin(), strs.end(), lpszFind); // Error line
....
}
The building error:
error C2440: '=' : cannot convert from 'const class CString *' to 'class CString *' Conversion loses qualifiers
|
|
|
|
|
It would help if you used the <> buttons below, so we could see your template arguments and includes.
What on earth is m_lstPy ? Are you trying to use STL to do a find within a string, or what ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
OK. Try declaring pos as
vector<CString>::const_iterator pos;
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I've got an app, generated with the ATL app wizard in VC7.
Now it was compiling fine, until I added a CSting object to a function, and now it gets upset, saying it does not know what one is, yet I know CString is in ATL now.
Any ideas what could be happening? I'm getting error C2065 - undeclared identifier.
Anyone know which header file its in so I can include it explicitly?
|
|
|
|
|
It's quite obvious - and mentioned in the help for CStringT
#include <atlstr.h>
Bjørn.
|
|
|
|
|
Bjoern Graf wrote:
It's quite obvious - and mentioned in the help for CStringT
Ahh yes
Must remember to turn my brain on.
|
|
|
|
|
Also, if you even include <atlmisc.h> (which defines the WTL CString, CRect, etc.) then it may conflict with the ATL7 version. If you want to use the ATL7 CString AND you still need <atlmisc.h> then do the following in stdafx.h:
#define _WTL_NO_WTYPES
#define _WTL_NO_CSTRING
#include <atlmisc.h>
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
It worked without, but I'll use it anyway.
Thanks,
Giles
|
|
|
|
|
I've worked a lot with COM and ATL (thank goodness for ATL), but I'm not clear on what WTL is. I've used templated classes like CWindow and what not. Is that WTL and I've been using it unknowningly? I plan on using all that stuff for a current project I'm working on, but would like to use WTL.
I'd appreciate any comments. The MSDN documents don't really talk much about WTL as a topic, so I'm guessing it's just certain classes within ATL, but I could be wrong.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|