By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,983 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,983 IT Pros & Developers. It's quick & easy.

VB error handling via C++ DLL

P: 1
I have a C++ DLL that I currently use in a VB project by using DECLARE statements. This works but in order to throw an error from C++ that VB can catch, I understand my C++ functions need to return HRESULTS. I believe this can only be done with a type library.

When I try to compile a type library for my DLL and try to add it as a resource in my VB project, I get the following error:
"A reference to 'C:\.......\TLBsamp.tlb' could not be added. Please
make sure the file is accessible and that it is a valid assembly or
COM component"

I used this web page as reference:
“How To Raise an Error in Visual Basic From Your C DLL”
http://support.microsoft.com/default.aspx?scid=kb;en-us;189134

I'm using Visual Studio 2005 Professional Edition. Please correct me if any of my assumptions are wrong.

Thanks for any help!
Apr 11 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.