PC Review


Reply
Thread Tools Rate Thread

Cant attach to dll error 126

 
 
bclegg
Guest
Posts: n/a
 
      29th Feb 2004
Hi,
This is a bit like a house of cards.
At the bottom is a 3rd Party dll which uses pointers to access its
functions.

The next layer up is a C++ dll wrapper that exposes a series of
functions that can be called in the dotnet Framework.

Wrapping this is my component written in vb.net.

In my test application if I create an instance of my component on the
main thread it works.
If I create a thread and attempt to instantiate and use the component on
the thread it fails with the above error message.
The dll that the error message points to is the third party one at the
bottom.

I think I must be making a general design error in my component.
How it hangs together is.
a) A module which declares all the library calls into the C++ Dll
b) A class with public functions that make the appropriate calls into
C++ Dll and return the appropriate values.


Is this an acceptable way of designing the component?
Any suggestions as to how to get fix this would be appreciated.
Thanks
Bob

 
Reply With Quote
 
 
 
 
Peter Huang
Guest
Posts: n/a
 
      1st Mar 2004
Hi Bob,

Thanks for posting in the community.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you have a C++ wrap for a
third-party dll, and you wants to P/Invoke the C++ wrap dll from DLL in
VB.NET, when called the dll in the MainThread it works, while it will get
error 126 when called in a working thread.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

Is the VB.NET application a winform application?

Did the third-party dll have any requirements? e.g. if it needs a GUI
thread, a message queue and etc.
If so, it maynot work properly in the working thread.

What is it used for?

From your description, I think the design has no problem.
Please apply my suggestion above and let me know if it helps resolve your
problem.

Also, did you any cross-thread operation?e.g. you create an object in the
third-party dll from the Mainthread in the VB.NET and access it from the
working thread or vice versa.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Attach to ACT! contact(s)' error msg to run ACT at least once... =?Utf-8?B?U3V6YQ==?= Microsoft Outlook Discussion 1 15th Aug 2006 07:02 PM
Outlok Error when trying to attach .jpg Hex Microsoft Outlook 0 28th Jul 2005 03:20 PM
Is it OK to attach scripts to reply posts. I want to attach a handy script. Stephen Windows XP General 59 8th Jun 2005 01:35 AM
How come when I attach files I get error? =?Utf-8?B?cGF1bHp4N3I=?= Microsoft Outlook Discussion 3 8th Feb 2005 03:39 PM
Is there a way to directly attach emails or email attach to access d Microsoft Access 1 6th Jul 2004 02:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:36 PM.