Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Entry Point for DLLs in VB 2

Status
Not open for further replies.

CubeE101

Programmer
Nov 19, 2002
1,492
US
When you create a DLL in VB, how do you set an entry point...

I tried to create an Active X DLL...
Put the code in the module...
Compiled it...

Then I tried to reference it in my program like:

Private Delcare MyFunction Lib "C:\Path\MyDll.DLL" (param as integer, ...)

And it gave me an error: "Could Not Find Entry Point In DLL"

I have never created a DLL in VB before...

Am I going about this the wrong way, or do you HAVE TO use them as Objects...

I just want to call a few functions from the DLL...

Any Ideas???

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Did you register it on your system? ActiveX DLLs created in VB usually need to be registered, using regsvr32.

And, usually, in VB you want to use either the Object type (if you're late-binding) or whatever custom types are defined in your DLL (if you're early-binding). I'm not sure if you can use a VB ActiveX DLL the way you're trying - I've never seen it done before, so I couldn't tell you either way.

HTH,
jp
 
I am trying to use it like you use the GDI32.DLL and USER32.DLL

Yes, I know they are written in VC++, but I was hoping that all DLLs were created in the same way...

I was under the impression that you only had to register it with regsvr32 if you were going to use it as an object (late binding)... I might try it, but...
Is there an easy way to UNRegister it if you want to delete or change it?

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
In following the Microsoft tutorial for creating DLL's, I created a project group, which included my DLL project and my application project (which would use the DLL). In the project group, I selected,compliled and ran the DLL, then selected the application. Once the application was selected, I went to "References" and checked the checkbox for the DLL (compiling and running the DLL added it to the list of available references). It ran fine without registering the DLL, and also allowed for debugging the DLL at the same time and allowing for recompiles. Hope this helps.
 
Yep - you use the same utility (regsvr32), with the "/u" (or "-u" from a command line) switch in front of the DLL path . Ex:

regsvr32 /u "C:\WINNT\msxml4.dll"

I don't know enough about how DLLs are constructed or any potential differences in the compiles of DLLs between VC++ and VB, so I can't really comment on that.

HTH,
jp
 
You cannot create the type of DLL that you want with VB, Josh. You can only create COM DLLs. In other words: yes, you have to treat them as object libraries.
 
strongm,
could you please give some advice (links etc) how to create "that type of DLL" in C?
I want to use my C code from VB.
 
CubeE101,
big thanks.
I should give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top