|
Hi,
My worker thread is halted inside the method call. After the method call is completed(exited), then the worker thread continues executing. Any ideas?
Thanks,
|
|
|
|
|
I suspect a serious design issue here since you're talking about global variables and calls from worker threads...
What are you trying to do? Explain the call chain and what gets called from where.
Are you by any chance calling the server from the worker thread inside the ActiveX?
Why have decided that you need a worker thread?
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Where does it halt inside the method; on what statement?
Steve
|
|
|
|
|
Hi,
Basically I have the following.
An ActiveX Server with a worker thread that is reading data from the serial port and a Client application that is calling a ActiveX server method thats sends a command to the serial port to stop transmitting data. Inside the worker thread it checks if there is no more data received and sets a flag. I need to check this value inside that method call after sending the command to verify it has received that flag from the thread. However, the worker thread is called right after the method completely exits and returns back to the client. Is there a proper way of doing this?
Thanks
|
|
|
|
|
I need to embed an excel worksheet in a dialog.
¿How do I obtain the header file for the excel.exe library? Do I need the idl? can I generate an .idl from the excel.exe binary?
Thanks!
|
|
|
|
|
Miguel A. Vilariño wrote: I need to embed an excel worksheet in a dialog.
¿How do I obtain the header file for the excel.exe library? Do I need the idl? can I generate an .idl from the excel.exe binary?
Try to get the Interface of the Excel application and use the methods of that..
import the .exe or .tlh like
#import "D:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" raw_interfaces_only, raw_native_types, no_namespace, named_guids I haven't tried this but i think it should work.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I'm building an Activex control to be embedded inside HTML <object> tag, and I'm building this using Visual C++. However, I would like to control how the object is created so there can not be more than one object instantiated even if the user open the same web page in a different browser window. For COM objects there is a AddRef function but I'm not sure how would I use it in this case so if the same object is trying to instantiate itself it will generate an warning message to the user.
Also, I would like to detect and control the interaction between IE and the Activex control so the "back" "refresh" and "stop" buttons in IE can be handled more gracefully. Another thing I want to detect in the control is when the user close the web browser altogether, since I want to shutdown the worker threads in the control.
Where can I find more information or example that will point me to the right direction? I've tried searching in various MSDN sites but not much luck.
Any information will be helpful! Thanks for your time!
|
|
|
|
|
This property is readonly in IHTMLElement interface.
is there another way?
Thanks!
|
|
|
|
|
Oh,I'm wrong.
Though the style property is readonly,the style interface's member is writable.
|
|
|
|
|
Hi,
I'm working in VC++ 6.0 and am trying to compile the sample application at
http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx[^]
It's a MFC wrapper class for the SHBrowseForFolder API. I'm having trouble resolving some of the compiler errors. I created a .dsw project file from the .sln and .vcproj files using http://www.codeproject.com/tools/prjconverter.asp[^]
Some of the compiler errors are below:-
D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlbase.h(566) : error C2787: 'IShellFolder' : no GUID has been associated with this object
D:\temp\FolderPick\FolderDlg.h(133) : error C2504: 'IFolderFilter' : base class undefined
D:\temp\FolderPick\FolderDlg.cpp(101) : error C2065: 'StrRetToBuf' : undeclared identifier
D:\temp\FolderPick\FolderDlg.cpp(145) : error C2065: 'BFFM_IUNKNOWN' : undeclared identifier
D:\temp\FolderPick\FolderDlg.cpp(145) : error C2051: case expression not constant
D:\temp\FolderPick\FolderDlg.cpp(175) : error C2065: 'IFolderFilterSite' : undeclared identifier
D:\temp\FolderPick\FolderDlg.cpp(175) : error C2955: 'CComQIPtr' : use of class template requires template argument list
D:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE\atlbase.h(715) : see declaration of 'CComQIPtr'
Where would the GUID of IShellFolder be?
Would appreciate any help.
Thanks,
Mel
|
|
|
|
|
melwyn wrote: Where would the GUID of IShellFolder be?
Should be in comdef.h, so you might need to include that before including atlbase.h;
Out of interest, have you downloaded and installed the Feb2003 PSDK?
Steve S
Developer for hire
|
|
|
|
|
Thanks for your reply.
Found IShellFolder in that file, but now it can't find CComQIPtr and IFolderFilter.
(By the way, nowhere in the project is atlbase.h explicitly included, probably comes indirectly through some other header file. So, I included comdef.h in Stdafx.h)
Yes I have Feb 2003 PSDK installed. Does that have some issue?
Thanks,
Mel
|
|
|
|
|
melwyn wrote: Found IShellFolder in that file, but now it can't find CComQIPtr and IFolderFilter.
(By the way, nowhere in the project is atlbase.h explicitly included, probably comes indirectly through some other header file. So, I included comdef.h in Stdafx.h)
Erm, most of my ATL stuff has the include for atlbase.h in stdafx.h, followed by a module definition, then the rest of the ATL headers I'm using.
melwyn wrote: Yes I have Feb 2003 PSDK installed. Does that have some issue?
Yes. It includes later header files and libs, as well as a later version of the MIDL compiler. It also happens to be the last version supporting VC6, if that's important.
Steve S
Developer for hire
|
|
|
|
|
Doh! Having re-read the thread, you aren't using ATL, so "OOPS".
However, the IFolderFilter is defined in SHOBJIDL.H, and CComQIPtr is defined in ATLBASE.H too. It might be causing a problem if IFolderFilter isn't defined first, so try
shobjidl.h
comdef.h
atlbase.h
in your stdafx.h
It works here.
Steve S
Developer for hire
|
|
|
|
|
Including atlbase.h took care of CComQIPtr.
However I don't have shobjidl.h anywhere on my machine. Is that something that would come only with VC 7, looks that way atleast. (On a different note, I don't have "comdefsp.h" either...i think these are VC 7 files).
I tried including shlobj.h but didn't help.
|
|
|
|
|
You should have SHOBJIDL.H and SHOBJIDL.IDL in the platform SDK include directory.
Of course, you need to make sure that VC6 is looking in there before it's own directories, and the same for the LIB files (although you may not need them in this project).
Steve S
Developer for hire
|
|
|
|
|
Hi,
I have created an inproc COM server dll which displays a Window. WTL has been used to create the Window. This window houses a custom built TreeView control.
I have created a client which uses this COM Server. the functions which inserts child treenodes is defined in the erver thus:
IDL
[id(3), helpstring("method InsertTreeChild"), local] HRESULT InsertTreeChild([in] BSTR Text,[in] BSTR Data,[in,unique] void* ParentItem,[out] void** ChildItem);
.h
STDMETHOD(InsertTreeChild)(BSTR Text, BSTR Data, void* ParentItem, void** ChildItem);
Now how do I set ChildItem so that the address of Child item is passed to the Client. Currently I am doine something like..
*ChildItem= (void*) treeNode ;
but the value of ChildItem is 0x000000 when the function returns to the client although it gets set in the Server.
Can anyone explain why this is happening?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: IDL
[id(3), helpstring("method InsertTreeChild"), local] HRESULT InsertTreeChild([in] BSTR Text,[in] BSTR Data,[in,unique] void* ParentItem,[out] void** ChildItem);
This looks like the interface of the server is a dispatch interface since the method has an id.
If it is, you can only use data types that can be represented with a VARIANT and void is not among those data types.
If you are forced to use marshalling, e.g. due to server access from multiple threads, the marshaller don't know how to handle the unknown data type.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Roger Stoltz wrote: This looks like the interface of the server is a dispatch interface since the method has an id.
If it is, you can only use data types that can be represented with a VARIANT and void is not among those data types.
Ok, so then what member of the VARIANT type can I use to store a pointer?Is it VT_PTR ?
Thanks for your reply.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
-- modified at 4:26 Monday 29th May, 2006
|
|
|
|
|
TechyMaila wrote: Ok, so then what member of the VARIANT type can I use to store a pointer?
Well, to put it simple: you don't.
Why? Because it's a design issue. Your server should behave like a black box that solves a well defined problem. How the box looks inside should be hidden from "users" or clients. By exposing internal pointers to your client, you are putting some of the responsabilities of the server on the client which is undesirable.
I suggest you use an index instead.
You could even have an interface that enumerates the tree nodes, e.g. IEnumTreeNodes, that provides you with an interface for each tree node letting you manipulate each node, e.g. ITreeNode.
Perhaps I've misunderstood your problem. If this is the case, post again and explain it further.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Hi Roger,
Thanks a lot for replying. Well, I believe ITreeNode is the solution to my problem. Well actually, I gotta fill a tree view in the COM server from the client. Now that can only be done when I get the TREEITEM from the last InsertChild so that multiple levels of child nodes can be added. So to pass the pointer to a TREEITEM , I was trying using void** . If I am not allowed to use void , then what can I useto pass the address of HTREEITEM? My COM server is InProc.
Do you have anyother suggestions?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: what can I useto pass the address of HTREEITEM
If I've understood your problem correctly, you actually don't need to pass the address. You only need a way to keep track of the node that you got from the previous call to InsertChild(), right?
What I suggested in my previous post was to use an integer to be able to refer to the node you got from InsertChild().
An ugly solution, which I don't recommend, is to pass the address as a long and type cast it to a HTREEITEM pointer. This will work on systems that are 32-bit, but will surely fail if built for 64-bit systems, in other words not a very good solution.
Always design with distribution in mind. It will make your design better and protect you from unwanted surprises when your software is used where you didn't think it would be used.
A better solution is to still pass a 32-bit integer through the interface, but the integer is mapped to a HTREEITEM pointer that you keep in an internal map inside the server.
No need for overkill here, simply mask the HTREEITEM address with 0xffffffff to get the 32-bit identifier.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Alright!!! Thanks a lot for your help. I ahd never thought about 64 bit systems coz.. frankly, I have never seen one.
Anyways, thanks once again.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Hello!
I came accross the article http://www.codeproject.com/tips/dirclean.asp[^] which is about some handy utility. Shell extension DLL is provided. Can somebody please tell me how to register this shell extension trough console maybe? I really don't want to learn about shell extensions right now. All I want, is to use this utility.
P.S. I'm reposting this question in this message board. I made a mistake and post it to the C++ board.
Best regards,
Rostfrei
|
|
|
|
|
aren't you able to register the dll using regsvr32 ?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|