Dynamic Link Libraries 
Author Message
 Dynamic Link Libraries

Does anyone know of any very simple code that could be used for me to learn
how to create a dll in c to be called from Visual Basic?  The simpler the
code is the better it would be.  I don't need it to even do much but supply
me with an example of how it would have to work.

                                    Thank you,

                                        Michael Alan Painter Jr.



Sun, 12 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries



Quote:
>Does anyone know of any very simple code that could be used for me to learn
>how to create a dll in c to be called from Visual Basic?  The simpler the
>code is the better it would be.  I don't need it to even do much but supply
>me with an example of how it would have to work.

C has no support for DLLs, they are a Windows thing. Try asking in a Windows
related newsgroup such as comp.os.ms-windows.programmer.misc.

--
-----------------------------------------


-----------------------------------------



Sun, 12 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries


Quote:

> Does anyone know of any very simple code that could be used for me to learn
> how to create a dll in c to be called from Visual Basic?

Hi Michael Alan Painter Jr.,

You obviously misjudge the scope of comp.lang.c, as this is your second
posting asking about features that are not supported by the standard C
language. In this particular case I'd recommend asking in a Windows
oriented newsgroup. There are lots of those, but here are two typical
ones to begin with:


Stephan
(initiator of the campaign against grumpiness in c.l.c)



Sun, 12 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries


Quote:

> Does anyone know of any very simple code that could be used for me to learn
> how to create a dll in c to be called from Visual Basic?  The simpler the
> code is the better it would be.  I don't need it to even do much but supply
> me with an example of how it would have to work.

>                                     Thank you,

>                                         Michael Alan Painter Jr.

Here's it:

#include <vcl\vcl.h>      // I hope u use BCB

extern "C" __declspec(dllexport) double YerFunc(double);

DllEntryPoint()
{
 ...

Quote:
}

double _export __stdcall YerFunc(double d)
{
 return d;

Quote:
}

Then call YerFunc() from VB.

--
Sanya Lazarev,                          
VIRUS TECHNOLOGIES, INC.                    ___<>___<>___<>___


http://www.glasnet.ru/~sanya/     ```````````````````````````````````

                       vvvvvvv      TTT      vvvvvvv
                           vv       TTT       vv
                            vv     TTTTT     vv
                         TTTTTTTTTTTTTTTTTTTTTTTTT
                         TT   vv   TTT T   vv   TT
                         TT    vv  TTT T  vv    TT
                                vv TTT T vv
                                 vv TT  vv
                                  vv T vv
                                   vv vv
                                    vvv
                                   T v T
                                    TTT
                                     T



Thu, 16 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries


Quote:

> Does anyone know of any very simple code that could be used for me to learn
> how to create a dll in c to be called from Visual Basic?  The simpler the
> code is the better it would be.  I don't need it to even do much but supply
> me with an example of how it would have to work.

>                                     Thank you,

>                                         Michael Alan Painter Jr.

Here's it:

#include <vcl\vcl.h>      // I hope u use BCB

extern "C" __declspec(dllexport) double YerFunc(double);

DllEntryPoint()
{
 ...

Quote:
}

double _export __stdcall YerFunc(double d)
{
 return d;

Quote:
}

Then call YerFunc() from VB.

--
Sanya Lazarev,                          
VIRUS TECHNOLOGIES, INC.                    ___<>___<>___<>___


http://www.glasnet.ru/~sanya/     ```````````````````````````````````

                       vvvvvvv      TTT      vvvvvvv
                           vv       TTT       vv
                            vv     TTTTT     vv
                         TTTTTTTTTTTTTTTTTTTTTTTTT
                         TT   vv   TTT T   vv   TT
                         TT    vv  TTT T  vv    TT
                                vv TTT T vv
                                 vv TT  vv
                                  vv T vv
                                   vv vv
                                    vvv
                                   T v T
                                    TTT
                                     T

[ Hookdll.cpp 1K ]
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
//   Important note about DLL memory management:
//
//   If your DLL exports any functions that pass String objects (or structs/
//   classes containing nested Strings) as parameter or function results,
//   you will need to add the library BCBMM.LIB to both the DLL project and any
//   EXE projects that use the DLL.  This will change the DLL and its calling
//   EXE's to use the BCBMM.DLL as their memory manager.  In these cases,
//   the file BCBMM.DLL should be deployed along with your DLL.
//
//   To avoid using BCBMM.DLL, pass string information using "char *" or
//   ShortString parameters.
//---------------------------------------------------------------------------
USERES("Hookdll.res");
//---------------------------------------------------------------------------
extern "C" __declspec(dllexport) double dblValue(double);

double dblValue(double value)
{
        return value * value;

Quote:
};

//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
        return 1;
Quote:
}

//---------------------------------------------------------------------------


Thu, 16 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries

Quote:


> > Does anyone know of any very simple code that could be used for me to learn
> > how to create a dll in c to be called from Visual Basic?

> Hi Michael Alan Painter Jr.,

> You obviously misjudge the scope of comp.lang.c, as this is your second
> posting asking about features that are not supported by the standard C
> language. In this particular case I'd recommend asking in a Windows
> oriented newsgroup. There are lots of those, but here are two typical
> ones to begin with:


> Stephan
> (initiator of the campaign against grumpiness in c.l.c)

Hey, you could just delete ziz article!
--
Sanya Lazarev,                          
VIRUS TECHNOLOGIES, INC.                    ___<>___<>___<>___


http://www.glasnet.ru/~sanya/     ```````````````````````````````````

                       vvvvvvv      TTT      vvvvvvv
                           vv       TTT       vv
                            vv     TTTTT     vv
                         TTTTTTTTTTTTTTTTTTTTTTTTT
                         TT   vv   TTT T   vv   TT
                         TT    vv  TTT T  vv    TT
                                vv TTT T vv
                                 vv TT  vv
                                  vv T vv
                                   vv vv
                                    vvv
                                   T v T
                                    TTT
                                     T



Thu, 16 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries

Quote:

> #include <vcl\vcl.h> // I hope u use BCB

You have a header file whose filename includes a vertical tab?

Quote:
> extern "C" __declspec(dllexport) double YerFunc(double);

'__declspec()'? 'dllexport'? 'extern "C"'? What language -are- you programming
in, anyway? I haven't a clue, but it sure as shootin' ain't C.

Please keep this platform-specific trash off comp.lang.c. And, yes, that
includes your idiotic ideas about exporting $MID to C with DLLs, and, yes,
that includes your adverti{*filter*}t for 'alt.binaries.cracks.'

Thanks for keeping September alive and kicking, Sanya.

--
(initiator of the campaign for grumpiness where grumpiness is due in c.l.c)




Thu, 16 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries

Quote:


> > [a non-grumpy reply to an article where grumpiness was due]

> Hey, you could just delete ziz article!

The following BHRF is in regards to the collected postings of the quoted idiot.

                      STANDARDIZED BONEHEAD REPLY FORM
                           comp.lang.c version
                        (original by David Parsons)
              (modified by David Fetter and Kurt Schumacher)
                    (comp.lang.c bits by Alan Curry)


 Dear:
  _X_ Klewless Wonder           _X_ Lamer            ___ Spammer
  _X_ Password cracker wannabe  ___ Terminal junkie  ___ BorlandBoy
  ___ Netcruiser idiot          _X_ Dumbass          _X_ Moron
  _X_ Warez kiddie              _X_ Loser            _X_ Newbie
  ___ Homework cheater          ___ Microserf

I took exception to your recent  _X_ posts to _comp.lang.c_________.
                                                  (newsgroup)
                                 ___ email

They were (check all that apply):

_X_ Stupid.
_X_ Boring.
_X_ Much longer than any worthwhile thought of which you may be capable.

You are being flamed because:

_X_ What you posted/said has been done before.
    (Mark only if above checked)
    _X_ Not only that, it was also done better the last time.
___ Your post/letter was a pathetic imitation of   ____________________.
                                                     (net.personality)
___ Your post/mail originated on ___ FidoNet
                                 ___ Delphi
                                 ___ AOL
                                 ___ Compuserve
                                 ___ Prodigy
                                 ___ MSN
___ You posted using Netscape.
    (Mark only if above checked)
     ___ And it turned your post into a mini-spam of ___ identical posts.
     ___ And it failed to insert a newline between the quoted text and
         your original text.
___ Your post was in HTML.
    ___ Which was appended to the ASCII version.
___ Your post/mail originated from the anon service.
    (Mark only if above checked)
     ___ You felt this gave you a license to be a 'tard.
         (Mark only if above checked)

              the anon disclaimer under "inappropriate use".
_X_ You posted without reading the FAQ.
    (Mark only if above checked)
     ___ You asked a question listed in the FAQ's index.
         (Mark only if above checked)
          ___ You matched it word for word.
___ You posted an IAQ.
___ You answered an IAQ.
    ___ Like in the IAQ itself.
        ___ Word for word.
___ Your answer is a candidate for the IAQ.
___ You posted an obvious homework assignment.
    (Mark only if above checked)
    ___ Without even trying to hide it.
    ___ Your attempt to hide it as a contest failed.
        ___ Miserably.
_X_ You suggested that posting without reading the FAQ should be tolerated.
___ You suggested that a moderated comp.lang.c should be created.
___ You asked a question that was recently answered in this newsgroup.
___ Your post referred to the newsgroup as a Board, BBoard, BBS, or
    Notesfile.
___ You asked for an FTP site for {*filter*} pictures.
___ You posted a request for {*filter*} email.
___ You posted a request for *HOT*BI*BABES*.
___ You posted a chain letter.
___ You posted a survey.
___ You posted a "YOU ALL SUCK" message.
_X_ You suck.
___ You posted a personal ad to a non-personals group.
___ You posted a job offer.
    (Mark only if above checked)
    ___ And you are a recruiter who just doesn't care.
___ You posted a "test" in a non-test newsgroup.
___ You posted a binary file to a non-binary newsgroup.
___ You posted in comp.lang.c because
    (Mark only if above checked)
    ___ comp.std.c didn't answer your off-topic post.
        ___ After you posted it three times there.
            ___ Which your Netscape turned into a nine post mini spam.
    ___ The moderators of comp.lang.c.moderated rejected it.
___ You posted C++ code to a C group.
    (Mark only if above also)
     ___ And your C++ code was pathetically wrong.
     ___ You claim that C is a subset of C++.
     ___ You claim that C++ is a superset of C.
     ___ All of the above.
___ You followed up to above saying "C++ doesn't belong on this group" and
    you didn't realize you were crossposting to comp.lang.c++.
___ You mentioned ___ nonstandard library function(s).
    (Mark all that apply)
     ___ getch()
     ___ clrscr()
     ___ kbhit()
     ___ bzero() and/or bcopy()
     ___ strcasecmp(), stricmp(), strnicmp(), or strncasecmp()
     ___ FindFirst() and/or FindNext()
     ___ PC BIOS calls
     ___ Other ____________________________________.
_X_ You mentioned _1_ nonstandard language features:
    (Mark all that apply)
     ___ void main
     ___ int32, u_int16, etc.
     ___ inline functions
     ___ asm(), __asm__(), etc.
     ___ far pointers
     ___ fork
     _X_ Other _stdcall_and_friends________________.
_X_ You mentioned _1_ nonstandard headers:
    (Mark all that apply)
     ___ <conio.h>
     ___ <dos.h>
     ___ <unistd.h>
     ___ <malloc.h>
     _X_ Other _<vcl\vcl.h>_and_others_I_have_blissfully_forgotten_.
_X_ You mentioned _1_ OS specific features:
    (Mark all that apply)
     _X_ DLLs
     ___ shared libraries
     ___ interrupts
     ___ processes
     ___ serial communications
     ___ printers
     ___ threads
     ___ Other ___________________________________.
___ You said that since your nonstandard feature/function is supported by
    both Borland *and* Microsoft, it should be considered standard.
    (Mark only if above checked)
     ___ And you prohibited MSN from carrying your post.
___ You misquoted from or made false claims about ISO 9899:1990.
    ___ Because you quoted someone else's misquote.
    ___ You never read it.
    ___ You quoted from the Schildt version including the fly specks.
    ___ You haven't look at Amendment One and TCs.
_X_ Your post contains the following instantiations of bogosity:
    ___ "Works for me"
        ___ When in fact it doesn't.
    _X_ "Hope this helps"
        _X_ When it's hopeless.
___ Your question is based on the assumption that stdout is a screen and
    stdin is a keyboard.
___ Your question is based on the assumption that all computers *have*
    screens and keyboards.
___ You suggested micro-optimizations.
    ___ And asserted that ++i; is faster than i = i + 1;
___ Your post contained commercial advertising.
    THE FINE FOR THIS IS $20. Please remit immediately to:
                    Usenet News
                    Network Security & Standards Patrol
                    3 Cielo Vista Terrace
                    Monterey, CA 93940
    or your posting privileges will be canceled.
_X_ Your post/letter contained numerous spelling errors.
_X_ Your post/letter contained multiple grammatical errors.
___ YOUR POST CONTAINED EXCESSIVE CAPITALIZATION AND/OR PUNCTUATION!!!!!
___ Your post contains
    ___ MIME encoded
    ___ uuencoded
    ___ otherwise encoded (please specify: ___________)
        ___ C source.
        ___ C++ source.
        ___ core dumps.
        ___ screen shots.
_X_ You {*filter*}ed about being told to take your OS-specific questions to an
    OS-specific group.
___ You attempted to start a flamewar by asking "What is the best compiler
    for windows/mac/Unix etc."
___ You fell for a troll/flamebait.
    ___ On April 1st.
___ You do not know how to recognize sarcasm.
    ___ Even when you've been warned.
___ You bragged about your reputation as a C guru among all your other
    Borlandite friends.
___ You constantly flame and insult people using an anonymous account or a
    fake/ambiguous userhost.
___ You asked for flash.c, nuke.c, or another destructive program/script.
_X_ You flamed someone for flaming newbies.
___ You suggested that we be nice to newbies.
___ You were grumpy for no reason at all.
_X_ You were nice where you should have been grumpy.
_X_ You pretend to have a clue when it is obvious that you don't.
___ You flamed the group because nobody answered your question.
___ You started a long, stupid thread.
___ You continued a long, stupid thread.
___ You posted a "newgroup" message without Leader Kibo's permission.
___ You posted a "rmgroup" message without Bruce Becker's permission.
___ Your post/letter was an obvious forgery.
    (Mark only if above checked)
    ___ It was done clumsily.
_X_ You have a lame login name.
_X_ Your machine has a stupid name.
___ You quoted an article/letter in followup and added no new text.
___ You quoted an empty article.
    ___ And it was a followup.
        ___ To your own article.
___ You posted an original article/letter with no new text and no quoted text.
_X_ You quoted an article/letter in followup and only added _1_ lines
    of text.
___ You quoted an article in followup and only added the line "Me, too!!!"
___ You predicted the "Imminent Death of the Net[tm]".
___ You asked for replies via email because you "don't read this group".
_X_ You flamed someone who has been around far longer than you.
    (Mark only if above checked)
     ___ One of the Holy Trinity
         (Mark only if above checked)
          ___ Dan
          ___ Peter
          ___ Lawrence
___ You quoted authorities in a false attempt to prove your point
    ___ One of the other Holy Trinity
         (Mark only if above checked)
         ___ Clive D. W.
         ___ Tanmoy
         ___ Doug
    ___ and said authority feels ashamed to be misused this way.
___ You haven't grasped a detailed explanation.
    ___ Not even when brought to you by Steve Summit.
        ___ Not even after a private email lesson by Steve.
___ You sided with
    ___ Scott Nudds
    ___ ACL
        ___ and everybody knew she was just being
...

read more »



Thu, 16 Nov 2000 03:00:00 GMT  
 Dynamic Link Libraries



Quote:

>> #include <vcl\vcl.h>  // I hope u use BCB

>You have a header file whose filename includes a vertical tab?

\v doesn't imply vertical tab in this context. As part of a header name \
has undefined behaviour (however including a non-standard header has
undefined behaviour anyway). (See subclause 6.1.7 of the ISO standard or
the C9X draft for details).

--
-----------------------------------------


-----------------------------------------



Fri, 17 Nov 2000 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. C + VB = Dynamic Link Libraries?

2. Writing Dynamic Link Libraries (.DLL's)

3. HELP: Dynamic Link Library in UNIX

4. A dynamic link library (DLL) initialization routine failed.

5. Dynamic Link Library(DLL)

6. Dynamic link library?

7. Dynamic Linked Libraries

8. The ordinal 3291 could not be located in the dynamic link library MFCO42D.DLL

9. Win32 Dynamic-link library

10. Dynamic Link Library used in VB

11. How to convert dynamic link library project to static link library project?

12. Is it possible to use any Dynamic Link Library ? (Windows)

 

 
Powered by phpBB® Forum Software