|
-
Nov 10th, 2009, 04:28 AM
#1
Thread Starter
New Member
Calling a C# dll with vb6
Hi all!
I'm really new to vb6 and have some knowledge of C# and would like to create a vb6 program that calls a C# dll but I've found a huge problem which is, I always get a "dll runtime error 453".
I've been googling for some hours and can't find the solution for this problem...
please help.
thanks a lot
B33bs
(here's the code sample... it's just an example)
Private Declare Function func Lib "C:\Documents and Settings\...\dllnewAtt.dll" () As String
Private Sub Command1_Click()
Dim nSpeed As String
nSpeed = func()
Form1.Text1.Text = nSpeed
End Sub
Last edited by b33bs; Nov 10th, 2009 at 05:30 AM.
-
Nov 10th, 2009, 03:03 PM
#2
Re: Calling a C# dll with vb6
Just out of curiosity, why are you moving back from .NET to VB6?
My usual boring signature: Nothing
 
-
Nov 10th, 2009, 04:23 PM
#3
Thread Starter
New Member
Re: Calling a C# dll with vb6
the company where I'm working at, asked me to customize some software that is written in VB6... they'r trying to update everything to C#.Net but they asked me to change a program and I have 1week to make that change... so as I don't have time to re-program 10thousand lines of vb6 code to C# in a week's time, I decided to call newly created C# functions inside the VB6 code.
Anyway, I solved my problems today too, so all is good!
bye!
-
Nov 10th, 2009, 04:55 PM
#4
Re: Calling a C# dll with vb6
Perhaps posting up your solution so others that search can benifit from it.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 11th, 2009, 04:52 AM
#5
Thread Starter
New Member
Re: Calling a C# dll with vb6
yes... good Idea... It's not that simple, but if you follow the steps that are shown in the following link, then you will be able to call a C# dll in a vb6 program successfully
http://msdn.microsoft.com/hi-in/libr...02(en-us).aspx
Private Declare Function func Lib "C:\Documents and Settings\...\DllSuccess.dll" () As String
Private Sub Command1_Click()
Set aux_obj = CreateObject("DllSuccess.Class1")
x = aux_obj.returnstring()
Form1.Text1.Text = x
End Sub
this worked!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|