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

From Borland C++ to VC++. Easy DLL question.

89 views
Skip to first unread message

David Sworder

unread,
Feb 2, 1997, 3:00:00 AM2/2/97
to

I recently made the switch from Borland C++ 5.0 to VC++ 4.0. I am in the
process of trying to convert my programming project (which is written
strictly using win32 API) over to VC++. Most of the code transfered over to
VC++ pretty smoothly, but I am having a problem with the Borland Windows
Custom Controls (BWCC). I access BWCC through a .DLL file called BWCC32.DLL
and the functions are declared in a header file called BWCC32.h.

The first thing I did was create a .LIB file by typing "lib
/DEF:bwcc32.dll" at the DOS prompt. That's where my problems began.
Although a .lib file was created, the lib program gave me the error:
"MZPstatement not supported for target platform." Anyway, back in VC++, I
went to Build|Settings|Link and made sure that bwcc32.lib file that I just
created was being linked to my project. Next, I tried to compile the .cpp
file that made use of bwcc, and I got 12 warnings and 0 errors. Each of the
12 warnings said: "warning C4236: nonstandard extension used : '_export' is
an obsolete keyword, see documentation for __declspec(dllexport)" Because
the .cpp file compiled with no errors (but 12 warnings), I figured that I'd
try linking my program. This didn't work. The VC++ linker said: "unresolved
external symbol _BWCCRegister@4." BWCCRegister() is the name of a function
that I am calling in my program. The code for BWCCRegister() lives
somewhere in BWCC32.DLL. I'm not sure why the linker is coming up with
"_BWCCRegister@4" as the name of the unresolved function.

I've tried to explore the InfoView help and it appears that my problem has
something to do with an inappropriate "calling convention". I'm not sure
what this term means, though :(.

Here are some excerpts from BWCC.H:

#if defined( __cplusplus )
extern "C" {
#if !defined(__FLAT__) && !defined(WIN32)
#define BWCCAPI FAR EXPORT PASCAL
#else
#define BWCCAPI APIENTRY EXPORT
#endif
...
//Here is the definition of the function that I am trying to call.
extern BOOL BWCCAPI BWCCRegister(HINSTANCE hInsta);
...
}

I would appreciate any idea/suggestions that you might have! Thanks!

David Sworder


Craig Fischer

unread,
Feb 3, 1997, 3:00:00 AM2/3/97
to

Not sure what the LIB error was about, but as for the "nonstandard
extension" warnings that you got, you need to look up how to use
__declspec(dllimport). I ran into this same problem when porting BC++
-> VC++. Seems that Microsoft doesn't support __export in 32-bit mode.
Check out KB articles Q123870 and Q107501.

...Craig...

Greg Mullins

unread,
Feb 4, 1997, 3:00:00 AM2/4/97
to

Curious David, why did you switch? The Borland package comes with MFC and
it's pretty flexible. I think the Borlands package is more flexible the
MSVC.
-Greg

> Craig Fischer <cra...@visio.com> wrote in article
<32F60D...@visio.com>...

Chuck Le Mieux

unread,
Feb 4, 1997, 3:00:00 AM2/4/97
to

I'd be willing to bet it had everything to their track record and ability
to support their product.

Greg Mullins <mull...@juno.com> wrote in article
<01bc12f7.956b71c0$ea13ae84@mullins>...

Craig Fischer

unread,
Feb 5, 1997, 3:00:00 AM2/5/97
to

That was one of the main reasons why we switched. I agree that BC++ was
a thousand times more flexible than VC++ is, and that was, in fact, one
of the drawbacks to switching. But considering that BC++ was so behind
in supporting things (including their customers), we just had to make
the switch. That, and either it didn't do a very good job of compiling
MFC or it was too cumbersome to try and use it (I don't recall which
since it's been a while...), so we didn't want to go that route.

If VC++ would give users the freedom to manipulate files, link options,
etc., like BC++ does, then I'd be a very happy camper!

...Craig...

David Sworder

unread,
Feb 6, 1997, 3:00:00 AM2/6/97
to

> Curious David, why did you switch? The Borland package comes with MFC
and
> it's pretty flexible. I think the Borlands package is more flexible the
> MSVC.
> -Greg

Actually, I'm very pleased with Borland's product...but from what everyone
is telling me, Microsoft's product is quickly becoming the standard and I
don't want to get left behind, ya know? I hope I'm making the right
decision, but only time will tell..


David Sworder


0 new messages