Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows DLL's and sscanf

1 view
Skip to first unread message

Rajan Ranga

unread,
Aug 24, 1994, 1:25:57 PM8/24/94
to
I am developing a DLL using MSVC++. The DLL (Windows) is written in C.
For par of my routines, I need to use sscanf to read in a line and extract
some data. The problem is that according to the documentation, sscanf is
not supported in Windoes DLLs. I am assuming that the reason is because
you can not use stdin and stdout in a DLL. I decided to try it out anyway.
What I did is include the C libraries in the DLL and compiled it without a
problem. When I use the DLL, there is not problem either.

I would like to know if this is safe. Has anyone does this before? If it
is not safe, is there an alternative to sscanf that can work with Win DLLs?
I am calling the DLL from Visual Basic (if that is important).

BTW: One reason why I am not rewriting the routine or finding another
alternative is because the routine is already written and tested.

Rajan

--
Rajan Ranga
ra...@cco.caltech.edu

Ed McCreary

unread,
Aug 25, 1994, 3:19:36 PM8/25/94
to
In article <33fvr5$a...@gap.cco.caltech.edu> ra...@cco.caltech.edu (Rajan Ranga) writes:

I am developing a DLL using MSVC++. The DLL (Windows) is written in C.
For par of my routines, I need to use sscanf to read in a line and extract
some data. The problem is that according to the documentation, sscanf is
not supported in Windoes DLLs. I am assuming that the reason is because
you can not use stdin and stdout in a DLL. I decided to try it out anyway.
What I did is include the C libraries in the DLL and compiled it without a
problem. When I use the DLL, there is not problem either.

I would like to know if this is safe. Has anyone does this before? If it
is not safe, is there an alternative to sscanf that can work with Win DLLs?
I am calling the DLL from Visual Basic (if that is important).

Hmm, I usually avoid functions that aren't DLL compatible. The first thing
I would do is *really* stress out your code. If you can't make it fail,
what the hell. An alternative is to look at the BSD library source. I
think the license agreement would let you copy the sscanf source, but
I could be wrong.

--
Eddie McCreary e...@twisto.compaq.com
Graphics Development "Do or do not, there is no 'try'."
In the event of my capture, Compaq will disavow any and all knowledge
of my operations. Of course I don't speak for them.

0 new messages