Click here to Skip to main content
15,914,444 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Questionplace FlexGrid in ATL window(CWnd Inheritance). Pin
thatsravi21-May-07 23:53
thatsravi21-May-07 23:53 
Questionvector assignment operations Pin
misha_grewal20-May-07 23:02
misha_grewal20-May-07 23:02 
AnswerRe: vector assignment operations Pin
Stuart Dootson21-May-07 0:11
professionalStuart Dootson21-May-07 0:11 
GeneralRe: vector assignment operations Pin
misha_grewal21-May-07 0:27
misha_grewal21-May-07 0:27 
GeneralRe: vector assignment operations Pin
Stuart Dootson21-May-07 4:07
professionalStuart Dootson21-May-07 4:07 
AnswerRe: vector assignment operations Pin
Nemanja Trifunovic23-May-07 1:57
Nemanja Trifunovic23-May-07 1:57 
AnswerRe: vector assignment operations Pin
John R. Shaw29-May-07 3:56
John R. Shaw29-May-07 3:56 
QuestionHow much a vector can store? Pin
Pankaj.Jain20-May-07 23:02
professionalPankaj.Jain20-May-07 23:02 
AnswerRe: How much a vector can store? Pin
Stuart Dootson21-May-07 0:07
professionalStuart Dootson21-May-07 0:07 
QuestionDEP (Data Execution Prevention) in WinXP SP2 and ATL/WTL thunk. Pin
JaeWook Choi18-May-07 10:26
JaeWook Choi18-May-07 10:26 
AnswerRe: DEP (Data Execution Prevention) in WinXP SP2 and ATL/WTL thunk. Pin
Jörgen Sigvardsson19-May-07 2:06
Jörgen Sigvardsson19-May-07 2:06 
GeneralRe: DEP (Data Execution Prevention) in WinXP SP2 and ATL/WTL thunk. Pin
JaeWook Choi22-May-07 3:40
JaeWook Choi22-May-07 3:40 
GeneralRe: DEP (Data Execution Prevention) in WinXP SP2 and ATL/WTL thunk. Pin
Jörgen Sigvardsson22-May-07 3:50
Jörgen Sigvardsson22-May-07 3:50 
GeneralRe: DEP (Data Execution Prevention) in WinXP SP2 and ATL/WTL thunk. Pin
JaeWook Choi23-May-07 3:47
JaeWook Choi23-May-07 3:47 
GeneralRe: DEP (Data Execution Prevention) in WinXP SP2 and ATL/WTL thunk. Pin
Jörgen Sigvardsson23-May-07 3:56
Jörgen Sigvardsson23-May-07 3:56 
Questionusing mscomm32.ocx in ATL Exe? Pin
viral_umang@hotmail.com18-May-07 0:33
viral_umang@hotmail.com18-May-07 0:33 
QuestionExecuting Javascript in ASPX Pin
darora317-May-07 18:15
darora317-May-07 18:15 
Questionattributed ATL, forward declare interface? Pin
Jared Allen16-May-07 12:29
Jared Allen16-May-07 12:29 
AnswerRe: attributed ATL, forward declare interface? Pin
Michael Dunn18-May-07 14:57
sitebuilderMichael Dunn18-May-07 14:57 
AnswerRe: attributed ATL, forward declare interface? Pin
Jörgen Sigvardsson19-May-07 2:05
Jörgen Sigvardsson19-May-07 2:05 
AnswerRe: attributed ATL, forward declare interface? Pin
Jared Allen19-May-07 8:40
Jared Allen19-May-07 8:40 
Questionhow to convert an interface instance to SAFEARRAY Pin
bioan15-May-07 21:14
professionalbioan15-May-07 21:14 
The idea is to create some add-on in a program using COM functions interface exist in his own API.

The particular type which I try to implement is a generic one , let say MyClass, and is declared like below:
//MyClassPtr declaration;
_COM_SMARTPTR_TYPEDEF(MyClass, __uuidof(IDispatch));

//The class itself
struct __declspec(uuid("5e772660-389b-11ce-ba48-080036250302"))
MyClass : IDispatch
{
...
// other functions...
...
IDispatchPtr Function1;
__declspec(property(get=GetArea,put=PutArea))
IDispatchPtr Function2;
__declspec(property(get=GetSize))
...
}

I create an instance of MyClass using:
MyClassPtr pMyInstance;

This pMyInsatance have to be provided to another API function but in form of a SAFEARRAY!This function can look like below:

FinalFunction(SAFEARRAY * * pMyClassInstances, .. , ..)

So I have to convert my variable MyClass (can be more than one in my code of course, but I want to limit only to one instance for now) to this SAFEARRAY .. How can I do this?

I try:
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 1;
long a=0;

SAFEARRAY * vMyClassArray;
vMyClassArray.vt = VT_VARIANT|VT_ARRAY;
vMyClassArray= SafeArrayCreate(VT_VARIANT, 1, rgsabound);
SafeArrayPutElement(vMyClassArray .parray, &a, &(pMyInstance));

Finally I put my class instance as an argument for:
FinalFunction(pMyInstance, .. , ..)

It doesn't seem to work, probably because argument pMyInstance can not be express as a VARIANT declarated type.
The class I want to work with - MyClass- which exist in a .tlh file, is part of the API interface, so it is not exactly a user define type, but more an interface define type. I mention this becose I try to work with VT_RECORD type in SafeArrayCreate(...) instead of VT_VARIANT type, but this imply an idl function declaration for my type, and other additional stuff

Any ideea ??

QuestionHow to pass an array to a COM method that accept a VARIANT * Pin
songll10-May-07 8:28
songll10-May-07 8:28 
AnswerRe: How to pass an array to a COM method that accept a VARIANT * Pin
Stuart Dootson10-May-07 21:04
professionalStuart Dootson10-May-07 21:04 
GeneralRe: How to pass an array to a COM method that accept a VARIANT * Pin
Jörgen Sigvardsson13-May-07 7:43
Jörgen Sigvardsson13-May-07 7:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.