473,382 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Cant attach to dll error 126

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

Nov 20 '05 #1
1 1880
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.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: tabonni | last post by:
Hi I try to grab the checked files from HTML page and then send those PDF files as attachments. It can just send email, there are no PDF files attached. Can anybody point out my error? My...
7
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at...
1
by: SenthilVel | last post by:
Hi I have a question when debugging dotnet code when attaching vb6.exe code to this process. i get an error like : unable to attach the process. there is no managed code running in the...
6
by: a | last post by:
What is the best way to construct an email in python and also attach a html file the html file to be attached is not on disk, but should be dynamically constructed in the python script I want...
0
by: DR | last post by:
Unable to start TSQL Debugging. Could not attach to SQL Server Process on 'srvname'. The RPC server is unavailable. I get this error when I try to run a SQL Server Project with a CLR stored...
0
by: Lexxzy | last post by:
Hi to all, I've a problem about to attach a recovered database file in the enterprise manager. My problem goes this way, I want to attach a recovered database file. So when I followed this...
0
by: aboutjav.com | last post by:
Hi, How do I attach the .mdf and .ldf with the SQL Server Management Studio Express? Do I attached all 4 files? MyWebSiteName_log.LDF MyWebSiteName.mdf ASPNETDB.MDF aspnetdb_log.ldf
1
by: ziycon | last post by:
I'm getting this error when i try to attach a DB:
9
by: dpatel75 | last post by:
I am trying to copy a database from a SQL 2000 SP3 Windows 2000 server to a 2005 SP2 Windows 2003 server. I am trying to use detach and attach method (have tried both within Management Studio and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.