|
wdolson wrote: usually flags an warning on compile. It is a valid expression in C++, but newer versions of the compiler do, I think, give a warning about it.
|
|
|
|
|
What I'm looking for is the basic equivalent of the following functions
pair<Blob, Blob> GenerateKeyPair();
void Encrypt(Blob & data, Blob key);
void Decrypt(Blob & data, Blob otherkey);
Expectations: Free for commercial use, source code or static library, quality algorithm, quality code, no babbling about prime numbers and padding and Bob's love live in the documentation. Ideally doesn't pull in a massive project that takes an hour to configure and build.
Doesn't need to be blindingly fast, doesn't need to thwart the NSA or the credit card mafia.
I've looked at Crypto++ as most likely candidate, but it's still not exactly lazy dev friendly.
(I tried to post in quick answers, but it wouldn't let me. Maybe there's now half a dozen duplicate questions in you database, Chris!)
|
|
|
|
|
How to communicate between two different app using Send Message API?
Ex:
APP1 having textbox txtBox1
APP2 having textbox txtBox2
In txtbox1 whats ever we type, that needs to be displayed in textbox2.
How to achieve it using SendMessage() API.
Ex code in VC++ is appreciated.
|
|
|
|
|
|
Thanks for your help.
I am facing issue in extracting the message.
Code is as follows...
APP1:
int WM_MYMSG = RegisterWindowMessage (L"MYMESSAGE");
HWND hw = FindWindow(NULL, L"Demo");
LPCTSTR strMsg = L"ClientDemo1";
::SendMessage(hw, WM_MYMSG, NULL, (LPARAM(LPCTSTR)strMsg);
APP2:
LRESULT CDemoDlg::OnMyMsg(WPARAM w, LPARAM l) {
MSG* p = (MSG*)l;
LPCTSTR str = (LPCTSTR)p->message;
MessageBox(str);
return (LRESULT) 0;
}
Please let me know what changes is needed here by which it'll display "ClientDemo1" in msgbox.
|
|
|
|
|
The LPARAM in your sending application is a Unicode string, so why are you casting it to a MSG pointer in the receiving app?
|
|
|
|
|
I am just finding the way to print the message.
So you mean to say it is not needed and directly we can use lparam to print the message?
|
|
|
|
|
Anasuya2015 wrote: So you mean to say ... No, I am saying that whatever type you use in the LPARAM field in the sending app, you must use the same type in the receiver.
|
|
|
|
|
Your casting is a bit unclear. It should probably be:
::SendMessage(hw, WM_MYMSG, NULL, (LPARAM) strMsg);
...
LPCTSTR str = (LPCTSTR) l;
MessageBox(str);
The process calling SendMessage() will likely be blocked by the second process since it will be waiting on the message box to be dismissed.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
You can use COM automation, Named Pipes, TCP/IP Sockets or whatsoever by implementing your own protocol for interprocess communtication. 
|
|
|
|
|
Here requirement is restrict to SendMessage() API.
Anyway thanks for your answer. Can you send any sample code for Named Pipes implementation?
|
|
|
|
|
|
Also you can reuse SendMessage() API function with its regular list of arguments by implementing your own that encapsulates for example named pipes client mechanism. 
|
|
|
|
|
You can use WM_COPYDATA[^] message with SendMessage API
There is a linked example on MSDN topic as well
|
|
|
|
|
This is what we use and it works nicely
I'd rather be phishing!
|
|
|
|
|
Hi
I am wondering if anyone can point me in the right direction
I am getting strange results
When I try to move a DWORD to a char[4] I am running in 64 bit mode and it my understanding that both are 32 bits long
The DWORD has 4 bytes of a ebcdic character string
I want to move the DWORD to char 4 so that I can access every character and convert it to ascii when I try to move 1 of the chars to a unsigned int e.g. Unsigned int c = str[1] the result in c is a negative number maybe the high order bit in str[1] byte is on but by moving it to a unsigned int shouldn't that do away with making the result negative for example moving a D0 results in FFF2
Any help appreciated
Thanks
|
|
|
|
|
I think the problem comes from the way bytes are ordered in memory.
When you treat a 4-byte block as a DWORD, the bytes are not in order from MSB to LSB. It depends upon your hardware.
You can verify this in the debugger. Place a breakpoint anywhere you are using the DWORD variable, and then when it breaks, switch to Disassembly view. (Make sure "Show code bytes" is on.) You'll see the way the bytes are ordered, and it's not what you expect!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
That must be it I am doing coding on Hercules MainFrame Emulator when using C Windows function that data doesn't comes back in inverse order
Thanks
|
|
|
|
|
In this case we have to implement an algorithm for packing 4 bytes to a single dword programmatically.
Also, there's no default conversion. DWORD data type is 32 bits = 4 bytes long regardless of it's x64 or x86 mode. 
|
|
|
|
|
Hercules has a function FETCH_FW which will take a MainFrame fullword 4 bytes and put in the right sequence for Windows/Linux However it is still coming in EBCDIC and I need to convert it to ASCII thus I need to access every byte and convert it the function FETCH_FW takes as 1st param a DWORD I thought using unsigned char[4] would produce the same result apparently not
|
|
|
|
|
Hi,
How to call C# callback function from VC++ dll?
In my project dll was developed in VC++ and it was
accessed by c# application.
Now I want to call callback function in C# application when particular event was occur in VC++ dll.
Thanks in advance.
|
|
|
|
|
|
I am developping USB Driver using UMDF1.9 for XP now
I need to reset USB devide from my driver. So I am going to use IOCTL_USB_Hub_Recycle_port to simulate plug off/on.
Does somebody have smaple code hpw to call IOCTL_USB_Hub_Recycle_port
Thanks
Henry
|
|
|
|
|
Does this point you in the right direction?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hello everyone..
I'm currently doing my Masters in Computer Network Engg and I have decided to do my Final semester project in optimisation of firewalls.
I'm thinking of implementing firewall optimisation using rule re-ordering and rule conflict detection, but I don't have a clue on how to get started.
I got to know that I can make use of Windows Firewall API (NetFwTypeLib) and work on top of Windows Firewall but I'm not quite sure if this would help me or not.
If you have done anything similar or have some pointers for me please guide me.
Thanks.. 
|
|
|
|