TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Viken Patel
NA
72
4.1k
Use VB6 dll in c#
Dec 27 2019 6:30 AM
I have created VB6 Project of ActiveX dll type added two function
Public
Function
Name(aName
As
String
)
MsgBox (
"Your Name is "
& aName)
End
Function
Public
Function
TestName(aName
As
String
)
As
String
TestName =
" Hello "
& aName
End
Function
Created DLL from same Project.
Then created Wrapper using below command .
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools>TlbImp.exe C:\Test\TestActiveX\Project1.dll /out: C:\Test\TestActiveX\out\Project1.dll
If i am performing only above operation then i am not getting Project1.dll under COM section but then i am registering dll using below code
C:\WINDOWS\system32>regsvr32 C:\Test\TestActiveX\Project1.dll
then only i am getting dll under COM section inside VisuaL studio Add Reference Dialog
i tried adding reference from C:\Test\TestActiveX\out\Project1.dll folder also but every time i am getting runtime error as below.
System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {ID} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'
public
string
ReturnFromCOM()
{
TestClass testClass =
new
TestClass();
return
testClass.TestName(
" Hello "
);
}
i am not able to get it done, don't know what is missing in this steps. My Windows OS : 64 bit Windows 10 Framework 4.6.1 as well as 4.8.1 but created console application with Framework 4.6.1
i tried even changing project target to x64/x86/anyCPU but it's not working at all.
Reply
Answers (
2
)
Attempting to access a 32 bit sdk through com on 64 bit
COM component monitoring