|
hi,
here is the IShellExtInit.Initialize to get the printername:
int IShellExtInit.Initialize(
IntPtr pidlFolder,
IntPtr lpdobj,
uint hKeyProgID)
{
try
{
uint CFSTR_PRINTERGROUP;
CFSTR_PRINTERGROUP =
DllImports.RegisterClipboardFormat("PrinterFriendlyName");
m_dataObject = null;
if (lpdobj != (IntPtr)0)
{
m_dataObject = (IDataObject)Marshal.GetObjectForIUnknown(lpdobj);
FORMATETC fmt = new FORMATETC();
fmt.cfFormat = CFSTR_PRINTERGROUP; fmt.ptd = 0;
fmt.dwAspect = DVASPECT.DVASPECT_CONTENT;
fmt.lindex = -1;
fmt.tymed = TYMED.TYMED_HGLOBAL;
STGMEDIUM medium = new STGMEDIUM();
m_dataObject.GetData(ref fmt, ref medium);
m_hDrop = medium.hGlobal;
uint nselected = DllImports.DragQueryFile(m_hDrop,
0xffffffff,
null,
0);
if (nselected == 1)
{
StringBuilder sb = new StringBuilder(1024);
DllImports.DragQueryFile(m_hDrop, 0, sb, sb.Capacity + 1);
string objectname = sb.ToString();
}
}
}
catch (Exception e)
{
sting err = e.ToString();
}
return 0;
}
eisbär
|
|
|
|
|
Hi
I have a ICopyHook extension DLL. But this DLL is coming to effect only when i restart my explorer i.e, by lkilling the explorer.exe. If i register the DLL, i will have to kill the explorer.exe to make it work. Is there any way by which i can make the DLL work wihtout restarting the explorer.
|
|
|
|
|
Hi,
I made a COM-client in C++ which uses the import directive and
_COM_SMARTPTR_TYPEDEF(Iclogmanager, __uuidof(Iclogmanager));
to access the methods of the COM-Server via a smart pointer.
Iclogmanager is a dispinterface and the COM-Object which implements it is a Visual-Fox-Pro COM-Server. Its image is in an exe-file and it runs as a separate process on an other machine.
I was surprised to see, that the client crashed, after I released a new version of the server, although I did not even add additional methods. It was just a line of additional code I added within a method.
To be exact, it crashed at
HRESULT _hr = raw_doQuery(tcFilterMethode, toCollParameters, &_result);
After recompilation it worked fine again.
This is absolutely not consistent with my idea of COM.
Any idea?
Thanks an best regards
Werner
|
|
|
|
|
what is an interface ?
difference between interface and a abstract class >
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
Essentially an interface is an abstract base class, but their are limitations of what is allowed to ensure compatible vtable layout between different compilers:
- No virtual destructors (as different compilers implement it differently).
- Only single inheritance (as different compilers implement multiple inheritance differently).
Probably other stuff I forgot.
Steve
|
|
|
|
|
A interface is an abstract class in c++.it's methods are not defined.A interface shows some aspects of a com component (coclass) like we have "human" component then IHand and IMouth could be it's interfaces.
danishjibbran
|
|
|
|
|
hi guys;
the IMediaSeeking @ Duration didn't work, any thougth about that?
the code would be:
#pragma once
using namespace System;
using namespace System::Runtime::InteropServices;
namespace QuartzTypeLib
{
[StructLayout(LayoutKind::Sequential), ComVisible(false)]
public ref class DsOptInt64
{
public:
DsOptInt64( long Value )
{
this->Value = Value;
}
long Value;
};
[Flags, ComVisible(false)]
public enum class SeekingCapabilities // AM_SEEKING_SeekingCapabilities AM_SEEKING_SEEKING_CAPABILITIES
{
CanSeekAbsolute = 0x001,
CanSeekForwards = 0x002,
CanSeekBackwards = 0x004,
CanGetCurrentPos = 0x008,
CanGetStopPos = 0x010,
CanGetDuration = 0x020,
CanPlayBackwards = 0x040,
CanDoSegments = 0x080,
Source = 0x100 // Doesn't pass thru used to count segment ends
};
[Flags, ComVisible(false)]
public enum class SeekingFlags // AM_SEEKING_SeekingFlags AM_SEEKING_SEEKING_FLAGS
{
NoPositioning = 0x00, // No change
AbsolutePositioning = 0x01, // Position is supplied and is absolute
RelativePositioning = 0x02, // Position is supplied and is relative
IncrementalPositioning = 0x03, // (Stop) position relative to current, useful for seeking when paused (use +1)
PositioningBitsMask = 0x03, // Useful mask
SeekToKeyFrame = 0x04, // Just seek to key frame (performance gain)
ReturnTime = 0x08, // Plug the media time equivalents back into the supplied LONGLONGs
Segment = 0x10, // At end just do EC_ENDOFSEGMENT, don't do EndOfStream
NoFlush = 0x20 // Don't flush
};
[ComVisible(true), ComImport,
Guid("36b73880-c2c8-11cf-8b46-00805f6cef60"),
InterfaceType( ComInterfaceType::InterfaceIsIUnknown )]
public interface class IMediaSeeking
{
[PreserveSig]
int GetCapabilities(SeekingCapabilities &pCapabilities );
[PreserveSig]
int CheckCapabilities( [In, Out] SeekingCapabilities &pCapabilities );
[PreserveSig]
int IsFormatSupported( [In] Guid& pFormat );
[PreserveSig]
int QueryPreferredFormat( [Out] Guid& pFormat );
[PreserveSig]
int GetTimeFormat( [Out] Guid& pFormat );
[PreserveSig]
int IsUsingTimeFormat( [In] Guid& pFormat );
[PreserveSig]
int SetTimeFormat( [In] Guid& pFormat );
[PreserveSig]
int GetDuration( long& pDuration );
[PreserveSig]
int GetStopPosition( long& pStop );
[PreserveSig]
int GetCurrentPosition( long &pCurrent );
[PreserveSig]
int ConvertTimeFormat( long& pTarget, [In] Guid& pTargetFormat,
long& Source, [In] Guid& pSourceFormat );
[PreserveSig]
int SetPositions(
[In, Out, MarshalAs(UnmanagedType::LPStruct)] DsOptInt64^ pCurrent,
SeekingFlags dwCurrentFlags,
[In, Out, MarshalAs(UnmanagedType::LPStruct)] DsOptInt64^ pStop,
SeekingFlags dwStopFlags );
[PreserveSig]
int GetPositions( long &pCurrent, long &pStop );
[PreserveSig]
int GetAvailable( long &pEarliest, long &pLatest );
[PreserveSig]
int SetRate( double dRate );
[PreserveSig]
int GetRate( double& pdRate );
[PreserveSig]
int GetPreroll( long &pllPreroll );
};
}
thanks
|
|
|
|
|
Hi,
I am trying to send a simple string from a ActiveX written in C++ and pop a messageBox out in VB .NET with this string in it. I have tried everything and spoke to many people about this problem.
When I attempt to run the VB Application I get a error telling me
System.Runtime.Services.COMException and with further detail it tells me it is a type Mismatch
I have written a sample program that has a simple function called GetString,
The MessageBox in the function GetString doesnt even pop up
Here is the .IDL File
<code>
#include <idispids.h>
[ uuid(597DC433-D3AC-484E-A91E-3CB9752A7C8A), version(1.0),
helpfile("Test.hlp"),
helpstring("Test ActiveX Control module"),
control ]
library TestLib
{
importlib(STDOLE_TLB);
// Primary dispatch interface for CTestCtrl
[ uuid(444429CA-5912-4EB6-B56F-714EC166420C),
helpstring("Dispatch interface for Test Control")]
dispinterface _DTest
{
properties:
methods:
[id(DISPID_ABOUTBOX)] void AboutBox();
[id(1), helpstring("method GetString")] void GetString(BSTR* str);
};
// Event dispatch interface for CTestCtrl
[ uuid(1EA5A597-A8EE-4A61-A0B5-0CB32CD9ADF2),
helpstring("Event interface for Test Control") ]
dispinterface _DTestEvents
{
properties:
// Event interface has no properties
methods:
};
// Class information for CTestCtrl
[ uuid(2FA19712-DF56-49B0-9DA0-E148FECB25A7),
helpstring("Test Control"), control ]
coclass Test
{
[default] dispinterface _DTest;
[default, source] dispinterface _DTestEvents;
};
};
</code>
Here is the TestCtrl.cpp File
<code>
// TestCtrl.cpp : Implementation of the CTestCtrl ActiveX Control class.
#include "stdafx.h"
#include "Test.h"
#include "TestCtrl.h"
#include "TestPropPage.h"
#include ".\testctrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNCREATE(CTestCtrl, COleControl)
// Message map
BEGIN_MESSAGE_MAP(CTestCtrl, COleControl)
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
// Dispatch map
BEGIN_DISPATCH_MAP(CTestCtrl, COleControl)
DISP_FUNCTION_ID(CTestCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
DISP_FUNCTION_ID(CTestCtrl, "GetString", dispidGetString, GetString, VT_EMPTY, VTS_PBSTR)
END_DISPATCH_MAP()
// Event map
BEGIN_EVENT_MAP(CTestCtrl, COleControl)
END_EVENT_MAP()
// Property pages
// TODO: Add more property pages as needed. Remember to increase the count!
BEGIN_PROPPAGEIDS(CTestCtrl, 1)
PROPPAGEID(CTestPropPage::guid)
END_PROPPAGEIDS(CTestCtrl)
// Initialize class factory and guid
IMPLEMENT_OLECREATE_EX(CTestCtrl, "TEST.TestCtrl.1",
0x2fa19712, 0xdf56, 0x49b0, 0x9d, 0xa0, 0xe1, 0x48, 0xfe, 0xcb, 0x25, 0xa7)
// Type library ID and version
IMPLEMENT_OLETYPELIB(CTestCtrl, _tlid, _wVerMajor, _wVerMinor)
// Interface IDs
const IID BASED_CODE IID_DTest =
{ 0x444429CA, 0x5912, 0x4EB6, { 0xB5, 0x6F, 0x71, 0x4E, 0xC1, 0x66, 0x42, 0xC } };
const IID BASED_CODE IID_DTestEvents =
{ 0x1EA5A597, 0xA8EE, 0x4A61, { 0xA0, 0xB5, 0xC, 0xB3, 0x2C, 0xD9, 0xAD, 0xF2 } };
// Control type information
static const DWORD BASED_CODE _dwTestOleMisc =
OLEMISC_ACTIVATEWHENVISIBLE |
OLEMISC_SETCLIENTSITEFIRST |
OLEMISC_INSIDEOUT |
OLEMISC_CANTLINKINSIDE |
OLEMISC_RECOMPOSEONRESIZE;
IMPLEMENT_OLECTLTYPE(CTestCtrl, IDS_TEST, _dwTestOleMisc)
// CTestCtrl::CTestCtrlFactory::UpdateRegistry -
// Adds or removes system registry entries for CTestCtrl
BOOL CTestCtrl::CTestCtrlFactory::UpdateRegistry(BOOL bRegister)
{
// TODO: Verify that your control follows apartment-model threading rules.
// Refer to MFC TechNote 64 for more information.
// If your control does not conform to the apartment-model rules, then
// you must modify the code below, changing the 6th parameter from
// afxRegApartmentThreading to 0.
if (bRegister)
return AfxOleRegisterControlClass(
AfxGetInstanceHandle(),
m_clsid,
m_lpszProgID,
IDS_TEST,
IDB_TEST,
afxRegApartmentThreading,
_dwTestOleMisc,
_tlid,
_wVerMajor,
_wVerMinor);
else
return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
}
// CTestCtrl::CTestCtrl - Constructor
CTestCtrl::CTestCtrl()
{
InitializeIIDs(&IID_DTest, &IID_DTestEvents);
// TODO: Initialize your control's instance data here.
}
// CTestCtrl::~CTestCtrl - Destructor
CTestCtrl::~CTestCtrl()
{
// TODO: Cleanup your control's instance data here.
}
// CTestCtrl::OnDraw - Drawing function
void CTestCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
if (!pdc)
return;
// TODO: Replace the following code with your own drawing code.
pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
pdc->Ellipse(rcBounds);
}
// CTestCtrl::DoPropExchange - Persistence support
void CTestCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
}
// CTestCtrl::OnResetState - Reset control to default state
void CTestCtrl::OnResetState()
{
COleControl::OnResetState(); // Resets defaults found in DoPropExchange
// TODO: Reset any other control state here.
}
// CTestCtrl::AboutBox - Display an "About" box to the user
void CTestCtrl::AboutBox()
{
CDialog dlgAbout(IDD_ABOUTBOX_TEST);
dlgAbout.DoModal();
}
// CTestCtrl message handlers
void CTestCtrl::GetString(BSTR* str)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// MessageBox( "This is a test" );
// CString tmp = "Hello World";
// *str = tmp.AllocSysString();
}
</code>
And Here is the TestCtrl.h
<code>
#pragma once
// TestCtrl.h : Declaration of the CTestCtrl ActiveX Control class.
// CTestCtrl : See TestCtrl.cpp for implementation.
class CTestCtrl : public COleControl
{
DECLARE_DYNCREATE(CTestCtrl)
// Constructor
public:
CTestCtrl();
// Overrides
public:
virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
virtual void DoPropExchange(CPropExchange* pPX);
virtual void OnResetState();
// Implementation
protected:
~CTestCtrl();
DECLARE_OLECREATE_EX(CTestCtrl) // Class factory and guid
DECLARE_OLETYPELIB(CTestCtrl) // GetTypeInfo
DECLARE_PROPPAGEIDS(CTestCtrl) // Property page IDs
DECLARE_OLECTLTYPE(CTestCtrl) // Type name and misc status
// Message maps
DECLARE_MESSAGE_MAP()
// Dispatch maps
DECLARE_DISPATCH_MAP()
afx_msg void AboutBox();
// Event maps
DECLARE_EVENT_MAP()
// Dispatch and event IDs
public:
enum {
dispidGetString = 1L
};
protected:
void GetString(BSTR* str);
};
</code>
The VB Application is as follows:
<code>
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents AxTest1 As AxTestLib.AxTest
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.AxTest1 = New AxTestLib.AxTest
CType(Me.AxTest1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'AxTest1
'
Me.AxTest1.Enabled = True
Me.AxTest1.Location = New System.Drawing.Point(16, 16)
Me.AxTest1.Name = "AxTest1"
Me.AxTest1.OcxState = CType(resources.GetObject("AxTest1.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxTest1.Size = New System.Drawing.Size(184, 192)
Me.AxTest1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.Add(Me.AxTest1)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.AxTest1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim test As String
AxTest1.GetString(test) 'ERROR HAPPENS HERE
End Sub
End Class
</code>
|
|
|
|
|
The first thing that catches my eye is this line in the .ODL file:
[id(1), helpstring("method GetString")] void GetString(BSTR* str);<br />
This should read:
[id(1), helpstring("method GetString")] void GetString([out, retval]BSTR* str);<br />
Steve
-- modified at 22:00 Sunday 22nd January, 2006
ADDED:
The retval means you should be able to write something like this on the dotNET side:
<br />
s = obj.GetString()<br />
|
|
|
|
|
For dispinterface your note can be more simple:
[id(1), helpstring("method GetString")] BSTR GetString();
With best wishes,
Vita
|
|
|
|
|
hi,
i have developed a small compression C++ COM dll to use in Visual Basic and ASP. i wrote 2 simple functions in COM object
STDMETHODIMP Compress ( BSTR src, VARIANT * target );
STDMETHODIMP Decompress ( VARIANT *src, VARIANT *target );
Compress: receives a string src and compresses it , writes compressed binary byte array to target.
Decompress: receives compressed byte array as src and, writes decompressed string into target string object.
in visual basic all tests go well
Test Visual Basic Function:
Public Sub Test ()
Dim obj = Server.Create("XXX")
Dim str as String, target as Variant , str2 as Variant
str = "testtesttesttesttest" 'any test string
obj.compress( str, target )
obj.decompress( target, str2 )
Msgbox str & vbNewLine & str2
end Sub
My problem is in asp to call decompress() , in asp i get ms vbscript runtime error , err.No = 507
can anyone help for this, google didnot help me much for that
thanx
|
|
|
|
|
My Question is, I have a one dll in that dll contains so many classes, then now I want to export a call and then Import a call.
can you tell me thorugh the example.(How I can export and How I can Import).
Srinu
|
|
|
|
|
It depends on what you want to export and in some cases the the compiler used to do the exporting and the importing. If you just want to export a global function you need to look up extern "C" and __declspec(export) or use a .DEF file. With this technique the compliers used at the exporting and importing ends will not matter. If you want to export a class use __declspec(export) on the class. Using this technique the compilers at each side must use the same name mangling scheme. Or else you can use COM to export a COM object and the importer can be any langauge that supports COM. More information is needed before any more detailed help can be given.
Steve
|
|
|
|
|
|
|
i want to ebook of inside com and if anybody have CHM file then please send or send me a link to download CHM file.
Bankey Khandelwal
Software Engineer
Solversa TechnologiesPvt.Ltd.
15,Yeshwant Nagar
Range Hill Road
Ganeshkhind,Pune-03
bankey.khandelwal@solversa.com
Mobile: +91-9850432990
Office : +91-20-25521888
|
|
|
|
|
I am new to COM and would like to get some information.
I need to create an active document server application.
I have some questions and I would be grateful if you can answer the following
1) Can I create a dll that is an active document server(either mini or full server)? if no, please specify why?
2) What do I need to need to get started with active documents and have complete understanding of what I am doing.
3) Can you point to some online resource which gives indepth implementation details about active documennts. All the links I found in google asked me to create first a skeleton application using wizard which I would to avoid so that I have complete know how of my code.
4) this question might seem stupid but its important for me. Is there any use of active documents other than that your application will not open in a separate window and will be activated inplace.
Thank you
|
|
|
|
|
Hi everyone,
I hope someone has idea on how to do this...
I used this example[^] to create a user control with windows controls with the idea of accessing the client's file system through internet explorer by using this interface as an ActiveX.
The basic idea is that through this control I access some files in a server through FTP that need to be updated, for example in c:\files\ in the client that's looking at this web page.
So, I navigate in IE to this webpage with this user control in the page, and it works ok in my working computer, but when I try to run this update in another computer, I get error messages stating that I don't have the priviledges to access the files in the computer.
Has anyone by any chance tried something like this? accessing the client's file system from IE using a user control?
My studies have brought me to the fact that it's possible to update these files:
- By setting this web site as secure in IE it works ok in other computers.
- By setting security priviledges with the .NET Framework configuration tool the control also works.
Well, what I need is that some how the user doesn't need to do any of these configurations, but somehow the user is asked if it allows the activex component to run and lets it work on his computer.
I've seen that some activex controls prompt if they'll be allowed to run, but for some reason this is not the case with this control.
Thanks for taking the time to read this
daniero
-- modified at 19:32 Wednesday 18th January, 2006
|
|
|
|
|
I am currently following a book on how to sign assemblies with strong names in order to register a serviced component in the into the COM+ catalog and some errors are occuring.
My AssemblyInfo.cs file currently looks like this: (of importance is the AssemblyKeyFile attriubte)
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.EnterpriseServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("StepByStep7_1")]
[assembly: AssemblyDescription("Retrieve and update data from the Northwind database")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StepByStep7_1")]
[assembly: AssemblyCopyright("Copyright © 2006")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ApplicationActivation(ActivationOption.Library)]
[assembly: ApplicationName("NorthwindCS")]
[assembly: AssemblyKeyFile(@"..\..\..\70320.snk")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("2d37557e-b619-4092-80e4-4a30e2978021")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
When I build the application I get the following error:
Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile'
Can anyone help explain why this error is coming up? The build itself actually does succeed, however it is giving me hassle when I come to register the serviced component in the COM+ catalog. I am presuming that it is because of the error in the build?
I would be very grateful to anyone who can help in order that I may move on in the book as I have just got a second wind to return to my studies and want to make the most of it while it lasts!!!
Thanks
Paul
|
|
|
|
|
I've an ActiveX visible control, written in ATL. Different containers can run it.
Besides, I've a COM (MFC EXE) Server that being informed about any ActiveX properties changes. So I'd like to change the same properties in the other running ActiveX components. In other words all of ActiveX'es could change their properties synchronously.
Thanks.
|
|
|
|
|
Hi,
I have 3 dlls, one is COM DLL and two are c++ dll.
I want to debug the c++ dlls from the com dll through the vb client.
Here the secnario is c++ dll are talking to the mainframe, but when we try to execute the asp client first com dll get activated, from that com dll c++ dlls are gets called.
Pls help me.
Srinu.
-- modified at 9:30 Friday 20th January, 2006
|
|
|
|
|
Now, There is a WebBrowser Control in my application, I hope get the http header by someone Interface.The http header such as
200 ok http/1.1
.
.
type:
set-cookie: !@#$%^&*(
content-length:@#$
..
|
|
|
|
|
The DISPID_BEFORENAVIGATE2 notification has a Headers parameter that looks like it might do what you want.
Steve
|
|
|
|
|
To Stephen Hewitt:
Thanks,but the DISPID_BEFORENAVIGATE2 can only get request http header,not get response http header.
|
|
|
|
|
Hi,
I try to use a Dragonfly ActiveX - XY-Plotter in Matlab SP3.
You will find the Dragonfly ActiveX Library here: http://www.dragonflydas.com/
It's possible to set the properties of the object like colour, grid etc.
I have the problem to plot the data, because I have to call the function PlotXYData of the object with datatype Variant.
I use cell arrays or struct arrays to plot the data, but it didn't work.
I only get the bool value false back.
May you help me, how I should handle functions with datatype Variant in Matlab?
Best Regards
Tolpan
The Matlabcode:
dfpos = get(0,'DefaultFigurePosition');
hfig = figure('Position', dfpos,'Menu', 'none','Name', 'ActX-Test');
hXYChart = actxcontrol('Scope.XYChart.1',[0 0 0 0],hfig);
posfig = get(hfig,'Position'); % Clientfläche des Parent-Windows
sizeactx = [0 0 1 1].*posfig([3 4 3 4]); % Berechnung der ActX-Element-Fläche
move(hXYChart, sizeactx);
hXYChart.invoke('ResetAll'); % Eventuelle Voreinstellungen zurücksetzen
hXYChart.set('bkColor', 140000); % Farbeinstellungen
hXYChart.set('PlotBackgroundColor', 60000);
hXYCurveProp = actxserver('Scope.XYCurveProp.1');
hXYCurveProp.set('Name', 'Curve1');
hXYCurveProp.set('Key', 'Curve1');
hXYCurveProp.set('Unit', 'm');
hXYCurveProp.set('UnitFactor', 1);
hXYCurveProp.set('Max', 100);
hXYCurveProp.set('Min', 0);
hXYCurveProp.set('Color', 0);
hXYCurveProp.set('Width', 1);
hXYCurveProp.set('LineStyle', 0);
hXYCurveProp.set('CurveStyle', 0);
hXYCurveProp.set('PointSize', 6);
hXYCurveProp.set('PointStyle', 2);
% Kurve zum XYChart hinzufügen:
hXYChart.invoke('AddCurve', hXYCurveProp)
% Zeilenvektoren erzeugen:
x = [0 10 20 30 40 50 60 70 80 90 100];
y = [0 10 20 30 40 50 60 70 80 90 100];
xv=num2cell(x);
yv=num2cell(y);
size=length(x);
a=hXYChart.invoke('PlotXYData', 'Curve1', size, xv,yv)
The methods of the object are:
AddCurve = bool AddCurve(handle, handle)
GetCurveProperties = [bool, handle] GetCurveProperties(handle, string)
PlotXYData = bool PlotXYData(handle, string, int32, Variant, Variant)
RemoveCurve = bool RemoveCurve(handle, string)
ResetAll = void ResetAll(handle)
ResetCurve = void ResetCurve(handle, string)
SetAreaCurveTop = void SetAreaCurveTop(handle, string)
SetCurveProp = bool SetCurveProp(handle, string, handle)
hWnd = int32 hWnd(handle)
|
|
|
|
|