Re[4]: using DLL built with VC6

soya protein <[email protected]> Wed, 24 Aug 2005 18:45:33 +0200
Newsgroups gmane.comp.lang.delphi.jedi
Message-ID <[email protected]>
Hello Timur,

Tuesday, August 23, 2005, 9:40:32 PM, you wrote:

> If I would you I wouldn't hurried up that much implementing that in Delphi.

 Why not ? Having it in DLL is advantageous language-wise, but like i said :
it was getting on my nerves and i created a UNIT with single object for
wireless card control. When programmer needs to write an app that controls
the card, he/she will simply include the unit file and be done with it.

 Besides, the original WRAPI.dll implements basic functioning, whereas
my delphi object does it in much smoother, more natural way (yes, it
could be written in C, but i'm doing this for myself and you "delphies" :).

 Example : you need to write application whose program flow depends on
certain parameters acquired during AP scan.

  Using "old" WRAPI.dll, you'd need to call the function, then search
the list and after using it, dispose of the memory used by that list.
OK, it's a perfectly working and sound solution.

 But, what i'm trying to do is make this process more automated, IMHO
simpler. Again, you need to access the list. All that is needed is
call RefreshAPList and then loop through the indexed properties for each
AP, ie :

     ...
     n := desired_index_in_list;
     wanted_SSID := wireless_obj.APL_SSID[n];
     wanted_RSSI := wireless_obj.APL_rssi[n];
     ...

[NOTE : the "APL_" thing denotes which group these properties belong to]

 And that's it. If new scan is required, just call RefreshAPList again.
No worries about allocated memory, no invalid indexes etc. There are bugs
lurking about im sure, no code is 100% bug-free, but this approach does
make life easier, eh ? The internal access point list is maintained by
modified TList that's not available outside the unit module.

 I made each property for each item in list individually accessibble via
index since i had no better idea on how to present this data to the "outside".

 Currently, the unit module is cca 70 kb. Quite a lot for a single object,
but there are lots of translated .H files in it too, dont' forget.

 I wanted to keep as much as possible of the original names used in WRAPI to
make navigation easier if programmer sees the source for the first time.

> This ?WRAPIDisassociate@@YAJXZ name is not that bad (and you could easily use
> it in the Delphi if you would put this name literally into the external part
> of function declaration).

 Oddly enough, i did that and still had that gloomy no-such-function-in-dll
dialogbox pop-up. I must have done something wrong, i know ...

> Before returning to the code please use another tool for your help -
> undname.exe from Visual Studio.
> C:\Visual Studio\Common\Tools>undname -f ?WRAPIDisassociate@@YAJXZ
> Microsoft(R) Windows NT(R) Operating System
> UNDNAME Version 5.00.1768.1Copyright (C) Microsoft Corp. 1981-1998
>>> ?WRAPIDisassociate@@YAJXZ == long __cdecl WRAPIDisassociate(void)

 Yup, that's what i got, but like i said before : it's now in delphi
and it will stay in delphi. CPP sources are now for reference only.
 
-- 
Best regards,
 soya





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hb44m0r/M=362131.6882499.7825260.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1124910916/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Delphi-JEDI/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/