Hey guys,

Bear with me if this is not the correct group where to send this question. 
I'm just hoping with the ammount of activity this group has I'd be at least 
be redirected to the correct place, if this is not.

I'm writing an Excel add-in (in good old C, using COM), and I always find 
that a `THREAD_ATTACH' event in my DllMain always causes Excel to crash.

I'm pretty sure my code is not offending Excel at all and the reason must 
be other, probably unknown trick of the trade, or something that I'm doing 
worng othewise. This a log of my add-in's activity as Excel calls it:

DllMain: PROCESS_ATTACH (handle = 0xb8540000)
DllGetClassObject: Requesting:
   class: {8E2406A6-392C-4C63-964E-C1D2C4B55611}
    guid: {00000001-0000-0000-C000-000000000046} (IUnknown)
class_add_ref: Called. Returning 1
DllGetClassObject: about to return S_OK
class_create_instance: Requesting: {B65AD801-ABAF-11D0-BB8B-00A0C90F2744}
class_create_instance: About to return `IDTExtensibility2' @ 0xb63653e0
add_ref: Called for 0xb63653e0. Returning 1
add_ref: Called for 0xb63653e0. Returning 2
release: Called for 0xb63653e0. Returning 1
class_release: Called. Returning 0
query_interface: Requesting: {B65AD801-ABAF-11D0-BB8B-00A0C90F2744} 
(0xb63653e0)
add_ref: Called for 0xb63653e0. Returning 2
class_create_instance: About to return (existing) `IDTExtensibility2' @ 
0xb63653e0
release: Called for 0xb63653e0. Returning 1
query_interface: Requesting: {E19C7100-9709-4DB7-9373-E7B518B47086} 
(0xb63653e0)
query_interface: About to return E_NOINTERFACE
on_connection: Called. Returning S_OK
on_addins_update: Called. Returning S_OK
query_interface: Requesting: {000C033E-0000-0000-C000-000000000046} 
(0xb63653e0)
query_interface: About to return `ICustomTaskPaneConsumer' @0xae54ee00
add_ref: Called for 0xae54ee00. Returning 1
ctp_available: Called. Returning S_OK
release: Called for 0xae54ee00. Freeing it and returning 0
query_interface: Requesting: {000C0396-0000-0000-C000-000000000046} 
(0xb63653e0)
query_interface: About to return `IRibbonExtensibility' @ 0xae54ef10
add_ref: Called for 0xae54ef10. Returning 1
add_ref: Called for 0xae54ef10. Returning 2
add_ref: Called for 0xae54ef10. Returning 3
query_interface: Requesting: {00020400-0000-0000-C000-000000000046} 
(0xae54ef10)
query_interface: About to return `IDispatch' @ 0xae54ef60
add_ref: Called for 0xae54ef60. Returning 1
release: Called for 0xae54ef10. Returning 2
release: Called for 0xae54ef10. Returning 1
add_ref: Called for 0xae54ef10. Returning 2
add_ref: Called for 0xae54ef60. Returning 2
get_custom_ui: Returning S_OK
release: Called for 0x3ed456e0. Returning 1
release: Called for 0x3ed45890. Returning 1
on_startup_complete: Called. Returning S_OK
DllMain: THREAD_ATTACH (handle = 0xb8540000)

After this THREAD_ATTACH event, which sometimes kics in sooner, sometimes 
later, Excel simply crashes, but always internally way after this log has 
been written to disk.

I've tried debugging with WinDBG and I can never see any of my add-in 
functions' within the backtrace of any of the threads, as well as none of 
the objetcs I've alloc'ed within their arguments. I'm never feeding garbabe 
back (for example in GetCustomUI I zero out the returning pointer before 
returning S_OK) so at this point my add-in is just a dumb one, not doing 
much, but not breaking anything either (that I know).

What could be the problem? I'd really appreciate any hints or pointers, as 
well as being redirected to the correct place if this is not as I said.

Thanks,

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/excel-macros/6dcf9cf4-01a4-435f-aa32-ae0b9130eeea%40googlegroups.com.

Reply via email to