Is it possible to have a COM method which passes a HWND? With the following method in my object CoCreateInstance returns DISP_E_BADVARTYPE (0x80020008): STDMETHODIMP ShowDialog(HWND hWndParent); So far, I'm getting round this problem by passing an OLE_HANDLE then casting it but it feels like a cludge: STDMETHODIMP ShowDialog(OLE_HANDLE hWndParent); read more
Looking for a help with com server on C++. Here is C# client code to invoke method: public static object ComInvoke(string method, params object[] args) { return _comObj.GetType().InvokeMember(method, BindingFlags.InvokeMethod, Type.DefaultBinder, _comObj, args); } This is how I call it: string[] result = (string[])ExplorerCore.ComInvoke("CopyFiles", new object[]{"arg1_1", "arg1_2"}, "arg2"); I always get [...] read more
i am trying to find and highlight text in word file progrramatically but when the line bool highlighted = range.Find.HitHighlight execute then a exception is occuring and the exception message is Bad variable type. (Exception from HRESULT: 0x80020008 (DISP_E_BADVARTYPE)) i am not being able to find out the reason what [...] read more
I have an Visual C++ (MFC) application using ADO to access a Microsoft SQL Server database. I'd like to start using DateTimeOffset columns but I'm getting an exception. Here's a code snippet: HRESULT hRes = pRecordset.CreateInstance(__uuidof(Recordset)); FieldPtr fieldPtr = pRecordset->Fields->GetItem(bstrFieldName); DataTypeEnum type = fieldPtr->Type; _variant_t vFieldValue = fieldPtr->Value; Assigning Value [...] read more
I'm interfacing with a VB application using a C++ client code. I'm totally a novice in this (I'm just a Chemical Engineer), so please excuse me if the question is dumb. So the following code in VB is required to access "BackDoor" interface, I can get all other interfaces because [...] read more
I have made one windows Form application in C#. I have added one DLL reference in that application and called method of that DLL. Its working fine. But when I have made web application and added reference of same DLL and tried to run then I am getting error as [...] read more
I've created a SharePoint 2007 Sequential Workflow and am trying to activate two workflows (one approval and one feedback) programmatically. workflowProperties.Site.WorkflowManager.StartWorkflow(workflowProperties.Item, association, association.AssociationData, true); I use this code to start the work flow and the association is created on the fly. The problem arises when I am trying to access [...] read more