473,320 Members | 2,107 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,320 software developers and data experts.

LoadTypeLib() not working for C# Class Lbrary

I have a C# class library (MyInterop.dll) with interface method for COM Interop. I have VC++ app which will load the C# library and invoke the methods at run time.
I know that if i use #import (MyInterop.dll) and then CreateInstance() to invoke the interface method it works. But my requirement is to load the dll at run time. hence i cannot use #import()
VC++ program will know only the dll name. Based on the DLL name i tried to use LoadTypeLib(), GetTypeAttr() to get the CLSID. And then based on the CLSID i want to create an IDispatch instance

CoLoadLibrary()
GetProcAddress()
ClassFactory()
CreateInstance(, IID_IDispatch, &m_dispatch)

The call to LoadTypeLib("MyInterop.dll") returns Error loading type library/DLL
But instead of .dll if i specify .tlb i.e, LoadTypeLib("MyInterop.tlb") then it works. But my requirement is to Load the library with DLL name.

Please help
Thank you
Feb 2 '08 #1
0 1157

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

Similar topics

1
by: RichGolebiowski | last post by:
I have a class library (clsTestLib) that was created in VB.Net that I would like to use in Access 2000. I created a typelib for the class using regasm.exe. I am able to refernce (add a reference)...
8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
1
by: Alan | last post by:
Hi all, I want to read all information from one type library in one COM, such as "VBScript.dll". I find that in the namespace "System.Enterprise.Internal", the Publish class has one method...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
8
by: shyamg | last post by:
plzzz help me............
2
by: kigoobe | last post by:
I am having a very weird issue here, a simple form submit not working. Trying for several hours now ... must be something stupid ... help appreciated. First, the html - <form id="formFinale"...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.