12-18-2007 01:21 PM
12-19-2007 07:26 AM
From the readme file:
In Visual C++, the Measurement Studio 8.1.1 implementation of windowless controls is not compatible with the MFC ActiveX control container. Measurement Studio controls do not paint correctly when you set the Windowless property to true. You can work around this issue using a helper class to implement the appropriate dialog, SDI, or MDI function. For more information, refer to National Instruments KnowledgeBase Article 2ZFF2AXL.
Please try the workaround and let us know if you have any problems.
David Rohacek
National Instruments
12-19-2007 09:16 AM
12-20-2007 05:45 PM
12-21-2007 08:45 AM
12-21-2007 01:16 PM
01-03-2008 09:02 AM
01-04-2008 06:32 PM
02-01-2008 08:23 AM
Hi Michal,
Thanks for your patience as I've finally figured out after digging through old
and new source code what our official stance is on supporting windowless
activation.
Alright so as far a windowless activation goes, in Measurement Studio 7.0 we
were able to set that property to true. However, when we did, the control
did not paint correctly as a result of us not determining if the
control site supported windowless activation So we fixed that problem in
Measurement Studio 8.0 by coercing the Windowless property to false if the
dialog did not support windowless activation
So your next question might be, how does Windowless activation take place and
how can you be sure that we are doing the right checking? Well the way that
windowless activation takes place is that the windowless control queries
the client site for the IOleInPlaceSiteWindowless
interface. If this interface is supported and
CanWindowlessActivate returns S_OK, the control activates itself as
windowless, otherwise the control creates a window.
Microsoft provides methods of querying interfaces and control sites to
determine if they support windowless or not. You can do this on your end
if you want to double-check our thoughts as here is the basic code we use to
determine this. So basically you need to call the GetClientSite() method to retrieve a pointer to the control's
current client site in its container. If that pointer was called
pClientSite, you could then say:
IOleInPlaceSiteWindowless *pI=NULL;
if((pClientSite && SUCCEEDED(pClientSite->QueryInterface(&pI))
&& pI->CanWindowlessActivate() == S_OK))
windowlessSupport = TRUE;
else
windowlessSupport = FALSE;
Visual Basic 6.0 and other NI IDEs support the above interface and hence the
controls can be made windowless.
Now the MFC dialog does NOT support this (i.e. as the query CanWindowlessActivate
fails for this) and hence the controls are not being able to be made
windowless. We tested both Measurement Studio ActiveX controls as well as
custom ActiveX controls that we created in the MFC Dialog, and both were
rendered windowed as the above query was failing. So the only way of getting
controls to be windowless is by implementing a custom
client site that supports windowless controls. If you are curious, the
following article could be of some help which is called MFCClientSite.
Now, the thread you mentioned talks about the MFC 7.0
container which shipped with Visual Studio .NET 2002. At the time of the release of Visual
Studio .NET 2002, Microsoft stated that support for Windowless controls was
added to MFC. That means that it should be present for later versions also.
Also, MFC supports creation of windowless ActiveX controls using the ActiveX
wizards so they must b supporting windowless activation for their containers
(but how? who knows). But what I can say is that the VC++ dialog does not
defaultly support Windowless controls. A custom site implementation must
be provided for a container to support Windowless controls.
So all in all, if you are using the default VC++ dialog, then our controls
don't support Windowless. So your best bet is to not mess with that
Windowless property unless you are implementing your own custom control
site.
Best Regards and I hope this clears things up,
02-27-2008 06:16 AM