|
No idea where line 622 is. So I would suggest reading about "Return Values" and making proper use of them.
Todd Smith
|
|
|
|
|
Hi there
The line 622 in atlbase.h is the -> operator of the CComQIPtr< > class template, and I don't see you are using any instance of it in the code you posted, so I suggest you to open the "Call stack" (Alt + 7) when you get the assert, and follow you way up until you reach the line in your code which is calling the -> operator on an instance of CComQIPtr<>, and then take a look why that pointer is NULL.
Regards,
Fabian
|
|
|
|
|
A long time ago I came up with a bunch of COM interfaces that were all defined in one IDL file. I created a number of COM objects that supported those interfaces by having the object's IDL file include the first idl file. It worked. All was well with the world.
Now, I am trying to make some changes, so I created a Ixxxx2 interface that inherits from Ixxxx in that first IDL file. When I try to get my ATL object to inherit from Ixxxx2 I get compiler error C2504, base class undefined. I've compiled the new version of the IDL file. The new interface is defined exactly the same in the .h file as all the other older interfaces. What am I doing wrong?
Thanks,
Tim
|
|
|
|
|
Hello everybody,
I am a beginner in com programming, and i have a question:
I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok.
but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement:
MyString = "Hello world!";
compiler generates following error:
error C2065: 'MyString' : undeclared identifier
what is the problem? do you think i should use a special syntax?
if so, would you please help me to know how i can use it?
thanks in advance
Roozbeh
|
|
|
|
|
Hi
I made ActiveX and it work fine.But some stranger behaviour is appeared.I compiled my project under Win2000 and then try register this component under Win98, raised error 0x000045a.But when i compile my project under Win98 ,this component registered fine both Win98 and Win2000.
Where trouble here??
Thanks.
|
|
|
|
|
at a quick glance, the error 0x000045a - "A dynamic link library (DLL) initialization routine failed" is probably
caused by differences in a DLL's version (methods, behaviour) between win98 and win2000. When compiling on win2000,
the compile initialization routines may be calling entry points
that are not in the older win98 version of the DLL in
question.
You may want to create an installation program (setup.exe)
with a tool (like installshield or wise or whatever) when
moving from a newer OS to an older OS. these install
programs identify the required versions of the needed
dlls and prompts you to install them during running
og the setup.exe program.
hope this helps at least a little bit.
sas
|
|
|
|
|
what is the preferred way to share instantiations between
different "instances" of the explorer shell (explorer.exe)?
I have read the Dunn articles on shell programming and
can't seem to share object instantiations between
explorer.exe "instances".
I have a ATL created shell extension that implements the
context menu interfaces and in a single instance
of the explorer, the code works fine;
If i fire up a second instance of explorer.exe
from the start task bar, and right click
on a file, the code crashes, and the debugger
takes me to the windows malloc.c src file.
my memory model is such that I keep instantiated objects in
the main application object (derived from public CWinApp),
and want to use these objects from the new instances
of the coclass that implements the IShellExtInit interfaces.
I have used the SHGetMalloc call to get an IMalloc interface
and use that for my mallocs.
one of the objects is a iDispatch class generated from
a typlib via the class wizard.. other classes are straight C++
impl classes that hold session data.
--
Any help is appreciated!
-
steves
sas
|
|
|
|
|
From my experince on shell extension you should never initialise anything during InitInstance or thread attach/detach calls.
All initialization should be in the IShellExtInit interface implementation only.
The call to initinstance is very unpredictable and should not be used to initialise internal data.
For example, When the dll it registered, at that time too initinstance is called, and your design could fail if you are assumeing that initinstance is called due to loading of dll by explorer.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
thanks for the reply.
THe IshellExitInit initialize method is called each time
the file's context menu is displayed;
At the very least, I need to to persist certain data in memory
across context menu invocations (which works, btw).
best case
scenario is when I can persist data in memory across
invocations of the explorer.exe
(which I can't get working yet)
Has anyone had experience with doing the above, short
of serializing and deserializing at every menu
IshellExitInit::initialize call?
sas
|
|
|
|
|
Are you tring to presist interface pointer(s) across different instance of the explorer ?
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
thanks again for the help.
I'm trying to persist instations of
native contructs (like stl maps)
and a straight C++ class instantations across
different "instances" of explorer.exe. by "instances"
of explorer.exe I mean invocations from the start menu
(looking in the task manager process table; there is only
one explorer.exe process however).
from what i understand, IShellExtInit releated coclass
gets created every time the user right clicks on a
file name (bringing up the context menu). I want these
instances of the coclass to be able to access
my instantiations of my straight C++ class
that lives at the app level (CWinApp dervied class).
i'm pretty sure my problem is memory related;
--
is there a good description on how the shell works
when executing a new isntance of the explorer?
It appearsthat the Esposito Shell programming book
is out of print; this book probably has good info in it.
--
any info is further appreciated.
sas
|
|
|
|
|
Hi,
I'm writing my first ATL control that will be used inside an HTML page. I used the project wizard to create a simple control, I build it and tested it in the ActiveX test container. Now I want to start making my own changes and stepping through the code a bit to see how it works. How can I test a control and set breakpoints in the Visual Studio debugger so that it stops at that point, just like a 'normal' program? Thanks.
|
|
|
|
|
Never mind, I found it (found an article on how to debug a service, it's the same for an activex control): Tools->Debug processes, attach to tstcon32 process.
|
|
|
|
|
You can also for a break point using __asm int 3 . That'll halt the program and show you the "program has crashed dialog, do you wish to debug?"-dialog. From there you can attach to the program which embeds your control.
--
Booohoo!
|
|
|
|
|
Aha, I didn't know I could do that from an ActiveX control as well. Thanks!
|
|
|
|
|
Or set the tstcon32 as the executable for the debugsession.
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
It keeps getting better Thanks!
|
|
|
|
|
I have an MFC Extension-DLL which includse various controls I'd like to use in various places.
When I use it in MFC applications it works.
When I use it in ATL-Dlls it works, the wizard replaces several core methods in the Dll (DllCanUnload, etc) create a CWinApp object and all is well.
It seems like I can't use my beloved MFC-Extension-DLL in an ATL Executable project.
Excerpt:
Executable (EXE)
Select to create a local out-of-process server. This option does not allow support for MFC or COM+ 1.0. It does not allow for the merging of proxy/stub code.
Why is this ?
Is there a way to get pass this limitation ?
|
|
|
|
|
Hi,
I was developing an ActiveX control that is to be embedded in IE. While trying to implement, I ran into this problem: I thought capturing the WM_DROPFILES message should be sufficient for providing drag and drop support of files (from file explorer) to the ActiveX control. While this works if the control is embedded in a thick client (say a VB form), it doesn't work when the control is embedded inside IE. IE's default handling of dropped files kicks in and it tries to open the file!
I tried to look for help from the usual sources (MSDN, google etc) but most of them deal with MFC drag and drop support while I am using ATL and can't use any of those. Any help here would be greatly appreciated!
Thanks,
KR Nathan
|
|
|
|
|
Hi
To have drop capabilities, a control must implement IDropTarget interface and regiter itself as a drop target using the RegisterDragDrop function.
Fabian
|
|
|
|
|
Thanks for this info. However, looking at the IDropTarget, it looks like much more sophisticated than what I require. When files are dragged from explorer and dropped, I just need to know the filenames of the dropped files so that I can show them in a list inside my control. WM_DROPFILES does exactly same but doesn't seem to be working when the control is placed inside IE.
Thanks for your help.
|
|
|
|
|
Hi,
I have created a ATL component in a MFC application with Add Class wizard. Now i will instantiate an object from this component in a thread, and i have included component header file in that thread's .cpp file however the compiler generate error for unknown IID and i do not know which file must be included that solve my problem?
Alireza
|
|
|
|
|
Hi
I am a beginer VC++ programmer. I have a question:
What is ATL and how can use its.
Are you know the meaning of "MARZOGH"?
If YES,Please send for me.
|
|
|
|
|
i am in need of a good tutorial on installscript,working with scripts,extensibility, custom dialogs for working on
dev studio 9 on a installshield project.
But on web it seems no good tutorials are available.everything points to books from installshield.com
Advise.
Thanks
Suman ray
|
|
|
|
|
I need to be autentificated by a server before I can download a file from this site. I dont know how.
The server adress that auentificate me is like this:
http://www.xxxx.com/user=xx&psw=xx
when my browser gets to this url is redirected to other page that give me the links to the files I want to downlaod.
Im trying to use the method URLDownloadToFile to get this files, but I need to autentificate my self first and I dont know how, can some body help me plz tks.
|
|
|
|