Click to See Complete Forum and Search --> : Link/Lib question


Marco A. Pérez López
04-15-2002, 11:08 AM
I have a DLL (SC32W.DLL) to test for a dongle. I can use the DLL from VB (I
have the description of the functions inside). I want to use the DLL now in
VC++ but I don't have the SC32W.LIB file so I don't know how can I link with
the DLL.

The best would be to enbed the DLL in my code (as an OBJ or a LIB) so my
code does not have to relay on external DLL files.

Any hint? (or anybody happen to have SC32W.LIB)?

Thanks,
Marco

kuky
04-15-2002, 12:40 PM
Try explicity link with LoadLibrary or LoadLibraryEx and after FreeLibrary.




"Marco A. Pérez López" <malopezmx@yahoo.com.mx> wrote:
>I have a DLL (SC32W.DLL) to test for a dongle. I can use the DLL from VB
(I
>have the description of the functions inside). I want to use the DLL now
in
>VC++ but I don't have the SC32W.LIB file so I don't know how can I link
with
>the DLL.
>
>The best would be to enbed the DLL in my code (as an OBJ or a LIB) so my
>code does not have to relay on external DLL files.
>
>Any hint? (or anybody happen to have SC32W.LIB)?
>
>Thanks,
>Marco
>
>
>

ralph
04-15-2002, 12:53 PM
"Marco A. Pérez López" <malopezmx@yahoo.com.mx> wrote:
>I have a DLL (SC32W.DLL) to test for a dongle. I can use the DLL from VB
(I
>have the description of the functions inside). I want to use the DLL now
in
>VC++ but I don't have the SC32W.LIB file so I don't know how can I link
with
>the DLL.
>
>The best would be to enbed the DLL in my code (as an OBJ or a LIB) so my
>code does not have to relay on external DLL files.
>
>Any hint? (or anybody happen to have SC32W.LIB)?
>
>Thanks,
>Marco
>

I am not familar with the SC32W.DLL.
Are you using the DLL in VB as an ActiveX DLL or as a Regular DLL?

If ActiveX just use COM, import the typelib, and make it inproc.

Otherwise... "HOWTO: Create 32-bit Import Libraries Without .OBJs or Source"
at:
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q131313&LN=EN-US&rnk=19&SD=gn&FR=1&qry=create%20.lib%20file%20from%20.DLL&src=DHCS_MSPSS_gn_SRCH&SPR=MSALL&

Hope I understood your question and this helps.
-ralph

Marco A. Pérez López
05-05-2002, 02:06 AM
> I am not familar with the SC32W.DLL.
> Are you using the DLL in VB as an ActiveX DLL or as a Regular DLL?
>
> If ActiveX just use COM, import the typelib, and make it inproc.
>
> Otherwise... "HOWTO: Create 32-bit Import Libraries Without .OBJs or
Source"
> at:
>
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q131313&LN=EN
-US&rnk=19&SD=gn&FR=1&qry=create%20.lib%20file%20from%20.DLL&src=DHCS_MSPSS_
gn_SRCH&SPR=MSALL&
>

YES, the article helped, I had to do it the long way (creating a dummy dll
with a DEF file so the Pascal convention routines could be generated OK).
But shame, what I am doing is an ActiveX control and the system won't
register an ActiveX that uses an external DLL.

Know of any way to convert a DLL into a linkable LIB? Don't think it can be
done.

SC32W.DLL is a DLL supplied by Rainbow Technologies to deal with one of
their dongle models (Sentinel-C, an old one).

Thanks anyway.
Marco

Marco A. Pérez López
05-07-2002, 12:06 AM
MichKa:

The LoadLibrary stuff worked fine. Thank you very much!

By the way: In my OCX I define a CCmdTarget-derived class with Automation
enabled so instances of the class can be created from VB. Well, how should I
create the instances of the class in C++ so they are still alive after the
OCX is
closed? If I use new then i have to use delete at closure time and VB gets
angry if it istill has a reference to one of my objects. Is CoCreateObject
the only solution even in MFC?

Marco
malopezmx@terra.com.mx


"Michael (michka) Kaplan" <former_mvp@nospam.trigeminal.spamless.com>
escribió en el mensaje news:3cbb49e4$1@10.1.10.29...
> Just call LoadLibrary/GetProcAddress (thats all that VB does with your
> declare statement anyway) and call the lpfn you get back.
>
>
> --
> MichKa