06-13-2013 09:42 AM
I used the Create ActiveX Controller Wizzard and a lot of the functions from the server were created. However, I get to one part and it requires a handle for an interface/struct that it stuffs status data into. I can see all of the compnents in the .c file, but no function was returned to create the handle. Why?
06-16-2013 04:07 PM - edited 06-16-2013 04:07 PM
Hello rwmahar
Can you provide us more info about what are you doing?
Regards
Mart G
06-17-2013 12:40 PM
Sorry,
I think I didn't quite understand what was going on in the original post. I still don't, but feel like I'm a bit closer. I used the create activex controller wizzard and code generator to start on a client application for an existing activex control. Everything was working fine, then I came to the first part where the COM object needs to stuff data into a structure that was defined when I ran the wizzard and code generator. So, where I'm stuck is, I know I'm supposed to pass the structure to function based on documentation that came with the activex server. however, the generated function is requesting a CAObjHandle to the structure. So, I had created my CAObjHandle, but it's just initialized to 0. The function wants a handle to the structure and there is no function created to get it that I can see.
06-17-2013 02:01 PM
This is the call and function. Where detectStatusx is typedef CAObjHandle FLASHSERVERLibObj_IFlashDetectStatus;
HRESULTx = FLASHSERVERLib_IFlashStartDetect (flashx, &Error, 1, &dataLink[0], 1, 1, detectStatusx);
HRESULT CVIFUNC FLASHSERVERLib_IFlashStartDetect (CAObjHandle objectHandle,
ERRORINFO *errorInfo,
long numDataLinks,
enum FLASHSERVERLibEnum_T_FLASH_DATALINK *pDataLinks,
long enterFlashMode,
long singleDetect,
FLASHSERVERLibObj_IFlashDetectStatus pStatus) // added *
{
HRESULT __result = S_OK;
FLASHSERVERLib_IFlash_Interface * __vtblIFacePtr = 0;
int __didAddRef;
int __errorInfoPresent = 0;
LPUNKNOWN pStatus__AutoType = 0;
if (pStatus)
{
__caErrChk (CA_GetInterfaceFromObjHandle (pStatus, // added *
&FLASHSERVERLib_IID_IFlashDetectStatus,
1, &pStatus__AutoType, NULL));
}
__caErrChk (CA_GetInterfaceFromObjHandle (objectHandle,
&FLASHSERVERLib_IID_IFlash, 0,
&__vtblIFacePtr, &__didAddRef));
__caErrChk (__vtblIFacePtr->lpVtbl->StartDetect_ (__vtblIFacePtr,
numDataLinks,
(long *)pDataLinks,
enterFlashMode,
singleDetect,
pStatus__AutoType));
Error:
if (pStatus__AutoType)
pStatus__AutoType->lpVtbl->Release (pStatus__AutoType);
if (__vtblIFacePtr && __didAddRef)
__vtblIFacePtr->lpVtbl->Release (__vtblIFacePtr);
CA_FillErrorInfoEx (objectHandle, &FLASHSERVERLib_IID_IFlash, __result,
errorInfo, &__errorInfoPresent);
if (__errorInfoPresent)
__result = DISP_E_EXCEPTION;
return __result;
}
06-19-2013 01:45 PM
Okay, further clarification. I looked at some examples and they indicate CVI ActiveX Control Wizard should've created a class of Event Callback Registration Functions. Are there cases when this may not happen. In the documentation with the ActiveX control this should be a callback. However, I'm not sure if CVI should've created the callback or if I need to do this? If so, what CVI functions would I need? In some of the on line documentation it indicates the RunUserInterface() handles these events and passes the relevant once to the panel, how does it know what callbacks need to be executed by the client application I'm trying to code?
06-20-2013 08:55 AM
Hello Rwmahar
I will be escalating your questions internally and let you know. Sorry for not having an answer right away.
Best regards
Mart G
06-20-2013 09:10 AM
Mart,
For clarification, the function created by the wizard requires a Handle to the interface, but does not have a function to create the interface and return a handle. The server documentation indicates the client program should create the object, which it looks like it did through some data structures. However, again, I don't really know how to get a handle for it.
Thanks for you help.
rwm