Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » COM.CoCreateInstance(...) crashes
COM.CoCreateInstance(...) crashes [message #762185] Wed, 07 December 2011 17:03 Go to next message
Kyle Ouellette is currently offline Kyle OuelletteFriend
Messages: 3
Registered: August 2009
Junior Member
I'm trying to fix a VSS plugin for eclipse so that it runs on a 64-bit machine. I've traced an issue down to a failed call to COM.CoCreateInstance(...).

I can't find any documentation on this method.

Originally, the method was being passed the following arguments:
int[] ppv = new int[1];
COM.CoCreateInstance(guid, 0, COM.CLSCTX_INPROC_HANDLER | COM.CLSCTX_INPROC_SERVER,
                COM.IIDIDispatch, ppv);

Eclipse reported a compilation error: the last argument needed to be changed to long[], so I changed ppv's type.

The method call populates ppv with a 0 and result with a strange value like '-2147221164'. The call is supposed to return a 0 if successful.

Does anyone have some insight into this issue? Is there updated documentation for this class?
Re: COM.CoCreateInstance(...) crashes [message #762738 is a reply to message #762185] Thu, 08 December 2011 15:06 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
For info on CoCreateInstance() see
http://msdn.microsoft.com/en-us/library/windows/desktop/ms686615%28v=vs.85%29.aspx
..

Return code -2147221164 == 0x80040154 == REGDB_E_CLASSNOTREG. If your
plugin successfully makes this call on this same machine when running
eclipse/swt as a 32-bit app but is failing for you when running
eclipse/swt as a 64-bit app then my guess is that the COM component
you're trying to instantiate is only registered on your machine in a
32-bit .dll/.exe, but a 64-bit compilation of it is needed.

HTH,
Grant


On 12/7/2011 12:03 PM, Kyle Ouellette wrote:
> I'm trying to fix a VSS plugin for eclipse so that it runs on a 64-bit
> machine. I've traced an issue down to a failed call to
> COM.CoCreateInstance(...).
>
> I can't find any documentation on this method.
>
> Originally, the method was being passed the following arguments:
>
> int[] ppv = new int[1];
> COM.CoCreateInstance(guid, 0, COM.CLSCTX_INPROC_HANDLER |
> COM.CLSCTX_INPROC_SERVER,
> COM.IIDIDispatch, ppv);
>
> Eclipse reported a compilation error: the last argument needed to be
> changed to long[], so I changed ppv's type.
>
> The method call populates ppv with a 0 and result with a strange value
> like '-2147221164'. The call is supposed to return a 0 if successful.
>
> Does anyone have some insight into this issue? Is there updated
> documentation for this class?
Re: COM.CoCreateInstance(...) crashes [message #763345 is a reply to message #762185] Fri, 09 December 2011 15:51 Go to previous messageGo to next message
Kyle Ouellette is currently offline Kyle OuelletteFriend
Messages: 3
Registered: August 2009
Junior Member
Thanks for your reply Grant.

The call runs fine under 32-bit Eclipse

The DLL I'm trying to connect to is Microsoft Visual SourceSafe. I doubt I'd be able to get a 64-bit version of this DLL.

Are there any other options for getting this to run under 64-bit Eclipse?
Re: COM.CoCreateInstance(...) crashes [message #764647 is a reply to message #763345] Mon, 12 December 2011 15:31 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Googling found http://www.gfi.com/blog/32bit-object-64bit-environment/ ,
which has several follow-ups indicating that it works. I think the
underlying issue is summarized in one of its follow-ups: "...many of the
COM problems...turn out to actually be due to the way the COM object was
registered." His solution basically duplicates the registry's 32-bit
registration info for the COM object in the place where 64-bit COM
objects are looked up, which seems ok to me, at least from a technical
perspective.

Grant


On 12/9/2011 10:51 AM, Kyle Ouellette wrote:
> Thanks for your reply Grant.
>
> The call runs fine under 32-bit Eclipse
>
> The DLL I'm trying to connect to is Microsoft Visual SourceSafe. I doubt
> I'd be able to get a 64-bit version of this DLL.
>
> Are there any other options for getting this to run under 64-bit Eclipse?
Re: COM.CoCreateInstance(...) crashes [message #771955 is a reply to message #764647] Wed, 28 December 2011 16:31 Go to previous messageGo to next message
Kyle Ouellette is currently offline Kyle OuelletteFriend
Messages: 3
Registered: August 2009
Junior Member
Thanks for your reply, Grant.

Unfortunately for me and a few of the people that have replied to that blog posting, this registry hack doesn't do the trick.

Does anyone know of any tools/documentation I could use to get a better idea at how the GUID lookup is being done and exactly where it's failing?
Re: COM.CoCreateInstance(...) crashes [message #774277 is a reply to message #771955] Tue, 03 January 2012 16:17 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Process Monitor from MS (
http://technet.microsoft.com/en-us/sysinternals/bb896645 ) may be
helpful, as it logs all registry activity. I'm not sure if it would log
an attempt to open a non-existent registry key, but even if it doesn't,
it should provide some insight regarding what is happening under the
covers (eg.- you could compare the registry interactions in your 32-bit
working case with the 64-bit case).

Grant


On 12/28/2011 11:31 AM, Kyle Ouellette wrote:
> Thanks for your reply, Grant.
>
> Unfortunately for me and a few of the people that have replied to that
> blog posting, this registry hack doesn't do the trick.
>
> Does anyone know of any tools/documentation I could use to get a better
> idea at how the GUID lookup is being done and exactly where it's failing?
Previous Topic:StyledText variable line spacing
Next Topic:Where is Javadoc for SWT?
Goto Forum:
  


Current Time: Sat Apr 20 06:30:49 GMT 2024

Powered by FUDForum. Page generated in 0.03499 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top