Oh gurus, please help getting VC program into DLL 
Author Message
 Oh gurus, please help getting VC program into DLL

I am hoping that some of you have taken a Visual C program and compiled
it in such a way as to turn it into a DLL that can be called from Visual
Basic.

What are the steps to do this?

Is it in the MSDN documentation anywhere?

thanks-Peter Brooker



Mon, 15 Sep 2003 02:45:08 GMT  
 Oh gurus, please help getting VC program into DLL
I would recommend that you create a New Dll project first then add your code
to it...
1.  Select File, New Project from main menu
2.  Select either Win32 DLL or MFC AppWizard DLL
3.  Once your new blank project is created, add your source code files to
it...
A DLL is more like a library, than a program.  It is like you calling a
function and then having a value returned.  If you need it to have a
separate process, you can use a CreateThread to simulate this.
4.  Place all function calls which will be visible to VB into the *.Def file
created by VC for the Dll project.
5.  Once this is compiled, determine the Declare statements needed to call
the Dll from within VB.  The important part is that all parameters match for
size.  Make sure that VC int = VB Long is used... because many think that
you would use a VB Integer which is not the same size.  Signed and Unsigned
can be mixed, however Byte size must match.
6.  A VC void function would be a VB sub, and VC int function would equate
to a VB Function.
7.  If possible avoid more than One Dimensional array passing, because VB
and VC use differing Row and Col.  Also if you are passing Strings read up
on how to do this in MSDN, the VB String is passed ByVal.


Quote:
> I am hoping that some of you have taken a Visual C program and compiled
> it in such a way as to turn it into a DLL that can be called from Visual
> Basic.

> What are the steps to do this?

> Is it in the MSDN documentation anywhere?

> thanks-Peter Brooker



Mon, 15 Sep 2003 09:36:51 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help: Guru needed please please please

2. Getting 16bit VB4.0 programs to interface with 32bit VC++5.0 DLLs

3. Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!Please help!!!!

4. RegExp guru's - help me please!

5. PLEASE HELP-I NEED LINKED LIST GURUS!

6. Watcom C/C++ Gurus: Please Help.

7. ANSI interpretation question, gurus please help

8. Palette gurus, please help!!!

9. Function pointer gurus - please help

10. Complex TREEVIEW Design Issues, Need GURU Help Please

11. Complex TREEVIEW Design Issues, Need GURU Help Please

 

 
Powered by phpBB® Forum Software