Re: Linking DLL's across different compilers and languages



Depends on what you are searching for and how you are searching for it. If you are
searching for a particular handle, why does sort order matter? It shouldn't. So all this
says is that if you have n objects and want to find one, you could use binary search and
find it in log2(n) probes. Of course, if you do a lot of that, you should probably use
CMap or std::map and find it in O(k) where k is a small integer; as an example, perfect
hashing gives you O(1) probes into a table. But the sort order doesn't matter when you
are searching for equality using binary search, as long as actual comparative values don't
matter (and in that case, they wouldn't).
joe

On Mon, 4 Dec 2006 00:10:13 -0600, "Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote:

It might screw up a binary search, though, I would guess that it would at least
change the sort order.

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:8f17n2hkc2bq2h200as4qr1p4j83703ck5@xxxxxxxxxx
It matters only if a TOKEN_VALUE has to be compared as less than or greater
than some
other TOKEN_VALUE. For equality, 32-bit values are equal to 32-bit values,
and signedness
is irrelevant to the discussion.

If you pass back 0xC173450 and store it in a VB integer, and from some other
place you
pass back 0xC173450 and store it in a VB integer, then the two integers are
the same
value. Period. The fact that they are negative has zero, zilch, zip impact
on the
comparison. Equal is equal.

While you may perfectly well want to think of it as an unsigned integer in C
or C++,
that's just an artificial interpretation you place on the bits. For equality
comparison,
or passing around to other places, a 32-bit value is just a 32-bit value.
joe

On Sun, 3 Dec 2006 13:09:05 -0600, "Peter Olcott" <NoSpam@xxxxxxxxxxxxx>
wrote:


"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:ip36n29ot3akdg19rog53415u01n612j7j@xxxxxxxxxx
32-bit 2's complement values are 32-bit 2's complement values. "Signed" and
"unsigned"
are artificial concepts we impose on these values. Whether or not these
have
meaning is
very dependent on the problem domain and expectations of the code, so
passing
around
32-bit values is perfectly safe, providing you don't expect to compare
absolute magnitudes
of these values in VB. For example, if you expect all values to be <
0xFFFFFFF then your
code is not going to work particularly well. But you can certainly pass the
values around
without hindrance.
joe

I want to pass back a 32-bit unsigned TOKEN_VALUE to Visual Basic, and VB must
be able to compare this as an unsigned value. The only solution that I figured
is to simply have half as many possible TOKEN_VALUES and store these in an
int,
instead of an unsigned int.


On Sun, 3 Dec 2006 07:10:39 -0600, "Peter Olcott" <NoSpam@xxxxxxxxxxxxx>
wrote:


"Ajay Kalra" <ajaykalra@xxxxxxxxx> wrote in message
news:1165123224.626265.322990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
To what extent can a DLL created with MS Visual C++ be used across
different
compiler versions, different compiler vendors, and different computer
languages
be used? Some of the data provided by one of the functions will be
unsigned
int,
is there any way to make this work with VB?

A DLL of a specific type is simply a DLL regardless of compiler vendor
or computer languages. These factors have no bearing on the DLL itself.

Not knowing much about VB, it however does allow you to access Win32
DLLs. It will also be able to access MFC Regular DLLs. Any method
exported in these DLLs can be accessed in VB using GetProcAddress. VB
also allows easy access to COM servers, which is its one of its main
selling points.

---
Ajay

What about VB's inability to handle unsigned integer types? Is there any way
around this that you can conceive?

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: backdoor.afcore.bb HELL
    ... Blocking Spyware, Adware, Parasites, Hijackers, Trojans, with a HOSTS file ... > free Firewall.With secure dll authentication enabled,by ... using registry entries and MSCONFIG itself ... >>> I've tried searching google but didn't find anything. ...
    (microsoft.public.security)
  • Re: JDBC Driver- Problem in DB2 V7.1 PUTLVL0604
    ... but how are you searching for these dlls? ... but you may want to dump your DDDEFs to see where SMPE would have put them. ... DDDEF entries and to make the directory were run. ... Is there a way to create these dll files. ...
    (bit.listserv.ibm-main)
  • Re: Itermec 700c Cant find an Entry Point ITCSCAN_WinAsyncRead in a PInvoke DLL
    ... yeah size of itcscan.dll that i have is 7k ... but i have searched the whole Intermec\Developer Library folder and only ... This could be a typo on your part of using the incorrect DLL. ... searching for other copies of the DLL that may be different and try ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: .NET commicate to FireWire (IEEE1394)?
    ... and there are 3rd party SDKs like ... and Im searching for any dll you may be able to use, Texas Instruments would ...
    (microsoft.public.dotnet.general)
  • Re: How to covert PPA office97/2000 to officeXP ?
    ... I know that the PPA is a container for VB code. ... searching) allso a DLL that needed to be registerd. ...
    (microsoft.public.powerpoint)