|
Which interface showed error. first one or second one? and how did u call. thru IDispatch or queryinterface?
COM_INTERFACE_ENTRY2 has impact on the calling mechanism, if u have more than IDispatch interfaces in a single CoClass. U can't invoke the second interface bu using IDspatch Invoke mthd. You have to use QueryInterface for that . Only the first Interface can have IDispatch Invokation.
rgds...mil10
|
|
|
|
|
Hello people,
I am new to programing in vb.net or c#.net. So please be gentle with me!
I added a reference to a com in a c# project with some strange results. I added a reference to the same com in vb.net and had no problems.
The interface i have a problem with is shown below. (Taken from the object browser)
vb.net it appears as:
item([byval as object],[byval as object]) as FRRobot.FRCIOType
Public Overridable ReadOnly Default Property Item(Optional ByVal Type As Object = Nothing, Optional ByVal Index As Object = Nothing) As FRRobot.FRCIOType
Member of: FRRobot.IIOTypes
c#.net it appears as:
this[object,object]
public const abstract new FRRobot.FRCIOType this [ get]
Member of FRRobot.IIOTypes
Can anybody please help me?
Ned
|
|
|
|
|
Hi,
I automate PowerPoint using VC++.
I want to group some shapes of a slide.
To do this, I have to use the method Range of the object Slides.
Its prototype is:
LPDISPATCH Range(const VARIANT& index);
I don't know how constructing the parameter.
I've tried something like this, with no success:
------------
int index[2];
index[0] = 4;
index[1] = 5;
VARIANT var;
VariantInit(&var);
var.vt = VT_ARRAY;
var.pintVal = index;
shapeRange = shapes.Range( var);
---------
This is the beginning of my code:
-----
_Application app;
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
app.CreateDispatch("Powerpoint.Application"))
Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add( true));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
-----
Thanks
|
|
|
|
|
Hello Nithya..,
Simply add the following line to the coclass declaration :
interface Ibbb;
as in :
//idf file
coclass aaa
{
[default] interface Iaaa;
interface Ibbb;
};
make sure that Ibbb is either defined in the same IDL or the IDL that contains the definition of Ibbb is imported into your IDL.
After this is done, if you are using ATL, use the ATL wizard to "implement interface" the Ibbb interface.
Best Regards,
Bo.
|
|
|
|
|
Helllo
I am using a datagrid in a web application(.NET). When an user clicks the grid I want an menu to appear, (something like windows right click). I was thinking of creating the menu and all the functionallity in VB 6.0 ActiveX, and importing the ocx into the web app and using it there...
Will this work?
Is there an better way to solwe this problem?
Spaz
|
|
|
|
|
I have an In-Proc server that needs a service by a client exe. So, I added an interface to the now "Out-of-Proc" client exe for the now 'client' In-Proc. Everything compiles except during run-time, I am getting the following error: "0x80010105: The server threw an exception." when the new interface is accessed. I am not sure if this can be done this way. Anyone have any ideas?
|
|
|
|
|
Hi,
I've just successfully implemented my first ever automation client. It works well, however, I have this problem that if my app dies abnormally, or I press the debug stop button, my app is gone leaving the server process still running, unreleased, hogging 80Mb of RAM. Is there a good way to make it so that if the client dies, the server app will automatically follow suit?
Joel Holdsworth
|
|
|
|
|
Hi,
I need to do a web based client-side application, and ActiveX was the unique solution I've found to track client requirements. But this application needs a toolbar and 3 splitted windows with different controls inside and I started ActiveX search last friday.
I've tried CWnd::Create when OnCreate of the COleControl, and after the crash, I tried to add a toolbar in the Control, but nothing worked. Only if I do something in OnDraw I can see something when I test that.
I've seen some controls made with MFC but none of them seems to have windows or toolbars, they're all dialog based. Is possible to do that thing? or is there a better way.
I don't know where to go from here. Do you know any samples or books?
Thanks in advance
|
|
|
|
|
Hi!
I'm just starting COM,and have to submit a project this semester... advanced networking and COM. we are a team of four... Can anyone suggest a good topic for the project... one such that i can show it on my resume... thanks!
|
|
|
|
|
Hi,
I really need your help. I'm trying to call the Render method in IPictureDisp, but I seem to be messing up my array of VARIANTs. Because every time I execute the code it gives me HRESULT 0x80020005: Type mismatch. I can't see what I'm doing wrong though:
arguments[9].vt = VT_HANDLE;
arguments[9].lVal = (LONG)dc;
arguments[8].vt = VT_I4;
arguments[8].lVal = destrect.left;
arguments[7].vt = VT_I4;
arguments[7].lVal = destrect.top;
arguments[6].vt = VT_I4;
arguments[6].lVal = destrect.right - destrect.left;
arguments[5].vt = VT_I4;
arguments[5].lVal = destrect.bottom - destrect.top;
arguments[4].vt = VT_I4;
arguments[4].lVal = 1;
arguments[3].vt = VT_I4;
arguments[3].lVal = 1;
arguments[2].vt = VT_I4;
arguments[2].lVal = MulDiv(destrect.right - destrect.left, HIMETRIC_INCH, ::GetDeviceCaps(dc, LOGPIXELSX));
arguments[1].vt = VT_I4;
arguments[1].lVal = MulDiv(destrect.bottom - destrect.top, HIMETRIC_INCH, ::GetDeviceCaps(dc, LOGPIXELSY));
arguments[0].vt = VT_BYREF;
arguments[0].byref = &destrect;
dispparams.rgvarg = arguments;
dispparams.rgdispidNamedArgs = NULL;
dispparams.cArgs = 10;
dispparams.cNamedArgs = 0;
result = picture->Invoke(DISPID_PICT_RENDER, IID_NULL, 0, DISPATCH_METHOD,
&dispparams, NULL, &exception, &argerr); and the documentation says that the function should have the form
HRESULT Render(
HDC hdc, long x, long y, long cx, long cy, OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc, LPCRECT prcWBounds); I guess I must have my variants set up wrong, but I just can't see the problem! Right now the parameters are put in the array in reverse order, but I've tried it in forwards order. When I run it then I get the error E_INVALIDARG. I'm very confused.
Cany you help me at all?
Joel Holdsworth
|
|
|
|
|
Joel Holdsworth wrote:
arguments[0].vt = VT_BYREF;
arguments[0].byref = &destrect;
AFAIK the VT_BYREF is not valid value of VARIANT's vt field. Look at MSDN's "VARIANT and VARIANTARG" topic and "VT_EMPTY|VT_BYREF Not valid" there.
Try to write:
arguments[0].vt = VT_BYREF | VT_I4;
With best wishes,
Vita
|
|
|
|
|
Ah thanks mate! It turned out to be just "VT_I4" in the end . Now there's a function call that is most definitly not 64-bit friendly! Thanks for the hint.
Joel Holdsworth
|
|
|
|
|
To spare yourself of lots of bulk code, do a QueryInterace for IPicture instead. It's a vtable-based interface.
Good music: In my rosary[^]
|
|
|
|
|
I am new to DCOM. I have an application that continually fails to start. Tech support has advised me to go into properties of the object in DCOM config to set launch permissions. When I right click on the object I don't have propertites to go to, on view. Tech support for the application can't even tell me how why I don't have properties available. I have tried as a user in the Administrators group, I have tried with the built in administrator account, and still nothing. Can someone please help me?
|
|
|
|
|
Hello everybody, I am a fresh in COM.
I want to create a COM in singleton mode. So there only
one instance in system. Multi clients share the object.
For example, if one client change a member of the COM
object coclass, other clients are affected.
How to implement? Is this possible?
thanks
|
|
|
|
|
if the clients are in same thread department, then it is possible, just need this macro:DECLARE_CLASSFACTORY_SINGLETON
|
|
|
|
|
Thanks
if client is in different process, is it impossible?
If you proxy & stub method, is it possible?
|
|
|
|
|
if the clients are in deifferent processes, that means each clients is in different department, so it's impossible, I've never done with proxy & stub, so I'm not sure if it is possible, by my personal assumption, it's imposible, because proxy &stub is used to marshal data between client and com server. it doesn't change the com's mechanism. hope I can be understood.
give a hand,have a heart
|
|
|
|
|
I don't have Essential COM by Don Box with me tonight, so I can't cite any specifics. But I do remember him advising AGAINST using singletons as described in a post below. If I recall correctly, the major concerns were performance, as the singleton would become a major bottleneck in a distributed system (I assume your system is a distributed one, as you mention multiple clients).
Either try to find the book in your library, buy it, or try googling on "COM singleton Don Box".
Good music: In my rosary[^]
|
|
|
|
|
Is there any way that i can export VC++.Net Basic STL Data types in a DLL
written using VC++.Net call that function returning the value as STL data type of .Net , from a C# program ?
|
|
|
|
|
is there any proper way of exporting the .Net Data types such as
[std::string] from a DLL written in VC++.Net to a calling program written in C#
|
|
|
|
|
Hi,
I want to develop GUI-based plugin for Win32 IDE. I want to add a menu item to VC++ IDE. I m a beginner in COM & ATL programming, but I suppose I can use COM & ATL to create GUI plugin for VC++ editor. Please suggest/help/direct/guide me for same?
|
|
|
|
|
I have a dialog based application very simple (visual c++ .net). i added a windows media player control to the dialog resource. next i gave an id IDC_PLAYER. next i added a variable called m_ctrlPlayer(Add Variable). I have also a button (play) and below is the event handler for that button.
void CWindowMediaDlg::OnBnClickedPlay()
{
// TODO: Add your control notification handler code here
m_ctrlPlayer.GetControls().play();
}
i get this error when i try to compile the project....
error C2039: 'GetControls' : is not a member of 'COcx1'
ocx1.h(11) : see declaration of 'COcx1'
error C2228: left of '.play' must have class/struct/union type
and here is how COcx1 looks...
#pragma once
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++
// NOTE: Do not modify the contents of this file. If this class is regenerated by
// Microsoft Visual C++, your modifications will be overwritten.
/////////////////////////////////////////////////////////////////////////////
// COcx1 wrapper class
class COcx1 : public CWnd
{
protected:
DECLARE_DYNCREATE(COcx1)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x6BF52A52, 0x394A, 0x11D3, { 0xB1, 0x53, 0x0, 0xC0, 0x4F, 0x79, 0xFA, 0xA6 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID);
}
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey);
}
// Attributes
public:
enum
{
amvUninitialized = 0,
amvLoading = 1,
amvInteractive = 3,
amvComplete = 4
}ReadyStateConstants;
enum
{
mpStopped = 0,
mpPaused = 1,
mpPlaying = 2,
mpWaiting = 3,
mpScanForward = 4,
mpScanReverse = 5,
mpClosed = 6
}MPPlayStateConstants;
enum
{
mpDefaultSize = 0,
mpHalfSize = 1,
mpDoubleSize = 2,
mpFullScreen = 3,
mpFitToSize = 4,
mpOneSixteenthScreen = 5,
mpOneFourthScreen = 6,
mpOneHalfScreen = 7
}MPDisplaySizeConstants;
enum
{
mpReadyStateUninitialized = 0,
mpReadyStateLoading = 1,
mpReadyStateInteractive = 3,
mpReadyStateComplete = 4
}MPReadyStateConstants;
enum
{
mpTime = 0,
mpFrames = 1
}MPDisplayModeConstants;
enum
{
mpShowURL = 0,
mpClipURL = 1,
mpBannerURL = 2
}MPMoreInfoType;
enum
{
mpShowFilename = 0,
mpShowTitle = 1,
mpShowAuthor = 2,
mpShowCopyright = 3,
mpShowRating = 4,
mpShowDescription = 5,
mpShowLogoIcon = 6,
mpClipFilename = 7,
mpClipTitle = 8,
mpClipAuthor = 9,
mpClipCopyright = 10,
mpClipRating = 11,
mpClipDescription = 12,
mpClipLogoIcon = 13,
mpBannerImage = 14,
mpBannerMoreInfo = 15,
mpWatermark = 16
}MPMediaInfoType;
enum
{
dvdMenu_Title = 2,
dvdMenu_Root = 3,
dvdMenu_Subpicture = 4,
dvdMenu_Audio = 5,
dvdMenu_Angle = 6,
dvdMenu_Chapter = 7
}DVDMenuIDConstants;
enum
{
mpShowDialogHelp = 0,
mpShowDialogStatistics = 1,
mpShowDialogOptions = 2,
mpShowDialogContextMenu = 3
}MPShowDialogConstants;
// Operations
public:
};
someone pleaze tell me how i fix this problem. thax
thanx hussein
|
|
|
|
|
Hi,
I want to know how to get CLSID of a particular activex control given its name. Is there any API to do so?
|
|
|
|
|
Hi,
Here is the API to get the CLSID of the activex control.
CLSIDFromProgID(...)
Hope this would help.
Cheers,
Vishal
|
|
|
|
|