|
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_
|
|
|
|
|
|
What does it mean when the value for the InprocServer32 key is garbled gibberish, as though it's been encrypted?
How does the system find the right component to launch when the value is scrambled like that?
I found this key in my registry:
HKEY_CLASSES_ROOT\CLSID\{0000002F-0000-0000-C000-000000000046}
Default - oleaut32.dll
InprocServer32 -
,(GnBmGFa=nZ7]6MJA+rGIANT_AntiSpyware_Files>M5KDYSUnf(HA*L[xeX)y<br />
GfXmE~Yz*@5HHM+Pw4D]AlwaysInstall>M5KDYSUnf(HA*L[xeX)y<br />
a7I{dV5R1@_YU_&e(5qUPSDK>M5KDYSUnf(HA*L[xeX)y<br />
*c4w146BQ9+]'zoDRy(dAlwaysInstall>M5KDYSUnf(HA*L[xeX)y<br />
ThreadingModel - Both
How does that work?
ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸
|
|
|
|
|
My guesses:
1. It's not really COM data, but some other kind of data being hidden in a very simple fashion.
2. MSAS made that change at install time as part of its protection, and it has a hook that watches for DLLs being loaded by COM, and undoes the obfuscation on the fly.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
hi,
how can we export data from Excel to Informix Database
|
|
|
|
|
Hi,
I have a Visual C++ application that controls the digital USB camera.
Currently this is done using camera's SDK.
I am looking for vendor-independent ways to communicate with digital cameras.
1. Does WIA API support viewfinder mode, i.e. can I have "live preview" from the camera in my application?
2. Can I communicate with digital camera directly through PTP (Picture Transfer Protocol) from my application, thus avoiding WIA?
Is there some kind of API available for PTP?
Thanks a lot.
|
|
|
|
|
yes this is the same thing which i am also looking for....
Loka Samastha Sukhino Bhavanthu..!!!
( May all beings be happy and free )
|
|
|
|
|
I just finished another Security update and now this code throws an exception.
CString myStr(L"test");
_bstr_t t = _bstr_t(myStr);
This worked until the sercurity update. I've tried to AllocateSysString to get a BSTR as well as CComBSTR instead of CString and nothing seems to work.
Does anyone know what happened to the wrapper class and how to successfully create a _bstr_t object?
Thanks
Chris
|
|
|
|
|
|
Mike,
Thanks for the response but no that doesn't work either.
All will work in MFC but in my ATL DLL everything that worked yesterday now won't!
I've tried createding a BSTR and then using that to create the _bstr_t, using a variant (_variant_t) even creating a BSTR and then using the attach method on the _bstr_t and everything throws and exception!!!!!!
It is I can't find any information in MSDN about why it isn't working either.
Chris
|
|
|
|
|
Sometime I can be so stupid!!
There was no problem with _bstr_t
There was a problem were I changed the length of an integer array from 500 to 200 and FORGOT to change the init loop. The overwriting of memeory just happend to show up in the _bstr_t object.
Sorry for all the wasted time.
Chris
|
|
|
|
|
Whenever I hit something that looks like a system issue, I use the following rules;
#1: Suspect my code
#2: See rule #1
It's stood me in good stead for over 20 years now, and only once has it failed, when I discovered a locking bug in C-ISAM for DOS. That was real fun to find.
Steve S
Developer for hire
|
|
|
|