|
Thanks a lot friend. I dint notice that before, now I made it as a member and toolbar is coming . Thanks a lot for help.
|
|
|
|
|
Hi,
I have an array of strings which contains the file names and I call a function in a loop.
char myFiles [20][50];
for(i=0;i<20;i++)
myFunc( myFiles[i]);
The challenge I am facing is that, I have to store all the files in a directory, say "input" folder.... and then call
myFunc( myFiles[i]);
which I am unable to do.
I used
mkdir("input"); to create a directory and move all my files into it also using
system("move *gen.txt input");
But now if I give that path in my function it has to be hardcoded which eventually cannot be run in a loop.
ie
for(i=0;i<=20;i++)
myFunc("C:\\input\\myFiles[i]");
I am using eclipse IDE.
Thanks in advance,
Faez
|
|
|
|
|
Have a look at the str... functions. To create a full file name, you may use strcpy and strcat :
char PathName[_MAX_PATH]; for (i = 0; <= 20; i++)
{
strcpy(PathName, "C:\\input\\");
strcat(PathName, myFiles[i]);
myFunc(PathName);
}
|
|
|
|
|
That worked
BTW I came up another method as below
system("copy input/*.txt ");
system("del *.txt");
Anyways, thanks for the nice logic
Regards,
Faez
|
|
|
|
|
It sounds to me like you need to concatenate the filename onto the foldername.
//In that case, you may choose to do something similar to this:
// 1. Get the filenames
// 2. Get the folder name
// 3. copy foldername to fullPath
// 4. concatenate (append) myFiles[i] onto fullPath
// 5. If curFileNum < maxFiles goto 3.
char filenames[4][50] = { "001.txt", "002.txt", "003.txt", "004.txt" };
char inputFolder[] = "inputFolder";
int i, maxFiles=4;`
for (i=0; i<maxFiles; i++)
{
strcpy(fullPath, inputFolder);
strcat(fullPath, "\\");
strcat(fullPath, myFiles[i]);
myFunc(fullPath);
}
[EDIT: oops! Too slow - someone has kindly furnished an answer already]
|
|
|
|
|
I want to insert and verify digital signatures in pdf,some one can help me?
|
|
|
|
|
Have you looked at the PDF Reference, as supplied by Adobe?
If you look at pg 684 in "pdfreference16.pdf", you'll find the subject is covered there. Sorry, I don't have a direct link - I downloaded it from Adobe quite some time ago.
|
|
|
|
|
Have you complete the relevant code to realize digital signatures
|
|
|
|
|
I'll assume that was supposed to be a question.
I'll also assume that it was you that gifted me the 2-vote for my last answer...
No. No need for me.
I've written code from scratch to create pdf documents containing text, line drawings, images and attachments - any/all of which may be deflated or ascii85 encoded.
One you can understand the format enough, you soon realize that a user can fairly easily remove your digital signature and the implied security it carries.
Hint: find a water-marked pdf and work out how to remove the watermark from _all_ pages.
Clearly, there's several parts to the task -
1. Decide whether you wish to create a 'byte range digest' or an 'object digest'
2. Implement a function (in your own app) to create this digest
3. Implement this same function again in a plug-in signature handler
[EDIT: Digital Signature Removal code added]
Here, a 10 line perl script to strip the digital signatures from a PDF
#!/usr/bin/perl
# Usage: perl invalidate-signing-certs.pl <in.pdf> out.pdf
#
binmode(STDIN);
binmode(STDOUT);
$/ = "\0";
while(<>) {
s#(/Perms<</DocMDP.*?>>)#' ' x length $1#ge;
s#(/Ff 1)(?=.*?/Lock )#' ' x length $1#ge;
s#(?<=/Lock)(.*?)(/Ff 1)#"$1" . ' ' x length $2#ge;
s#(/Lock .*?)(?=/)#' ' x length $1#ge;
print $_;
}
Source: http://ronin-group.org/misc_pdfsignatures.html[^]
|
|
|
|
|
I had a test that to insert "\n" or "\r\n" into a string,but not effective. Do not support this style in vc6 default ctrl?
Please help me.Thanks a lot!
下辈子美利坚。
|
|
|
|
|
The list control only supports single-line entries.
For multi-line, you'll need to use an edit control.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Have you seen this?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes,I just need it. Oh,god,thank you very much,my friend!
|
|
|
|
|
hi all,
can anybody help me to move a treeitem with its child items.
like when i use deleteitem its delete its child also,so is there any way to add its child when move a item to another location.
thanks.
|
|
|
|
|
There is no direct support to do this.
Here is a good article on how its done - Move Tree Items[^]
|
|
|
|
|
|
Hi,
All new TCP connections begin with a SYN packet... you should use your favorite search engine to investigate a 'SYN Flood'.
How To: Harden the TCP/IP Stack[^]
Also... it is very difficult to protect against these attacks from the operating system... you will be better off using a high end router to limit the rate of SYN packets. Keep in mind that 'Saying No' consumes cpu cycles... and that there is technically no defense to a massive DDOS.
The best defense is to unplug the network cable.
Best Wishes,
-David Delaune
[UPDATE]
Your problem has nothing to do with SYN Floods or DOS attacks... your source code has some serious problems.
modified 24-Feb-12 16:39pm.
|
|
|
|
|
Hi
i need some help in my work with PreTranslateMessage.
PreTranslateMessage dont work if my worker thread is runnin? I kant catch keyevents if i want to copy and paste from my CListCtrl with ctrl + c :
<br />
BOOL CMyDialog::PreTranslateMessage(MSG* pMsg )<br />
{<br />
UINT uMsg = pMsg->message;<br />
<br />
if(uMsg == WM_MOUSEWHEEL)<br />
{<br />
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
When the workerthread ist stoped PreTranslateMessage works fine and i can cach keyboard input.
What is wrong with my code??
Best regards
bosfan
|
|
|
|
|
The code shown is OK. But we don't know what your worker thread is doing. If it is performing long operations without using wait calls, it may block other threads.
|
|
|
|
|
Hello,
worker thread fill a large CListCtrl with data etc.
I look into workerthread and try to find what causes this!
Thanks for answer.
Regards
bosfan
|
|
|
|
|
bosfan wrote: worker thread fill a large CListCtrl with data etc.
Your secondary thread should not be interacting directly with a UI control it does not own. It should be posting a message to the owning (primary) thread instead.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi,
thanks for answer,sorry my mistake, the worker thread don't fill a list control directly,
they just fill a stl::map with data, and a owner thread(primary thread) take the
items from map and show them, is "Owner Data" of CListCtrl. This way is ok?
best regards
bosfan
|
|
|
|
|
When the worker threads runs for a significant time (above 100 ms), there should be some function calls allowing other threads to run (WaitForSingleObjectm , WaitForMultipleObjects , Sleep ).
If the worker thread runs with the same priority as the main thread, you may insert some Sleep(0) calls inside the loop to check if this allows your main thread to handle its messages. If so, you should change the worker thread in some way without using Sleep() .
You may also check the communication between worker and main thread. There may be problems even when not directly accessing UI elements. How did you send messages from the worker thread to your dialog or list control?
|
|
|
|
|
I don't use ::SendMessage(..) for this, i set a timer to set the size for this list control
with CListCtrl::SetSize(newsize) and new size is stl::map size, number of items in map.
Like you said i check first communication between worker and main thread.
I start this thread (worker) with a lowest priority.
|
|
|
|
|
if(uMsg == WM_MOUSEWHEEL)
{
return ;
}
return CDialog::PreTranslateMessage(pMsg);
}
|
|
|
|