Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


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
May 2008
June 2008
February 2010


all groups > dotnet interop > may 2004

Filter by week: 1 2 3 4 5

Strings handling in vb
Posted by Savinay S.J at 5/31/2004 10:20:47 PM
Hi, I have a string "Step n" where n may vary from 1 to 100. I am taking this string from a list box. Now I need to seperate n from the step and want to convert n to an integer. I am using VB6.0 Regards, Savinay *** Sent via Developersdex http://www.developersdex.com *** Don't just ...more >>

Share CDO Session Among Threads
Posted by Gary Lee at 5/31/2004 6:43:43 PM
In VB.NET using CDO, I'd like to allow multiple threads to share a single MAPI.Session object. If I declare and instantiate sessions within each thread, I'm OK (although this negates the efficiency I'm looking to add). But when I declare, e.g., Public objSession As MAPI.Session I can'...more >>

Strange behavior of Assembly Loader in COM Interop scenario
Posted by Etienne Fortin at 5/31/2004 3:30:02 PM
I use a .NET class exposed as a COM object to the unmanaged world. The assy containing the class is registered for COM with the /codebase option so that it's not necessary to register the assy in the GAC. This .NET class dynamically load assy (let's call them plugins) from various location on the...more >>

Binary compatability?
Posted by Kai Hietala at 5/31/2004 8:51:31 AM
Hi, I've made a C# dll that I'm accessing with VB6 clients. My problem is that when I make changes to the C# dll the clients stop working. This makes bug fixes quite an ordeal. I've read that for versioning purposes it is best to make a separate interface that is exposed to the COM world...more >>

C# Multithreading
Posted by Michael C at 5/31/2004 5:04:44 AM
Hello Can someone please tell me what I'm doing wrong? I'm writing an application that should be using callbacks to perform asynchronous calls to the Win32 API. Problem is it never reaches my callback function. Any feedback is appreciated. Also, any references to websites with examples of ...more >>

converting from header files to Win32API declare
Posted by Majed at 5/30/2004 4:04:19 AM
hi, I'm trying to convert some .h files to API Declaration to use the function and structs. one of it is this: NTMS_GUID CurrentLibrary; // the current library NTMS_GUID MediaPool; // media pool that the media belongs to NTMS_GUID Location; // actual location of the media DWORD Location...more >>

Best way to deal with WINDOWPOS in WndProc
Posted by Oren Novotny at 5/29/2004 5:17:39 PM
There seem to be two basic ways of dealing with lParam values when overriding the WndProc -- 1) us Marshal.PtrToStructure/StructureToPtr 2) use an unsafe code block and do a cast It seems like the latter is more annoying... Suppose I want to change value of a struct member in the lParam. ...more >>

Marshalling an array of ints with arbitrary length from C# app
Posted by Dr. Len at 5/28/2004 7:11:05 PM
I have a DLL which exports two C functions. First one returns a pointer to an array of ints, and second one returns single value indicating length of the array, like so: extern "C" EXPORT int* GetPointArray(); extern "C" EXPORT int GetPointCount(); How would I go about marshalling the retu...more >>



who on earth has done a complete win32 api wrapper for C#?
Posted by ~dr-sci-fi at 5/28/2004 4:49:24 PM
looking for a comprehensive version of most common API functions used in ..Net, sample below: =============================================================== using System; using System.Runtime.InteropServices; namespace ApiWrapper { /// <summary> /// Summary description for Win32API. ...more >>

how to make IOleUndoManager known?
Posted by Martin at 5/28/2004 12:41:02 AM
hi, I need to use existing COM IOleUndoManager implementations, but I cant' seem to make this interface known to the .Net. The DLL it is defined in (oleaut32) I cannot add to the references. Does somebody know what I need to reference to get access to the definition Thanks a lot, Martin...more >>

VB6 bitmap handle to create .NET bitmap object
Posted by Jeff Beem at 5/27/2004 1:36:05 PM
We use vb6 but need to call a .NET dll for which I'm writing a COM callable wrapper (has custom constructors so I can't just export a type library) and we need to be able to send a bitmap handle to the wrapper from vb6 and create a bitmap object within the .NET wrapper and then send it to the dll. ...more >>

Dcom component and events
Posted by Enrique at 5/27/2004 10:56:11 AM
I have one DCOM component that is already working in a VB6 applications, and I have successfully imported it in a Visual Basic Net Application. Everything is working OK, except that my application does not receive the events the component fires. The wizard has include the correct code ( it know...more >>

C# | Shell Extension Handler (Icon Overlay Handler)
Posted by Jan Willem Zondag at 5/26/2004 11:16:46 PM
I am trying to implement an Icon Overlay Handler in C#. So far I have come up with the following code. After registering the dll with regasm I get icon overlays all over the place just as requested. The problem is that a different icon is displayed as overlay than the iconFile I pass in te Get...more >>

C#, COM Interop & Default parameters
Posted by CMan at 5/26/2004 1:12:51 PM
Hi All, I am trying to use a COM component that has methods with default parameters. How can I call these methods from C#. Not all default values are in the documentation of the control. Thanks Colin ...more >>

WHY! QueryInterface exception in asp.net
Posted by bgib at 5/26/2004 11:26:02 AM
I have a COM object that works great in a form or console app but blows when running in ASP.NET. I added a reference of the COM object in my project and included the dll in my bin folder and it still dumps Any help is greatly needed Here is the error QueryInterface for interface FORTHEFUNOFITL...more >>

Manually generating Interop assembly failing......
Posted by Ollie at 5/26/2004 10:56:08 AM
I am trying to generate a strong name assembly from the unmanaged DLL for the COM + 1.0 Admin Type Library located in the C:\WINDOWS\system32\Com\comadmin.dll, but when I run the following command it fails.... C:\work\BillAnalyser\Bin>tlbimp.exe comadmin.dll /delaysign /publickey:C:\work\key\...more >>

Active Directory Synchronization (DsReplicaSyncAll)
Posted by virusluca at 5/26/2004 6:46:02 AM
Hi I'm trying to use the Replicaytion Management Functions in order to force a domain controller synchronization. In my scenario I have more than one DC on which my application can create some users and groups and it need to wait for DC replication before it can proceed to use them in order to per...more >>

Creating an instance of Bloggs.Application given the CLSID?
Posted by Robin Tucker at 5/25/2004 4:27:01 PM
How can I create an instance of Bloggs.Application given the CLSID of the class? Dim iHaveTheClsID as Guid .... Dim theObject As Bloggs.Application = CreateObject(...........????........... ) Alternatively, how do I find the class string given the clsid? (ie "Bloggs.Application", from the...more >>

Error when calling msi native apis
Posted by Mike Faltys at 5/25/2004 4:16:04 PM
The code snippet below was simplified from a much larger application. I can run against several other functions in Msi.dll without problems. However, I am running into a problem when executing against the MsiGetSummaryInformation function. I get the exception "Object reference not set to an insta...more >>

Leak in COM object
Posted by psn.net at 5/25/2004 3:01:34 PM
Hi, I am calling a third party COM object from a .NET application where I am experiencing a memory leak. I tried the same set of calls to the COM object from a VB6 application but found no leaks. In the .NET application, I have the following set of operations: - Create an instance of the RCW -...more >>

ParameterModifier problems in InvokeMember
Posted by blefler NO[at]SPAM intelligentdesigngroup.com at 5/25/2004 2:34:00 PM
I'm having a time getting ref parameters to work from .net to a COM object. I can call the method fine without passing a ParameterModifier, but I get a TargetInvocationException with a CommException of 'Invalid callee' when I attempt to pass the ParameterModifier and set one of the params to ref...more >>

Two Excel Problems
Posted by MadIndian at 5/25/2004 11:49:36 AM
Hi, I am having two problems with excel first Excel.exe stays in memory until my app closes and it can end up with multiple instances in memory even after closing the excel book manually I need it visible so I can close it in the code but i do set it to nothing Also this previously wasnt an...more >>

Hosting .Net controls in Win32 application
Posted by Jan Hornych at 5/25/2004 11:13:42 AM
Hi, I have a classic Win32 application, which should stay developed for some more time, until a brand new product is finished. It would be nice to write new modules in .NET WinForms and dock them as child windows in the old Win32 Frame window. Is this thinkable ? The issues I see: 1. Child w...more >>

ComSourceInterfaces in C++ .NET
Posted by Daniel Wilson at 5/25/2004 11:12:12 AM
We are writing a C++ .NET server that needs to raise events to its VB6 client. We have found the MSDN article that explains raising these events in C# or VB.NET -- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm l/cpconraisingeventshandledbycomsink.asp How do we t...more >>

Inherit COM Interface
Posted by Gareth at 5/25/2004 9:16:14 AM
I've created a .Net dll which implements a windows COM Interface by using an autogenerated interop assembly. Does anyone know how I get it to register itself in the registry and indicate that it's inheriting from an existing com interface? The reason I need this is because the Microsoft Cert...more >>

Certificate Exit Module
Posted by Gareth at 5/24/2004 2:52:45 PM
I'm trying to write an exit module for the Microsoft Certificate Authority in C#. I've wrapped certxds.dll to an interop and implemented the CCertExit Interface Then registered the dll using the following regsvcs MyExitModule.dll regasm MyExitModule.dll gacutil /i MyExitModule.dll but ...more >>

C#/Excel interop - performance tips?
Posted by Xing at 5/24/2004 12:01:02 PM
I am writing a C# application which reads data from an Excel workbook and writes the process result back to another Excel workbook. Currently I am using a one-cell range object to locate one cell by row & col id for each read and write. (i.e. everytime, I use the range object to refer to one cell a...more >>

cast void* unmanaged pointer to Managed pointer
Posted by Sree at 5/24/2004 9:16:02 AM
I am trying to use native C++ call back function in my Mixed mode DLL. I need to cast void* to my managed class pointer... like... void MyManagedClass::HandleEvent(void* umP, MyEvent* pEvent MyManagedClass __gc * mP= (MyManagedClass *) umP mP->HandleEvent(pEvent) This code thr...more >>

ActiveX WindowsControl in MSAccess problem
Posted by Julian Hicks at 5/24/2004 4:26:08 AM
H I am developing a windows control in C# that is intended for use in Access XP clients, hence is registered for COM interop. The control seems to have registered OK, appears in the activex controls list within Access, can be added in design mode and then displays and acts OK in form view Howeve...more >>

How to convert from managed to unmanaged (and viceversa) byte arrays and strings???
Posted by Bob Rock at 5/24/2004 1:19:37 AM
Hello, converting from the managed to the unmanaged world (and viceversa strings) and byte arrays is something I do often and I'd like to identify the most correct and efficient way to do it. Also, I was wondering could there be issues in not making copies when converting??? I was thinking, w...more >>

how to get the source file reference data from the clipboard in .Net
Posted by TC at 5/23/2004 1:04:33 AM
Hello, I am familiar with obtaining source file reference material from the system clipboard using the old Win32 API. For example, copy an Excel chart onto the clipboard and goto Word. Under, Edit & PasteSpecial, there is a label called "Source:" which will contain the file path, etc. H...more >>

How to invoke a method using the thread which created the object
Posted by Henrik Dahl at 5/21/2004 1:53:55 PM
Hello! In my program I've made an STA thread which is running separately from the main thread. The STA thread is instantiating some COM objects. Is it possible, from the main thread, to invoke the COM object using the thread which instantiated it? This situation compares quite much to the Invo...more >>

Using legacy ocx with TreeView gives 'System.NullReferenceException error
Posted by scody NO[at]SPAM randmcnally.com at 5/21/2004 10:00:13 AM
We have a lot of legacy code in VB.OCX's and we are slowly migrating to C#. I am trying to use a control that contains a TreeView Contorl in it. I add it to a C# Form and call From.ShowDialog. I exit the form and everything looks great. On the second call to Form.ShowDialog I get a System.NullRe...more >>

Easy question
Posted by RichM at 5/21/2004 7:06:01 AM
In C#, how do I test if an unmanaged dll was properly loaded I need to call a function in uxtheme.dll, unless uxtheme.dll does not exist, in which case I don't need to call it Can I just use the DllImport Attribute and put the function call in a try block ...more >>

Using reflection to dynamically invoke a C function with a pointer parameter
Posted by Chuck Heatherly at 5/21/2004 5:13:13 AM
Hi, I have a program that is calling ODBC API functions using PInvoke. I'm having trouble with SQLAllocHandle. The third parameter is defined in C as SQLHANDLE *, where SQLHANDLE is (void *). I can call it successfully normally, by defining the PInvoke signature like this: [DllImport("odb...more >>

CDONTS
Posted by Tom Roach at 5/20/2004 6:49:27 PM
C# class library for use by VB6.0 application uses MailMessage object, runs OK on XP development desktop, but can't "create CDONTS.NewMail object" on the WinNT4.0 target. Can anyone explain how to teach the target to speak CDONTS? Thanks for your help! ...more >>

Interop
Posted by Nikhil Sarathi at 5/20/2004 12:36:06 PM
I have a C# component which in turn is called by a VB dll, this VB Dll is called by an ASP page. When I step through the code everything works fine, the asp page calls, the VB DLL, I got a Break point in my VB code & from VB I directly call the compiled C# dll, the results are what I expect but when...more >>

Need DISPID from CCW
Posted by Gavin Jacobs at 5/20/2004 11:53:50 AM
I am creating a COM component with C#. One of the requirements of one of the methods is to provide the DISPID of one of the public variables. As a temporary hack, I have been setting the class to: [ClassInterface(ClassInterfaceType.AutoDual)] and then looking in the TypeLib and hard coding the...more >>

COM object that has been separated from its underlying RCW can not be used
Posted by Neil Axe at 5/20/2004 11:28:39 AM
Hi all, I am attempting to navigate the shell namespace, and as such I want to store my IShellFolder COM object in a TreeView item for later retrieval when the user expands the node so that I can enumerate it's children. The problem is that when I go to reference this object again (when the ...more >>

empty strings, blanks strings, vb6 and .net
Posted by stewartmclean NO[at]SPAM supanet.com at 5/20/2004 3:28:02 AM
Hi all. I've written a .NET assembly which is registered for COM interop. A method on the DLL takes a string. The method looks something like this: public void TestFn(string str) { if (str == null) throw new ArgumentNullException("is null") if (str.Length == 0) throw new ArgumentExc...more >>

EnumDisplayDevices
Posted by AlexS at 5/20/2004 12:14:41 AM
Hi, I am having some issue with EnumDisplayDevices when called from C#. When I use CharSet.Ansi (note - no unicode) for DISPLAY_DEVICE structure, I get 0, DISPLAY1, raphics SuperSavage/IXC 1014, 1548305232, VEN_5333&DEV_8C2E&SUBSYS_01FC1014&REV_05, ISTRY\Machine\System\ControlSet001\Servic...more >>

Unmanaged C functions and C++ classes wrapped in an assembly not as public but as managed private methods: how???
Posted by Bob Rock at 5/19/2004 4:27:00 PM
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a managed point-of-view I've noticed that: 1) for each managed and unmanaged C function (not C++ clas...more >>

Test for Interface
Posted by Gavin Jacobs at 5/19/2004 1:57:05 PM
I am hoping to create a list of all COM components that support interface IUPnPDeviceControl. Is there a way to determine via the registry (or some other means) if a COM component supports a known interface? I know I could instantiate it and then query for the interface, but that would be very ti...more >>

Anyone Seen This...
Posted by pbwedz NO[at]SPAM hotmail.com at 5/19/2004 7:07:09 AM
I'm getting the following error: Unable to set the Orientation property of the PageSetup class Funny thing is that this runs fine on my test system, but failed on the production system. I'm looking for the differences between systems, but have not found it yet. Anyone seen anything like ...more >>

Passing string from C# to seperate C++ process using SendMessage
Posted by Mike at 5/18/2004 5:49:17 PM
I need to send a string between processes using a windows message and the SendMessage API call. The source process is written in managed C# and the destination process in unmanaged C++ (VC++ v.6). I have sorted everything apart from the marshalling of the string as the LPARAM. It seems that I ...more >>

Marshal.PtrToStructure for CMSG_SIGNER_INFO
Posted by David Merrill at 5/18/2004 5:16:08 PM
I am trying to get data from CryptMsgGetParam I have to call it twice, first to get the buffer size needed to hold the structure which I pass to Marshal.AllocCoTaskMem, then the real call giving it the buffer to fill in Both calls succeed and I have an IntPtr supposedly containing a CMSG_SIGNER_IN...more >>

Service using Interop wrapper fails..
Posted by SPG at 5/18/2004 1:21:42 PM
Hi, We have a C#.NET app that uses an ActiveX DLL to perform some TCP/IP actions against a quotes server. When we run this application as a stand alone EXE, all functions work fine, we can subscribe to the system, and receive updates from it (By way of callback events). As soon as we set t...more >>

EXE is both Windows and Console
Posted by Lee Gillie at 5/18/2004 10:13:08 AM
I'd like to make an EXE that behaves as a Windows Application if invoked with no command line parameters, and as a Console Application if there are arguments. If I say the project is a Console App, then a new console window is created, regardless, when starting. It is easy enough to get a win...more >>

Hosting .NET controls in MFC
Posted by Christopher Kimbell at 5/18/2004 1:06:05 AM
Hi Our codebase consists of MFC code, we are now trying to incorporate .NET code and controls We have so far taken the approach of creating wrapper classes round the existing code so we don't have to change it. We use the managed C++ extension and this seems to work well for non-UI code We are...more >>

Registering C# class as COM component
Posted by Gavin Jacobs at 5/17/2004 1:19:22 PM
I have read numerous help files which suggest I should use RegAsm to make a ..Net class accessible by COM clients. In VS.Net, on the Project Properties page, there is a setting for "Register for COM Interop". Are both required? or are they equivalent? Also, is there a way to use VS.Net to acc...more >>


DevelopmentNow Blog