|
I am writing an application plug-in that will potentially be released to end users outside the US. Part of this requires me to store a password in a file. I know that there are tricky encryption laws, but I don't really know how they work. What can I do to store an encrypted password in a file that would be legal for US export?
|
|
|
|
|
You could have a look in the libcrypto part of OpenSSL, which contains a lot of cryptographic functions and should detail if any have export restrictions (which I doubt it)
|
|
|
|
|
I'm trying to build a library of specialized helper functions I can move from project to project. I'm currently building an ActiveX control, and linking with this "helper" library (dll). This is the first time I've built my own dll, and I'm having some problems. Here's the problem I'm having...
I have a class I export in my dll, and can successfully import it into my control, but if I change the arguments in one of the member functions to a CString reference, the ActiveX control crashes when it executes that function. If I change the argument to pass by value, everything is OK, but I can't modify data in my control. I realize this is a brief explanation, but I'm hoping there's something that comes to mind as far as exporting classes that try to modify data in the calling application (ActiveX control in this case) with a reference to an object (CString) in the calling application.
Thanks.
|
|
|
|
|
I'm having some problems with interprocess communication. Here's the essentials of my code. I create two FIFOs, do some read/write, and close them. All goes well until after the reading/writing; when I close the FIFOs, I start getting "Illegal seek" errors, and finally a segmentation fault. I've attached the parent / child code, and the output. The perror statements were in there for debugging purposes, but I left them in so you can see where the "Illegal seeks" start. Any idea what I've done wrong?
(rbuf and wbuf are char *'s, and these processes are created with a standard fork() call)
PARENT
Mkfifo(syscallFifo,S_IRUSR | S_IWUSR);
fdsys = Open(syscallFifo,O_RDONLY);
Read(fdsys,&irbuf,sizeof(int));
printf("The child said: %d\n",irbuf);
Read(fdsys,&*rbuf,irbuf);
printf("The child said: %s\n",rbuf);
fdrep = Open(replyFifo,O_WRONLY);
wbuf = "Hello from the parent";
iwbuf = strlen((const char *)wbuf) + 1;
Write(fdrep,&iwbuf,sizeof(int));
Write(fdrep,&*wbuf,iwbuf);
perror("Waiting for the child to end");
wait(&status);
perror("All done waiting");
Close(fdsys);
perror("Parent closed first fifo");
Close(fdrep);
perror("Parent closed second fifo");
Unlink(syscallFifo);
Unlink(replyFifo);
CHILD
Mkfifo(replyFifo,S_IRUSR | S_IWUSR);
fdsys = Open(syscallFifo,O_WRONLY);
wbuf = "Hello from the child";
iwbuf = strlen((const char *)wbuf) + 1;
Write(fdsys,&iwbuf,sizeof(int));
Write(fdsys,&*wbuf,iwbuf);
fdrep = Open(replyFifo,O_RDONLY);
Read(fdrep,&irbuf,sizeof(int));
printf("The parent said: %d\n",irbuf);
Read(fdrep,&*rbuf,irbuf);
printf("The parent said: %s\n",rbuf);
perror("Time for the child to shush");
Close(fdsys);
perror("Child closed first fifo");
Close(fdrep);
perror("Child closed second fifo");
exit(0);
OUTPUT
The child said: 21
The child said: Hello from the child
Waiting for the child to end: Success
The parent said: 22
The parent said: Hello from the parent
Time for the child to shush: Success
Child closed first fifo: Illegal seek
Child closed second fifo: Illegal seek
All done waiting: Illegal seek
Parent closed first fifo: Illegal seek
Parent closed second fifo: Illegal seek
Segmentation fault
|
|
|
|
|
Have you tried running it in the debugger? Once you close the handles then your program is not really doing anything else, and so a segmentation should be hard to achieve. As an aside, the code isnt the easiest to read as presented, but it does seem to be a mix of Win32 and Unix - which is it meant to be? Additionally, you dont need to do '&*rbuf' - rbuf will do!
|
|
|
|
|
Thanks. Actually, I had figured it out; I've been so warped by using Visual Basic that I was attempting to allocate a char * like a VB string.
|
|
|
|
|
This looks suspiciously like a l*nux question to me...
[fx: dredges up memories of working with genuine UN*X code]
You don't have a definition shown anywhere for rbuf, wbuf or irbuf/iwbuf.
I'm assuming that the first two are char [somenumber] and the latter are int's.
You don't need &* in the read or write calls, unless your compiler is crazy.
Are you certain that the buffers are large enough? That would cause a segmentation fault.
The illegal seek is being reported once, and then you're not resetting errno, so it will keep being reported.
Hope that helps a bit.
Steve S
|
|
|
|
|
I'm writing a plain Win32 dialog app with a big video window and a few basic controls. I want to implement keyboard shortcuts, but I've run across some problems: the controls take the focus away from the main window, so using WM_KEYPRESS doesn't work if the user has the focus on one of the controls. I then tried using accelerator tables; they work fine for VK_XXX keys, but using ASCII alphanumerical keys seem to send the message twice sometimes. Any ideas?
Thanks!
|
|
|
|
|
Hello everybody,
I was wondering if anybody had some experience with this.
I work in Visual Studio 6.0 and a range of libraries for specific engineering work.
You know how intellisense helps you with functions and variables for the standard libraries.
Is there any way one can extend intellisense capability to include other libraries that are being used in the project? Let me know
Any help would be appreciated.
thanks
|
|
|
|
|
Add the other projects to your workspace.
|
|
|
|
|
hi
anyone can help me , how can i open and read a PS/2 port (that not opened with windows and is close)?
thanks
|
|
|
|
|
hi
anyone can help me , how can i open and read a PS/2 port (that not opened with windows and is close)?
thanks
|
|
|
|
|
Ok, this is bugging me.
Say i have this dir:
test
folder1
hello
goodbye
folder2
hello
goodbye
Those are all folders. Now, say i want to delete all folders called 'hello'. How would i do this? I tried piping a dir command into the del command:
dir /A: D /s hello | del
but that didnt work. any one got a tip?
*.*
cin >> knowledge;
|
|
|
|
|
try piping it to a rmdir command. I have not tried it myself.
|
|
|
|
|
it said the syntax was incorrect
*.*
cin >> knowledge;
|
|
|
|
|
This will work.
for /R %i in (hello) DO rd %i
If you are new to DOS, believe it or not, it is a DOS command.
|
|
|
|
|
I thought /R was an NT CMD.EXE thing...
Steve S
|
|
|
|
|
i don't think you can do that in ms-dos.
|
|
|
|
|
well, im using XP's cmd.exe, and im still not having any luck. :-/
*.*
cin >> knowledge;
|
|
|
|
|
Because I miss the point where I can enter the OnInitDialog function on a dialog in .Net2003,
so I tried to use WM_SHOW_WINDOW on this dialog.
When the dialog was called via DoModal() I saw that the OnShowWindow function
was called twice with parameter bShow = TRUE.
Is this a bug or am I missing the point?
|
|
|
|
|
Isn't it possible to create the OnInitDialog function via using the property view of a dialog.
I only see other WM_ Messages.
Am I searching in the wrong place or will this function be replaced and shouldn't be used anymore?
Hope someone can help.
|
|
|
|
|
OnInitDialog isn't actually a regular message handler in MFC (this has been true since at least version 4.2) but is instead a virtual function that you can override. You'll find it in the overrides tab of the Properties window.
Aside: why the hell is this here? Why can't I right-click a class and choose Add Windows Message Handler like in VC 6? That made sense...
|
|
|
|
|
Thanks for this satisfying answer. Yes I think you're right that this important function has to be reached more simple.
|
|
|
|
|
How can I set a Font to a CWnd object with SetFont ?? I try with method GetLogFont, but I don't know how to build a LOGFONT object. Please if you could give me an example... (For Example: Tahoma, size 12).Thank you.
MaestroProgramador.Com
Where every source code is loved like a girl.
|
|
|
|
|
Try this:
<br />
CFont tahomaFont;<br />
<br />
tahomaFont.CreatePointFont(120, "Tahoma");
YourCWndObject.SetFont(&tahomaFont);<br />
That should work. A really good idea is to store your font objects as member variables of a class so you can clean up after yourself at the destructor phase.
Hope this helps
www.kinkycode.com
[Glossary Manager] [AfterThought Backup Lite]
99 little bugs in the code, 99 little bugs,
Fix 1 bug, recompile....
101 little bugs in the code...
|
|
|
|