It is a very poor way to declare a new type. The reason it is poor is because of the naming. The goal it is trying to accomplish is to declare a new type that is a pointer-to-a-pointer-to-a-pointer-to-a-pointer-to-a-Handle. A better way to write it would be either of the following:
Option 1: typedef RedirectedHandle ****Handle;
// assuming Handle is in global namespace
typedef Handle **** ::Handle;
An even better solution would be to not use that many levels of indirection (who needs 4 levels of indirection for a Handle?) and to use smart pointers.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
hi! My name is JC im from Puerto Rico. Right now my C++ knowledge is a bit "limited"
and Im developing an application tthat will end up updating a txt file in an FTP. I found a class that got the perfecy functions i need made by otom and found here
( http://www.codeproject.com/internet/ftpclientclass.asp ). The functions I need are exactluy the same he puts as an example:
You can still use the fread function and pass the address of your structure. But you have to take care of that because pading bytes are added between the members of your structure (so it is quite dangerous to handle that this way).
I suppose this is unneeded, since varReturn.vt already contains a value, which is VT_ARRAY | VT_R4.
What happens when you comment this line?
Next, the constructor at
creates a copy of passed SAFEARRAY object, therefore the source detached object is not deleted and causes memory leaks. I think you should first try this:
If it works, you can reconsider your getSomething function and return a SAFEARRAY pointer directly, detached from saVars. In the other function, attach this pointer to a CComSafeArray variable. It will be deleted automatically.
I hope it helps.
-- modified at 10:22 Thursday 29th June, 2006
Last Visit: 31-Dec-99 18:00 Last Update: 24-Jul-21 3:54