When I run the following code, I get the exception below:
''# NOTE: ExcelApp is a Private main form variable
Dim ReportBooks As Excel.Workbooks = ExcelApp.Workbooks
Dim ReportBook As Excel.Workbook = ReportBooks.Open(localFilename)
Dim ReportSheet As Excel.Worksheet = ReportBook.Sheets("Report")
''# Retreive data from sheet
ReleaseCOM...
I am trying to write a class that uses ADO to retrieve SQL records. The intent is for the class to maintain one private recordset an other methods move forward, retrieve fields, etc. This is a basic example of my class:
class SqlADO {
private:
ADODB::_RecordsetPtr _recordset;
public:
void Open(); //open the connection
vo...
I have a classic asp page which allows a user to upload a file. I can retrieve the binary content of the file (verified this matches the original file exactly) but then I need to pass the data to a COM Visible .Net assembly. The data is marshaled across as a string object but when I decode it using the Unicode encoding there is some data...
I have a [ComRegisterFunction] that I am using to register a BHO Internet explorer extension. During registration on 64-bit windows 7 machines, a UnauthorizedAccessException
is thrown on the call to subKey.SetValue("NoExplorer", 1).
The registry appears to have BHO's located @ \HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersio...
I am currently working on a .Net application which makes HTTP requests to some web applications hosted on a IIS server. The application is deployed through ClickOnce and is working fine on simple networks architectures.
One of our customers has a very complex network involving a custom authentication server on which the user has first to...
Hi Guys, So i've got this little static method in a .Net class which takes a string, uses some stored public key and returns the encrypted version of that key. This is basically so some user entered data can be saved an encrypted, then retrieved and decrypted at a later date. Pretty basic stuff and the unit test works fine.
However, ...
I am using COM Interop. I have a call in VB6 which returns a string of roughly 13000 chars. If I execute the call in pure VB6 it takes about 800ms to execute. If I execute it via c# and COM Interop it takes about 8 seconds. I'm assuming the delay is caused by marshaling.
If I am correct about marshaling, I'd be grateful if someone coul...
Hello All,
I am trying to gain access to a .NET class library in Microsoft Excel. To do this I know that the .NET class library must be registered with COM. So I tried going to my Assembly Info and Setting COM Visible to true. Then on the build tab I set Register for COM Interop for true also. I checked the AssemblyInfo.cs file and it do...
Question: I need to call a C# dll from a C++ executable.
I use COM, and it works fine for int, long and bool. But I can't get a string along...
The IDL file says it's a BSTR, but I can't pass it correctly, and neither retrieve one.
I tried using wchar_t* and using sysalloc as I did with VB6, but that doesn't seem to work.
Anybody knows...
Until recently, I believed that the .NET runtime only increases the reference count of COM objects by 1 when creating a runtime-callable wrapper, and that only one such runtime-callable wrapper is created for any given COM object.
If I'm not mistaken, the above implies that Marshal.FinalReleaseComObject and Marshal.ReleaseComObject do t...
I have a third party assembly with a public abstract class implementing a certain COM interface. Something to the effect of
[ComVisible(true)]
public abstract class SomeClass: ISomeInterface
{
....
public void Method1() {...}
}
The actual object is an internal object extending the SomeClass and is instantiated by the third party c...
I'm trying to do some COM interop and attempting to invoke the INetCfgComponent::RaisePropertyUi method. I've gotten to the point where I can enumerate devices and get a valid INetCfgComponent for the adapter that I want to display the UI for.
However, I'm a COM newbie (let alone COM interop) so I have no idea what the third argument in...
Hello,
I am doing some COM Interop work with Excel and other Office Automation Software.
A Co-Worker has mentioned to me that I need to wait for these Automation Servers to become ready after issuing a command to them.
I, however, cannot see the purpose of this as don't all calls block until the automation server completes the given ...
hi guys,
i'm a newbie to ASP.net interop features, so what i have right here is some unmanaged dll that i need to call from my asp.net mvc app.
the dll name is CTSerialNumChecksum.dll. i can easily call the dll from asp using just those two lines below and from my trusty response. write everything is working fine.
set CheckSumObj = Ser...
I have a method defined in IDL as follows :
interface IMyFunc : IDispatch
{
[id(1), helpstring("method GetNextFunction")] HRESULT GetNextFunction(
[in,out] long* lPos, [out, retval] BSTR* bstrName);
}
Using C++ I always implemented this as follows :
STDMETHODIMP CMyFunc::GetNextFunction(long *nID, long *lPos, BSTR *bstrNa...
I have a .NET windows forms application compiled as x86 – it needs to be compiled as x86 because it references 3rd party DLLs which are 32 bit. The application uses COM interop to automate Office applications and also AutoCAD. My question is: will my COM interop code work okay on a 64 bit operating system against the 64 bit versions of O...
I'm querying an MFC implemented COM object that is implemented as follows:
class CA :
public MfcComLib::IA
{
...
};
class CB :
public MfcComLib::IB
{
...
};
class ATL_NO_VTABLE CExposedCoClass :
public CComObjectRootEx<CComSingleThreadModel>,
public CA,
public CB
{
public:
BEGIN_COM_MAP(CExposedCoClass )
COM...
I'm trying to use midl to turn an idl file into a tlb. However, when I try I get this warning:
warning MIDL2015: failed to load tlb in importlib : mscorlib.tlb
and I then get a subsequent error:
error MIDL2337 : unsatisfied forward declaration : _Object.....
I'm certain that the error is due to the first warning. I've tried the same ...
Assume that I have a .NET Workflow Foundation (WF) SequenceActivity class with the following "output" property:
public IWorkspace Workspace { get; private set; }
// ^^^^^^^^^^
// important: this is a COM interface type!
public static DependencyProperty WorkspaceProperty = DependencyProperty.Register(
"Workspace",
...
I have a 3rd party COM libary that I'm consuming and am having problems with array parameters.
The method signature that I'm calling is as follows:
int GetItems(ref System.Array theArray)
The documentation says that the method's return value is the number of items it will populate into the array, but when it get's called, all of the ...