Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
all groups > dotnet interop > january 2007

Filter by week: 1 2 3 4 5

String conversion b/t C# and native C++
Posted by mtv at 1/31/2007 12:40:00 PM
This question is probably already out there, but there's none I could find for my scenario. My C++ code has: CFunction(const char* data); My C# code references C++ dll and needs to call this function. What data type in C# is it for "data"? I think it will work w/ sbyte*, but then, how do I...more >>


c# dealing with c++ dll
Posted by jerome.dapot NO[at]SPAM voila.fr at 1/31/2007 9:09:09 AM
I try to use a c++ dll in c#. The dll is call by myfct(char* param) is it possible to retreive in c# the new value of param witch has been modified by the function call ...more >>

.Net 2005 Windows App with Reference to Word 2003 DLL
Posted by Chris at 1/31/2007 7:09:00 AM
Hello: I have a C# Windows App that has a reference to the Word 2003 dll, which from my understanding of things will boil down to the Microsoft.Office.Interop.Word.dll PIA that lives in the GAC of the Development Machine (e.g, my machine), since I have Office 2K3 installed on my development...more >>

GetPrinter Call in x64 caused a FatalExecutionEngineError expectio
Posted by SteveYau at 1/31/2007 12:05:00 AM
Hi There, I tried a simple VB.Net console program that uses win32 api call on WinSpool.drv to query a local or remote printer's sharing status. The API calls I used are OpenPrinter, GetPrinter and ClosePrinter. The program runs perfectly on x86 32-bit platform. However, when I compile ...more >>

SendMessage with EM_FORMATRANGE does not update rectangle
Posted by Keith Patrick at 1/30/2007 5:04:35 PM
I'm trying to print out a RichTextBox using MS' sample code, but when I send the message to print out the control, it's supposed to update the internal ..rc (the rectangle with the drawing bounds) with the dimensions that the draw operation actually took. Has anyone tried this operation befor...more >>

ASP.NET Excel Problem
Posted by No_Spam at 1/29/2007 6:42:18 PM
I'm using Microsoft Excel Object 11.0 (Microsoft.Office.Interop.Excel) to open excel from my web application and set few cells values before displaying it to users. When I deployed the website to the server, the site won't run because: - "Could not load file or assembly 'Microsoft.Office.In...more >>

Marshalling Rectangle to LPRECT?
Posted by Chris Ashley at 1/29/2007 2:36:24 AM
I am writing a C++ wrapper and need to marshal a System::Drawing::Rectangle to an LPRECT. Is this possible, and if so, how do I go about doing this? Thanks, Chris ...more >>

casting void * or IntPtr to managemed object
Posted by James Whetstone at 1/27/2007 5:20:33 PM
Hello, I've got a DLL function that return a void * pointer very similar to malloc(), and I need to cast it to a managed type. For this example, I'd be happy to cast it to a string type. Can anyone shed some light on how to do this in C#? Thanks! JW ...more >>



Marshalling DEV_BROADCAST_PORT: C# P/Invoke declaration?
Posted by Whitney Kew at 1/26/2007 12:08:37 PM
Hello, I have some VS 2005 code in which I am setting up a C# declaration of the Platform SDK header DEV_BROADCAST_PORT. That structure is declared in the Platform SDK header file dbt.h as follows: typedef struct _DEV_BROADCAST_PORT_A { DWORD dbcp_size; DWORD dbcp_de...more >>

COM InterOp - Interface ?s (Great COM InterOp Links within)
Posted by JerryWEC at 1/26/2007 11:54:22 AM
Hi all, below is most of my code for my COM InterOp object (For those = following previous posts - I'm not using Inheritance any longer). My class Logging is implementing ILogging and exposing LogToFile() and = LogToScreen(). In the VB6 project the properties are showing up under = the ILogg...more >>

Using COM objects in ASP.NET and postback problems
Posted by Alain Sienaert at 1/26/2007 1:00:40 AM
Hi, I'm currently investigating the possibility of upgrading an existing website (ISAPI written in Delphi) to an ASP.NET 2.0 application (Visual Studio 2005 - C#). The website itself communicates with an executable (ColPro.exe) that support COM+. The idea is that for every user (ASP.NET se...more >>

Unable to debug
Posted by L-E Eriksson at 1/25/2007 5:04:13 PM
Hello! I have a vb.NET dll that I use from Excel. From Excel the functions in the dll is called. This works and has done so for a long time. But what has stopped working is debugging. After changing computer I can't debug calls from Excel to the component. Of course I have in the property...more >>

OLE/COM Object Viewer (oleview.exe) Errors
Posted by JerryWEC at 1/25/2007 3:00:30 PM
Hi everyone, I'm getting the following messages while trying to open a .tlb file I'm generating from VS2005... Msg1: MkParseDisplayName(... ""I:\DEV\CLA_Logging\CLA_Logging\bin\Release\CLA_Logging.tlb""...) failed. Invalid syntax MK_E_SYNTAX($800401E4) Msg2: The command line ("I:\...more >>

Typical C++ string to C# dll question
Posted by Kyle Szklenski at 1/25/2007 9:09:18 AM
Hi. I suppose I'm not the first to ask this, especially given that I searched and found a few similar things posted here. None of them, however, answered my question. My question is this: I'm trying to pass a normal std::string from VC++ 6.0 to a C# DLL. My .cpp file for my VC++ console applic...more >>

Using reflection on Interop activex-dll object?
Posted by cit42 NO[at]SPAM web.de at 1/25/2007 2:12:58 AM
Hello, I want to write a unittest that compares the property-values of a managed-object with the property-values of an object instantiated via interop. Background is: I have a vb6-class with many public properties. The properties will be filled by a Read-method from a file and can be written...more >>

Excel always running
Posted by KaNos at 1/24/2007 10:32:31 PM
Hello, I'm programming an C# application which uses Automation. The problem is when I quit the application a ghost of excel is always running (Can be seen in all processes with th task manager). What is the solution ? Thanks...more >>

Receiving a phone call using TAPI3
Posted by Deepak Nawathe at 1/24/2007 8:55:23 PM
I am developing an application which uses TAPI3 and a data modem. I want to receive a call using this application and then the caller will be able to hear some TTS in reponse. I could receive a call using TAPI3 APIS. but i couldn't answer the call. To be specific I could get the IBasicCall...more >>

COM Interop - Interface Questions
Posted by JerryWEC at 1/24/2007 6:26:20 PM
Hey guys, I'm trying to get Com Interop to work for my class library I have wrote. It works fairly good for .net clients as is. So now I'm trying to add a COM Wrapper for it to expose it to a VB6 client. I have discover the best way to do this is to use the following attribute and an Inte...more >>

Windows Communication Framework
Posted by Gaurav Vaish (MasterGaurav) at 1/23/2007 1:16:22 PM
Hi, I have recently published an article on WCF at CodeProject http://www.codeproject.com/useritems/edujini_wcf_scart_01.asp It would be great the experts can provide a feedback on the same. Please note that this is my first article in the series. I have submitted Part-2 t...more >>

COM Wrapper ?s
Posted by JerryWEC at 1/23/2007 12:16:24 PM
Hi All, I'm getting the following message in VB2005... "Warning 2 'Microsoft.VisualBasic.ComClassAttribute' is specified for class 'ComLogging' but 'ComLogging' has no public members that can be exposed to COM; therefore, no COM interfaces are generated. I:\DEV\CLA_Logging\CLA_Logging\Co...more >>

Intellisense in VC6 from C# tlb
Posted by escristian NO[at]SPAM gmail.com at 1/23/2007 8:35:42 AM
I have a project written in C#, which I then create a TLB from. In VC6 I import this .tlb which in turns generates a tlh file. Intellisense gets it's information from this .thl file ( I tested it). The only problem is that in the method declarations it always puts pRetVal as the name of the ar...more >>

error 800401f9 when retrieving the com class factory
Posted by Gary at 1/23/2007 7:05:21 AM
I am writing a program to interface with ACT (a crm database ((version 6))) I had this done a year ago. I can't figure out what I did. I have found my old code and it's no longer working. I dont know why. I have since reinstalled the machine, so am not sure if the dll's are the same anymore. ...more >>

CreateInstance -> UnauthorizedAccessException
Posted by Benjamin at 1/23/2007 3:01:04 AM
Hi! I have a problem with my development machine. The "VB6Object.ClassName" is a VB6 dll component that I have started in the background. Dim objectType As Type Dim obj As New Object objectType = Type.GetTypeFromProgID("VB6Object.ClassName") obj = Activator...more >>

Register Assembly Error ?
Posted by JerryWEC at 1/22/2007 5:29:46 PM
Hi All, I'm getting the following error message while trying to re-build my solution (to create the .dll and .tlb files)... "Error 1 Cannot register assembly "I:\DEV\CLA_Logging\CLA_Logging\bin\Release\CLA_Logging.dll" - access denied. Access is denied. (Exception from HRESULT: 0x80070005 ...more >>

can I call non-exported unmanaged functions from managed code?
Posted by brad at 1/22/2007 4:49:50 PM
I'm writing test automation for a native dll using manage code. I know that I can use Platform Invoke to call exported, native functions from my managed code. What if the native function isn't exported? Can I still call it using P/Invoke? In this particular case, I DO have access to the s...more >>

Topmost visible window
Posted by pigeonrandle at 1/22/2007 11:27:37 AM
Hi, I am building an application that is similar to spy++. I want the user to be able to click on a 'window' (textbox/combo/etc) and have it highlighted. BUT... the window they click on may share common coordinates with another window, so how do i find the topmost visible window, given a top...more >>

Trying to Display a non-modal VB6 Form of an AcitveX DLL in C#
Posted by Martin_Bürkle at 1/21/2007 6:07:07 PM
Hallo NG, I'm trying to display a VB6 6 of an ActiveX DLL in c Sharp. I use therefore the SetParent API function. After this function call I get always the error message "Non-modal forms cannot be displayed in this host application from an ActiveX DLL, ActiveX Control, or Property Page.". ...more >>

How to convert String[] to IntPtr (LPCWSTR) ?
Posted by sergio.rykov NO[at]SPAM gmail.com at 1/21/2007 4:53:18 AM
Marshal.StringTo... methods convert only one string to unmanged memory. Native method takes LPCWSTR - an array of strings. How to convert string[] to IntPtr ? I couldn't test one my suggestion .... = Marshal.StringToHGlobalUni("lalala\0lalala2\0lalala3"); ...more >>

Help with CLR security
Posted by Robert Ellis at 1/20/2007 5:02:02 PM
Hi, I would be grateful for advice on the following. Server 1 (Windows 2003 Server) COMSRV1 VB6 COM ActiveX EXE NETSRV1 .NET (VB2005) .DLL Workstation 1 (Windows XP Professional) APP1 VB6 Standard EXE application APP1 calls COMSRV1 using DCOM. This works fine for Do...more >>

How to use VB2005 .dll Class Library in VB6 ?s
Posted by JerryWEC at 1/19/2007 2:03:18 PM
Hi everyone! I'm trying to use my CLA_Logging.dll (VB.net 2005) in VB6. I have used the following to create a type library... tlbexp cla_logging.dll /nologo /silent /verbose tlbexp cla_logging.dll /nologo /verbose Both times the cla_logging.tlb file was created. (only 2k in size ???) ...more >>

Using a .NET COm Interop DLL from VB6
Posted by Chad at 1/19/2007 10:13:23 AM
Can someone please help? I have verylittle time to coirerct this issue: Someone gave me the following .files compiled with Visual Studio 2005 from a ..NET library compiled with COM Interop. Roberto2.tlb Roberto2.dll Not sure what I'm doing...On my PC, I executed these statements: C:\W...more >>

Using .NET dll with vb5
Posted by virallinen NO[at]SPAM gmail.com at 1/19/2007 6:07:45 AM
Hi all I am having problems with using my dll with vb5 program. I created a simple dll with vb.net 2.0 using vs2005 and tested it first on a vb6 program that I created on the same computer as my vs2005 is. Then I copied the the dll file to another computer and used regasm to register it. Cr...more >>

MI5 Persecution: what people said (3967)
Posted by MI5Victim NO[at]SPAM mi5.gov.uk at 1/19/2007 1:30:43 AM
From: aa1gha@zen.sunderland.ac.uk (gillian.hardy) Newsgroups: uk.misc,uk.legal,uk.politics,uk.politics.misc,uk.media Subject: Re: Read About "MI5 Persecution" on the Web! Date: Mon May 13 21:27:26 1996 : In article <Dr5sDI.50x.0.bloor@torfree.net>, bu765@torfree.net wrote: : |> This...more >>

Need help with scripting events from .NET object
Posted by Jayme Pechan at 1/18/2007 9:19:12 AM
I've built an object with a ComSourceInterface using C#. I am then trying to use the control from C++. I can load the control and call functions with no problem but when I try and sink events, I get to the Advise call and it fails with a E_NOTIMPL. I'm assuming this is refering to the fact ...more >>

Implement non-COM C++ interfaces in .NET C#
Posted by Michael Shishkin at 1/17/2007 5:56:08 PM
Looking for help with non-COM C++ interfaces implementation. I can’t find any reference on how to implement / use non-COM C++ interfaces in C#. I have an application that uses COM interfaces from one of the Microsoft services and have no problems using those. However, there are few interfac...more >>

Can you use same interop dll when COM dll version changes?
Posted by Peter Row at 1/16/2007 11:51:49 AM
Hi, If you use the framework to generate an interop assembly or you obtain a primary interop from the vendor and then use it in your application will it still work if the COM DLL gets updated to a new version without having to recompile with a new interop assembly? Obviously if the inter...more >>

Returning pointer to array from C++ COM component to C#
Posted by tony.towers NO[at]SPAM gmail.com at 1/16/2007 10:00:41 AM
I need to use a third party COM component. One of the methods has the idl signature:- HRESULT CalculateHash([in]BYTE* pDataBuffer, [in]long nDataBufferSize, [out, retval] BYTE* pHashResult); Both pDataBuffer and pHashResult are pointers to BYTE arrays, the size of pDataBuffer is governed by...more >>

IErrorInfo to COMException problem
Posted by Burgazon at 1/15/2007 11:12:00 PM
Hi, I have a COM-.NET exception handling problem and I would appreciate your help. I have a COM server that “throws exception” from time to time (the COM object implements ISupportErrorInfo and generates IErrorInfo objects upon errors). The IErrorInfo object that is generated by my CO...more >>

Calling .net window using COM
Posted by Feldaspar at 1/15/2007 10:08:11 PM
Hi, I'm trying to call a .net window using COM, this my .net code: ------------------------------------------------------------- [ComVisible(true)] [ClassInterface(ClassInterfaceType.None)] [ProgId("Hcn.Cv.CVSupportPrompt.1")] [Guid("8DFA5C56-A510-11DB-AB24-9F7255D89593")] public class Cr...more >>

Windows CBT Hooks (Help!)
Posted by andyblum NO[at]SPAM gmail.com at 1/15/2007 9:47:23 AM
I hope you can answer a question. I am writing a poker utility that tracks what windows are open and displays information about opponents that are still playing and their previous history that is stored in a game DB. It is a very cool project with Pattern Recognition (Pixel Screen SCraping to ...more >>

DnsRecordListFree
Posted by Michael M. at 1/14/2007 5:41:24 PM
Hi all, I am using the API function DNS_Query(). I pass a null pointer to the function, the function does it's magic and fills pointer with the address of the first record. I then read the data at this address into a structre The structure has a member variable pNext that contains a po...more >>

Anyone gotten SHGetFolderLocation to work?
Posted by Ian Boyd at 1/13/2007 9:31:51 PM
Has anyone been able to get SHGetFolderLocation to work? i see plenty of posts about people having problems with it, and one fellow saying it is not possible to use under .NET. For me it returns 0x80070057 "The parameter is incorrect" using System; using System.Runtime.InteropServices; u...more >>

msoeapi typelib?
Posted by Vinz at 1/13/2007 12:11:36 AM
Hello folks, After 1 evening of trying and reading a lot of (web)pages I have not succeeded in creating a .tlb file (to use in a C# program) from my msoeapi.idl file. Also I'm a bit confused because some sources say MIDL.exe makes the type library and some say TlbImp.exe creates it. I tri...more >>

Need a method to send byte arrays from Unmanaged C DLL to VB.Net
Posted by Vince Castellano at 1/12/2007 3:55:55 PM
Hello, I posted this to m.p.d.languages.vb, but was told this is a better place to ask (and I worded my question poorly there, so I think I miss-communicated my question). What I need to do is send a parameter from VB.net to an Unmanaged C dll call, and that parameter on the C side is a point...more >>

Automation add-in stopped working, please help.
Posted by aaronfude NO[at]SPAM gmail.com at 1/12/2007 5:35:22 AM
Hi, I have written an automation add-in some time ago that merely adds a few functions to Excel. It has always worked, but now it has stopped! When used in a cell, I get "#NAME?". When called via VBA it says "The macro 'sqr' cannot be found". I have tried everything I could think of... Reco...more >>

COM interop multithreading problem : Unable to cast COM object of type 'System.__ComObject' to interface
Posted by ziphnor NO[at]SPAM gmail.com at 1/12/2007 4:27:49 AM
Hi, I have a DirectShow filter which implements a COM interface called IDVBSubtitle. It is defined like this on the C++ side (simplified version used to debug of course, real interface has more methods :) // C19647D5-A861-4845-97A6-EBD0A135D0BF DEFINE_GUID(IID_IDVBSubtitle, 0xc19647d5, 0xa...more >>

Access protected members of a class from another class
Posted by Bumbala at 1/11/2007 7:09:01 AM
Hello, I am working on a Windows Forms Control Library project which has some unmanaged code in it. This library will be used in C# Windows Application. Some of the managed classes have protected unmanaged class members. They must be reached by other classes inside the Library, but not outsid...more >>

Managed iphlpapi.dll-GetAdapters ??
Posted by Bragadiru at 1/10/2007 6:00:49 PM
Hi all, I want to get the list of adapters for local computer. There is any managed class ? I used : [DllImport("iphlpapi.dll", EntryPoint="GetAdaptersInfo", SetLastError=true)] private static extern int InternalGetAdaptersInfo(IntPtr pIpAdapterInfo, ref uint pulSize ); BUT, I have ...more >>

Activator.CreateInstance Question
Posted by Johnny R at 1/10/2007 5:46:52 PM
Hello, I'm loading a Class from Assemly DLL using Activator.CreateInstance. That loaded Class is executed in a worker Thread with no loop. What actually happends when class is loaded using Activator.CreateInstance? If I create same class using Activator.CreateInstance many times will ther...more >>

Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLDocumentClass'
Posted by Nandan Dharwadker at 1/10/2007 1:44:27 PM
Hi, I am trying to read the results of a web page and display them in a web browser control. I am using .NET framework 1.1, though the clients machine has framework 2.0 as well. The following code //before navigate event of the browser private void axWebBrowser1_BeforeNavigate2(object s...more >>


DevelopmentNow Blog