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 > recent posts

RE: Struct w/ VARIANT Marshalling
Posted by Michael at 4/25/2008 10:41:10 AM
I discovered one other significant weird thing. If I don't populate my VARIANT with the BSTR, I don't see the callback firing. mj From http://www.developmentnow.com/groups/viewthread.aspx?newsgroupid=21&threadid=1053880 Posted via DevelopmentNow.com Groups http://www.developmentnow.com...more >>

RE: Struct w/ VARIANT Marshalling
Posted by Michael at 4/25/2008 8:36:37 AM
Hi Willy, Question about your code snippet. You pass in the SpecialType into the C# callback and on the C# side, you do a GetObjectFromNativeVariant on the IntPtr that's passed into the callback. Is this correct? Don't you need to unpackage the SpecialType first before you do any GetObjectF...more >>

Re: Struct w/ VARIANT Marshalling
Posted by Willy Denoyette [MVP] at 4/24/2008 4:06:37 PM
"Michael" <michael.jaskiewicz@gdc4s.com> wrote in message news:5fab30dd-9a42-4d05-a85e-0cd556ae4f88@developmentnow.com... > Hi, I've been banging my head against this one and now I'm about to > scream. Any suggestions appreciated. I've scoured the net too and for some > reason all suggestions...more >>

Error HRESULT E_FAIL has been returned from a call to a COM compon
Posted by apalma at 4/24/2008 2:18:01 PM
Hi, I'm trying to use the AIM (aol IM) library to send messages to subscribers in my app. The problem is the following. I succeded sending messages from a desktop app. But when I tried to do exactly the same from a win service, I got the above exception. I think is a security issue. Any ...more >>

RE: Struct w/ VARIANT Marshalling
Posted by Michael at 4/24/2008 12:54:55 PM
Another little tidbit. If I replace the VARIANTs in the struct, everything marshals over just fine. mj From http://www.developmentnow.com/groups/viewthread.aspx?newsgroupid=21&threadid=1053880 Posted via DevelopmentNow.com Groups http://www.developmentnow.com...more >>

Class in mixed mode project inheriting from class in unmanaged project?
Posted by Chris Ashley at 4/24/2008 7:28:23 AM
I need to implement callbacks from methods in an unmanaged DLL to a mixed mode DLL. I'm having trouble finding examples on how to do this and all the examples I find seem to revolve around interactions between managed/unmanaged classes in a single mixed mode DLL. Is it possible for me to defin...more >>

RE: Struct w/ VARIANT Marshalling
Posted by Michael at 4/24/2008 5:42:11 AM
A little bit more on this one. I'm looking at the address of the SpecialStruct in C++ and in C# and the addresses are identical. At least the pointers are making it across okay. For some reason the marshalling from Ptr to Structure is bombing out. From http://www.developmentnow.com/groups/viewthre...more >>

In 64-bit Windows Vista, the class object registered by a 64-bit L
Posted by PAsp at 4/24/2008 4:25:00 AM
We have a .Net application that registers as a LocalServer32 in the registry during installation. That is, it sets the registry entries HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{our CLSID} \LocalServer32 = {full path to our exe} \ProdId = {our prog id} When the application start...more >>



Re: Struct w/ VARIANT Marshalling
Posted by Willy Denoyette [MVP] at 4/24/2008 12:00:00 AM
"Michael" <michael.jaskiewicz@gdc4s.com> wrote in message news:1005055f-8af3-4a16-98d2-89c4baaa8b0d@developmentnow.com... > Another little tidbit. If I replace the VARIANTs in the struct, everything > marshals over just fine. > mj > > From > http://www.developmentnow.com/groups/viewthrea...more >>

Struct w/ VARIANT Marshalling
Posted by Michael at 4/23/2008 6:53:03 PM
Hi, I've been banging my head against this one and now I'm about to scream. Any suggestions appreciated. I've scoured the net too and for some reason all suggestions don't work. I've got a C++ app that takes a function pointer from a C# application (it's for a callback). The callback signature lo...more >>

Re: Problem with COM interface using IntPtr...
Posted by Willy Denoyette [MVP] at 4/23/2008 1:49:44 AM
By marking an interface or method as 'local', you are explicitly stating that this as a non remote-able interface or method, that means that the interface or method cannot cross thread/apartment boundaries. So, what you need, is to make sure that your component lives in the same apartment as ...more >>

Re: Problem with COM interface using IntPtr...
Posted by theunissen@comcast.net at 4/22/2008 4:15:11 PM
I figured it all out. Please read: In order to have an interface display "as IntPtr" inside Visual Basic one should define the parameter as HANDLE or void* inside the IDL file. We already seen this. In addition, to avoid the IDL compiler warning one should use "Local". Now there is a proble...more >>

Problem with COM interface using IntPtr...
Posted by theunissen@comcast.net at 4/22/2008 9:51:53 AM
Hi, This message is related to a problem I posted a few days ago: http://groups.google.com/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/4d243fe978432c06/37881b961489f153?hl=en&lnk=st&q=Visual+Basic+X64+COM+parameter#37881b961489f153 I had a problem where INT"_PTR" in...more >>

Re: COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by theunissen@comcast.net at 4/22/2008 8:54:42 AM
Hi, This message is related to a post I did a few days ago. I had a problem where INT"_PTR" in a com interface didn't show up as "IntPtr" inside Visual Basic. This problem was resolved by using a "HANDLE" or "void*" inside the interface definition in the IDL file. To use the "HANDLE" definit...more >>

AccessViolationException when sinking managed event in unmanaged C
Posted by UrK at 4/21/2008 6:04:02 AM
I am trying to sink event thrown by managed code in C++. When the event is thrown the control never reaches unmanaged client. AccessViolationException is raised in managed code at System.RuntimeType.ForwardCallToInvokeMember. I am fighting this issue for a long time now with no effect at all o...more >>

Re: executionEngineException
Posted by Willy Denoyette [MVP] at 4/20/2008 7:40:25 PM
"JB" <JB@discussions.microsoft.com> wrote in message news:6FB73C54-66E7-4C34-85B7-4946D6CCC44D@microsoft.com... > Stand down > > I changed the registration of the .ocx from > Threadingmodel = Apartment > to > Threadingmodel = Both > and that fixed the problem > -- > JB > No, this is ...more >>

RE: executionEngineException
Posted by JB at 4/20/2008 9:58:00 AM
Stand down I changed the registration of the .ocx from Threadingmodel = Apartment to Threadingmodel = Both and that fixed the problem -- JB "JB" wrote: > Vb.net app with COM control. The COM control is an object framer used by > the vb.net app to treat other apps( eg. word)...more >>

executionEngineException
Posted by JB at 4/20/2008 9:20:01 AM
Vb.net app with COM control. The COM control is an object framer used by the vb.net app to treat other apps( eg. word) as embedded objects. Generally this all works fine. One of the functions of this COM control is to search embedded app data for text ( 'Find' this or that.) This also wo...more >>

Re: Can not load 'ssleay32.dll' using DLLImport
Posted by deepaknawathe at 4/19/2008 11:11:01 PM
The issue was due to the exptecte version of 'ssleay32.dll'. I downloaded the latest version of 'ssleay32.dll' which was for Windows Vista and not for WinXP. The issue is resolved now. The dll is loaded properly. "Adam Root" wrote: > Willy's right, from a security stand point. > > But...more >>

RE: How to register an app to the scanner events using VB.NET or C
Posted by BuzzLightyear at 4/19/2008 8:02:01 AM
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; namespace STILLIMAGE { class program { [DllImport("kernel32.dll")] static extern IntPtr GetModuleHandle( [MarshalAs(UnmanagedType.L...more >>

Re: COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by Jeroen Mostert at 4/19/2008 1:30:26 AM
theunissen@comcast.net wrote: > It seems HANDLE is not supported in IDL. > > The IDL compiler complains and says: > > error MIDL2139 : type of the parameter cannot derive from void or void > * : [ Type 'HANDLE' ( Parameter 'nBinArrayAddress' ) ] > > Not sure what to do. Oops, sorry abo...more >>

Re: COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by Jeroen Mostert at 4/19/2008 12:13:27 AM
theunissen@comcast.net wrote: > I have a small problem. I have defined some interfaces in a COM dll, > and have defined some parameters in these interfaces as INT_PTR. I > thought that when I import the COM dll in Visual Basic.NET that I can > use IntPtr as the type for these parameters, but the...more >>

Re: COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by theunissen@comcast.net at 4/18/2008 4:43:57 PM
On Apr 18, 4:30=A0pm, Jeroen Mostert <jmost...@xs4all.nl> wrote: > theunis...@comcast.net wrote: > > It seems HANDLE is not supported in IDL. > > > The IDL compiler complains and says: > > > error MIDL2139 : type of the parameter cannot derive from void or void > > * : [ Type 'HANDLE' ( Param...more >>

Re: COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by theunissen@comcast.net at 4/18/2008 4:21:03 PM
On Apr 18, 3:26=A0pm, theunis...@comcast.net wrote: > On Apr 18, 3:13=A0pm, Jeroen Mostert <jmost...@xs4all.nl> wrote: > > > > > > > theunis...@comcast.net wrote: > > > I have a small problem. I have defined some interfaces in a COM dll, > > > and have defined some parameters in these inter...more >>

Re: COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by theunissen@comcast.net at 4/18/2008 3:26:00 PM
On Apr 18, 3:13=A0pm, Jeroen Mostert <jmost...@xs4all.nl> wrote: > theunis...@comcast.net wrote: > > I have a small problem. I have defined some interfaces in a COM dll, > > and have defined some parameters in these interfaces as INT_PTR. I > > thought that when I import the COM dll in Visual Ba...more >>

COM interface requires Integer in VB, even though INT_PTR is defined in COM interface
Posted by theunissen@comcast.net at 4/18/2008 2:22:26 PM
Hi, I have a small problem. I have defined some interfaces in a COM dll, and have defined some parameters in these interfaces as INT_PTR. I thought that when I import the COM dll in Visual Basic.NET that I can use IntPtr as the type for these parameters, but the intellisense shows me that t...more >>

RE: How to register an app to the scanner events using VB.NET or C
Posted by Adam Root at 4/18/2008 1:59:08 PM
Nah, I'm running Vista, too. Send me your code. Adam "BuzzLightyear" wrote: > I tried any possible path with quotes, without, with the final backslash, > with the initial one, but nothing seems to work... > I had a look at the registry, under StillImage\Registered Applications > The ...more >>

RE: How to register an app to the scanner events using VB.NET or C
Posted by BuzzLightyear at 4/18/2008 3:52:01 AM
I tried any possible path with quotes, without, with the final backslash, with the initial one, but nothing seems to work... I had a look at the registry, under StillImage\Registered Applications The other apps have standard paths... I even tried adding the entry manually, but it doesn't work....more >>

RE: Passing bitmap back to COM based application
Posted by Adam Root at 4/17/2008 4:42:01 PM
Your C++ code is passing a by ref argument (&HBitmap) and your C# code is passed a by value argument. I see you found that changing your IDL to pass by ref helps. You should consider that an HBITMAP is a pointer to a struct that contains only an unused field. Hence, an HBITMAP is actually j...more >>

RE: How to register an app to the scanner events using VB.NET or C
Posted by Adam Root at 4/17/2008 4:26:00 PM
I think I had to make sure to pass a valid *full* path to my exe and wrap it in single quotes (in the string, not in the code... that is "\"drive:\path\to\myexe.exe\"") Something like that. Adam "BuzzLightyear" wrote: > which typo exactly? I tried some different command line strings ...more >>


DevelopmentNow Blog