Journal Xerithane's Journal: Cry for help: Win32 DLLs 6
Need some quick and relatively easy help. I need to code up a Win32 DLL to be imported by a Visual Basic or VBA app (I'm not sure which, because that shit is like greek to me.)
Anybody available to offer some quick tutorials on how to do this, I have no documentation for Win32 code at all.
IM me at AIM: Xerithane if you can help. Thanks.
Update: Let me go ahead and tell you what we're doing. We are using a Blowfish algorithm to encrypt/decrypt information of arbitrary lengths. I'm doing it in 8-byte chunks on the Unix side, and just working with the data raw (no encoding.) We have a Visual Basic application that needs to be able to use the same algorithm, but all Blowfish algorithms in VB are refusing to work.
What do you need? (Score:1)
Of course if you need a COM server DLL, then you can use VB, not C++.
If you tell me what it is you need I can probably help you.
Sorry, no AIM, and I can't check Hotmail from here right now =(
Dang, you beat me (Score:3, Informative)
Yes, as Bungi said, there are two ways to write a DLL in C++ to be used in a VB or VBA application. Let me expand a teeny bit on what he said:
1) Write a COM server that implements the correct interfaces. I'm not a real strong C++ programmer, but I believe the best way to do it is have a dual interface COM server that implements both a custom interface and IDispatch.
2) Write a standard C++ DLL and use the importing mechanisms of VB. Visual Basic has a way to use an "old-school" Windows DLL so it can use
Re:Dang, you beat me (Score:2)
This is what we are doing. I just need to export two functions: encrypt and decrypt. Everything else can be handled internal to the DLL.
Re:Dang, you beat me (Score:2)
Well, having the ability to set the key used might help ;-)
It looks like this [wiretapped.net] DLL would fit the bill? It's under a Bernstein-style license ("Like the algorithm itself, this DLL may be freely used and distributed.") and all the source code and documentation you'd need seems to be here [wiretapped.net].
Example usage as follows (with hexadecimal data; it can handle binary as well, by set
Re:Dang, you beat me (Score:2)
Actually, no. I'm perfectly ok with forcing the key in C:\keyfile or something.
Basically, just set the Key, call Init, then call Encipher or Decipher as needed. (One constraint: they require 8 byte blocks, rather than arbitrary length chunks, since Blowfish is a 64-bit block cipher.) Put a trivial wrapper around it - chop the input into 8 byte blocks, null-padding the last one as needed - and it's exactly what you're after AFAICS.
That's exact
Re:Dang, you beat me (Score:2)
Ah, I see. Try this [di-mgt.com.au] one then - a pure VB version, or an alternative DLL. Basically old-style BSD license, at least on the VB version, and apparently this one does have source code.
I'm just sitting in the eye of a hurricane right now. Weird feeling. And I get next Friday off for surgery, and the follow