|
Hi,
Normally many softwares installation comes with expired date.
Just i want to give expiry date for my EXE in Install shield. Im using VC++6.0 Install shield. Just i didnt any option to give this details. Pls any idea or any tutuorila is available for Install shield options?
Anu
|
|
|
|
|
You can use of current date and time when you want to run your program and also see CertOpenStore and CertEnumCertificatesInStore .
|
|
|
|
|
You mean like a demo app that is active for 30 days ? You have to handle that in your application, Install shield won't do that for you.
|
|
|
|
|
Then Ok. Thanks for your reply.
Actually now i have 30minutes demo of my application coded in application itself.
Now i will try to convert it to 30days.
Anu
|
|
|
|
|
Hi Friends,
I need to develop a plugin to add my own toolbar in Outlook express/ Windows Mail.I tried to get handle of window mail window (while it's running); then placed my toolbar in some desired position in the windows mail window, but as we hide some of the toolbar window; my own custom toolbar gets displayed;
kindly help me in this; as Microsoft Outlook has its own object model and allows to customize its GUI and rest handles by itself.
Do we have any such mechanism to use for GUI customization, in case of Outlook Express/ Windows mail also.
I am using in win32 c
Kindly help me in whatever way you can , coz I really NEED it ASAP.
Thanks in advance!
dolly,
N,IN
|
|
|
|
|
|
Hi all,
I have made a dialog based application from which i am trying to delete various other files.. my problem is it deletes all the file from the folder but leaves itself and the folder there only.... how can i delete it.
Thanks in advance
|
|
|
|
|
An executable cannot delete "itself". You may consider a script, or a batch file which will have all the files of your interest deleted. Here's a batch file, which works for me:
@echo off
sleep 50000
del /q "D:\files\file1.txt"
del /q "D:\files\file2.txt"
del /q "D:\files\MyDialog.exe"
del /q "D:\files\mybatch.bat"
exit
Whereas mybatch.bat is the batch file itself. Finish the stuff with your dialog and call this batch file with a ShellExecute()[^]. I've added a delay at the beginning of the batch file to make sure that the dialog gets enough time to quit.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi Rajesh like yesterday?why you told good answer!
|
|
|
|
|
Ah! I never knew that posting a good answer would get me a 1 vote. I wish the poor 1-voting creature all the happiness he could get. He'll need it to live with his lowly attitude.
BTW, Thanks for the vote.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: Ah! I never knew that posting a good answer would get me a 1 vote
Its not only for you its for some members.
|
|
|
|
|
Like - I belong to some kind of a special members group?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi Friend,
You should try this trick :
There are several tricks for making programs that are in one way or another able to delete themselves, without leaving any traces in the system.
One of the most wide-spread techniques, and also the one which is supposed to be one of the most platform independent (between Windows versions) is the following:
1.
Start the program you want to delete (EXE1).
2.
From this program, drop a second exe file (EXE2).
3.
Open a file handle to EXE2 from EXE1, using CreateFile, with the flag "FILE_FLAG_DELETE_ON_CLOSE".
4.
Execute EXE2 from EXE1 (e.g. with CreateProcess), causing the operating system to open another file handle to EXE2.
5.
Let EXE1 exit and terminate (which will implicitly cause its filehandle to EXE2 to close, leaving only the operating system's filehandle to EXE2 left open).
6.
EXE2 waits for EXE1 to terminate, and as soon as it detects this, it deletes EXE1 from disk.
7.
After successfully deleting EXE1, the job of EXE2 is complete, and it exits and terminates, causing the operating system's filehandle to it to close.
8.
The general concept and idea is now that EXE2 should immediately be deleted upon this closing of the last open file handle to it. This is also a seemingly correct assumption, especially when you read the entry for the "FILE_FLAG_DELETE_ON_CLOSE" flag of the CreateFile API in the Win32API reference
Or you can visit the following link :
http://www.woodmann.com/forum/archive/index.php/t-4542.html
Have a Good Luck...
Jagdish Bhimbha
S/W Developer
|
|
|
|
|
Jagdish V. Bhimbha wrote: Open a file handle to EXE2 from EXE1, using CreateFile, with the flag "FILE_FLAG_DELETE_ON_CLOSE".
This does not work on all platforms. Sometimes CreateFile() will return INVALID_HANDLE_VALUE and GetLastError() will return ERROR_ACCESS_DENIED . This is because the OS supports the ability to share a file with delete access.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
If you want to delete the folder after deleting the files.
You this syntax.
_wrmdir(dirname );
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
VCProgrammer wrote: my problem is it deletes all the file from the folder but leaves itself and the folder there only.... how can i delete it.
Since your exe is running, it could not be deleted. Better mark it for deletion after next reboot. You can use the api MoveFileEx() with flag MOVEFILE_DELAY_UNTIL_REBOOT . Check here for the code snippet - http://weseetips.com/2008/05/19/how-to-mark-your-file-for-deletion-after-next-reboot/[^]
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hey guys, I can't seem to figure out my problem trying to print out the data to the tcp packet. Please, someone help me out.. I've been searching the internet, trying to find something in the Wireshark source, I'm lost and confused... If you want the full source, please say something. Thanks!
typedef struct IP_Address
{
u_char byte1;
u_char byte2;
u_char byte3;
u_char byte4;
} ip_addr;
typedef struct IPv4_Header
{
u_char ver_ihl;
u_char tos;
u_short tlen;
u_short id;
u_short flags_off;
u_char ttl;
u_char proto;
u_short crc;
ip_addr srcaddr;
ip_addr dstaddr;
u_int opt_pad;
} ipv4_hdr;
typedef struct TCP_Header
{
u_short srcport;
u_short dstport;
u_int seq;
u_int ack;
u_char offset;
u_char reserved;
u_short window;
u_short crc;
u_int opt_pad;
u_char data[65535];
} tcp_hdr;
for (;;)
{
CErr = pcap_next_ex(edev_open, &pkt_header, &pkt_data);
if (CErr == -1)
{
cout<< "Encountered an error while reading!\n";
pcap_close(edev_open);
return 0;
}
switch (CErr)
{
case 0:
{
break;
}
case 1:
{
ih = (ipv4_hdr*) (pkt_data + 14);
th = (tcp_hdr*) ( (u_char*)ih + ((ih->ver_ihl & 0xF0) * 4) );
break;
}
case -2:
{
cout<< "End of Dump File!\n";
break;
}
}
}
|
|
|
|
|
|
Hi,
Im OnTImer(), i use the values stored in structure ,but when timer is on..it shows correct value but i invoke another timer in dialog,after sometime,,,First timer gets wrong value from structure. How its possible..THis is my code..
STRIG CirTab[] = { // circle sin, cos, table
{ 0, -7999 },
{ 836, -7956 },
{ 1663, -7825 },
{ 2472, -7608 },
{ 3253, -7308 },
{ 3999, -6928 },
{ 4702, -6472 },
{ 5353, -5945 },
{ 5945, -5353 },
{ 6472, -4702 },
{ 6928, -4000 },
{ 7308, -3253 },
{ 7608, -2472 },
{ 7825, -1663 },
{ 7956, -836 }
};
OnTImer code has
LineTo(hDC, clockCenter.x + (INT)(((LONG)(CirTab[pos].sin) * (radius)) / CLKSCALE),
clockCenter.y + (INT)(((LONG)(CirTab[pos].cos) * (radius)) / CLKSCALE));
THe bolded varaible get correct value until the second timer (Dialog timer) getinvoked .Here 'pos' is seconds in time.
At First second it get value of { 0,-7999 } but second timer inviked after some time it shows then values as {12245,23452) but its not present in CirTab[].
Whats the reason??Pls..any suggestion??
Anu
|
|
|
|
|
Anu_Bala wrote:
LineTo(hDC, clockCenter.x + (INT)(((LONG)(CirTab[pos].sin) * (radius)) / CLKSCALE),
clockCenter.y + (INT)(((LONG)(CirTab[pos].cos) * (radius)) / CLKSCALE));
Anu_Bala wrote: Here 'pos' is seconds in time.
So you are accessing the array by using pos which is in seconds. But in the array you have less than 15 members and if the seconds go beyond 15 it will access from outside array which gives you a junk value thats not present in array. In summery you're accessing out of array.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Tuesday, June 17, 2008 1:04 AM
|
|
|
|
|
Actually my array contains 60 members.For here just i post only 15members for your reference.Sorry for thsi confusion.
Anu
|
|
|
|
|
1) Could you check whether the pos goes out of index?
2) Check whether your array values are getting updated by some bad code. Watch the array when you've the error.
Could you post the code snippet?
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
No, pos shows only between 1 and 60 only.
Arrays doesnot get changed and also the array is not used in sometoher place, used only in this line.
My code is to draw seconds needle in clock image.
DrwaHnad function is called in OnTimer()
DrawHand(register HDC hDC,INT pos,HPEN hPen,INT scale,INT patMode)
{
INT radius;
MoveToEx(hDC, clockCenter.x, clockCenter.y, NULL);
radius = (INT)(((LONG)clockRadius * scale) / 200);
SetROP2(hDC, patMode);
SelectObject(hDC, hPen);
LineTo(hDC, clockCenter.x + (INT)(((LONG)(CirTab[pos].sin) * (radius)) / CLKSCALE),
clockCenter.y + (INT)(((LONG)(CirTab[pos].cos) * (radius)) / CLKSCALE));
}
Array is..
STRIG CirTab[] = { // circle sin, cos, table
{ 0, -7999 },
{ 836, -7956 },
{ 1663, -7825 },
{ 2472, -7608 },
{ 3253, -7308 },
{ 3999, -6928 },
{ 4702, -6472 },
{ 5353, -5945 },
{ 5945, -5353 },
{ 6472, -4702 },
{ 6928, -4000 },
{ 7308, -3253 },
{ 7608, -2472 },
{ 7825, -1663 },
{ 7956, -836 },
{ 8000, 0 },
{ 7956, 836 },
{ 7825, 1663 },
{ 7608, 2472 },
{ 7308, 3253 },
{ 6928, 4000 },
{ 6472, 4702 },
{ 5945, 5353 },
{ 5353, 5945 },
{ 4702, 6472 },
{ 3999, 6928 },
{ 3253, 7308 },
{ 2472, 7608 },
{ 1663, 7825 },
{ 836, 7956 },
{ 0, 7999 },
{ -836, 7956 },
{ -1663, 7825 },
{ -2472, 7608 },
{ -3253, 7308 },
{ -4000, 6928 },
{ -4702, 6472 },
{ -5353, 5945 },
{ -5945, 5353 },
{ -6472, 4702 },
{ -6928, 3999 },
{ -7308, 3253 },
{ -7608, 2472 },
{ -7825, 1663 },
{ -7956, 836 },
{ -7999, -0 },
{ -7956, -836 },
{ -7825, -1663 },
{ -7608, -2472 },
{ -7308, -3253 },
{ -6928, -4000 },
{ -6472, -4702 },
{ -5945, -5353 },
{ -5353, -5945 },
{ -4702, -6472 },
{ -3999, -6928 },
{ -3253, -7308 },
{ -2472, -7608 },
{ -1663, -7825 },
{ -836 , -7956 }
};
Anu
|
|
|
|
|
Anu_Bala wrote: No, pos shows only between 1 and 60 only.
Array index starts from zero. Your pos is zero based index?
NB: While posting code, embed them in code block for better readability.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Initially i declared pos =0;
One question regarding forum:
In last answer u get one line from my post and asked question for that(grey line ).How u get that??
Anu
|
|
|
|
|