11-05-2008 03:42 AM
Hi.
I set up the activeX completely using Tools ->Create ActivX Controller in CVI.
And I saw that added fp file in my project.
And I have to get the handle of ActiveX control in panel so I pushed that Create-> Activex.
Then CVI show the dialog box that is commented Select ActiveX Object Create Control and ActiveX Controls.
But I can't the ActiveX Control in the list.
Maybe I thinks ActiveX in installed my program does not support the control in panels.
Then how can I get the Object handle of Activex?
I knew that I get the handle of Activex on Panel before using the Activex Functions.
Please tell me the easy way......
And I attach the some pictures at the ActiveX control installing and the UIR panel and Codes..
By the way,
Do you have the example codes to control LIN protocol?
I have to the program that is running the CVI and control the a LIN Slave using a emulator as EmuLIN(Emulator made in Germany) for tunnel.
Please show me the example codes of CVI.
Please understand my poor English and Thanks.
Best Regards.
Kwan Bum
====================================================================
Example codes
#include <windows.h>
#include <cvirte.h>
#include <userint.h>
#include "Lin_ActiveX_Test.h"
#include "LIN_Test.h"
static int panelHandle;
int LinHandle=0;
CAObjHandle LincltHandle;
VARIANT m_cltHandle;
VARIANT value;
/* CAObjHandle objectHandle,
ERRORINFO *errorInfo,
VARIANT *cltHandle,
long wNodesFilter,
long wSubnetFilter,
VARIANT *value
*/
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "LIN_Test.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
// GetObjHandleFromActiveXCtrl (panelHandle, PANEL_ACTMBSTB, &hMBSTB);
RunUserInterface ();
return 0;
}
int CVICALLBACK Close (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
DiscardPanel(panelHandle);
QuitUserInterface(panelHandle);
break;
}
return 0;
}
int CVICALLBACK Connect_Client (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
LinHandle = AcxLinTools_IClientlt_ConnectDataClient (LincltHandle, NULL, &m_cltHandle, 0, 0, &value);
break;
}
return 0;
}
11-07-2008 11:59 AM
Hello Kwan,
You are trying to use two different types of ActiveX technologies.
The first thing you set up is an ActiveX controller that communicates with your selected ActiveX Server.
When you create in CVI a container to hold an ActiveX control you see the list of available ActiveX Objects registered on your computer. ActiveX Objects are different than ActiveX servers. These are two separate things.
For example, one control you probably have is the Windows Media Player ActiveX control. This allows you to have a media player embedded on your form. But there is also the Windows Media Player ActiveX server which allows you to control aspects about Windows Media Player.
If you cannot choose a LIM Object when you are selecting a control, then chances are there is not one.
Please let me know if you have any questions.