|
plz kindly help me
#sanroop#
|
|
|
|
|
look at the Shell_NotifyIcon() API. You can add an icon, then later modify it using this API.
|
|
|
|
|
Hi all,
I have flicked through the examples here on CP but not really found what I want. I'm looking for code examples/thoughts/ideas on the following:
1. Self modifying code
2. Self detecting if exe has been copied
3. PC serial numbers (anything unique to a single computer)
Maybe it is impossible but I am trying to develop 'full version' exe that will revert back to a 'demo version' if copied to another machine.
|
|
|
|
|
waldermort wrote: 2. Self detecting if exe has been copied
Not possible as far as I know.
waldermort wrote: 3. PC serial numbers (anything unique to a single computer)
Even if you were to take the HDD's volume/serial number, what would happen if my HDD crashed and I got everything restored to a new HDD? The software would detect that something is different and stop working. I'm not sure how to effectively handle this.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
waldermort wrote: 1. Self modifying code
You can do this in Assembly, which is more fun than C++ anyway.
Good luck with it
Joe Q
|
|
|
|
|
waldermort wrote: 1. Self modifying code
2. Self detecting if exe has been copied
the only thing i can think of is using resources, reate some kind of CRC em embedd it in a resource (ex: image)
However this is easy to crack
waldermort wrote: PC serial numbers (anything unique to a single computer)
Network card adapter number (MAC address)?
People could allways change the card from one PC to another, but the software only works wher the card is.
|
|
|
|
|
Thanks for all the ideas everybody. This project is just something I would like to try in the near future. I guess I have a bit more reading to do before I make a start.
|
|
|
|
|
Hi all,
I have explored the MSMQEvent in VC++. But i can't get a Clear Picture, which is used to Capture the Arrival of any Message from the End User to invoke the MSMQ Service.
I want an example on MSMQEvent, Not all other stuff on MSMQ. please help me out.
Uday kiran
|
|
|
|
|
I want to set the menu bar to be ticked or not to be ticked by code. How to do it...
Photo[^]
|
|
|
|
|
|
DWORD CheckMenuItem(HMENU hmenu,
UINT uIDCheckItem,
UINT uCheck
);
what is HMENU hmenu?
|
|
|
|
|
mimimimilaw wrote: what is HMENU hmenu?
Its handle to menu,
Have you seen this example
|
|
|
|
|
|
<br />
(1)<br />
HMENU hmenu=::GetMenu(m_hWnd);<br />
CheckMenuItem(<br />
GetSubMenu(hmenu,0),ID_FILE_OPEN,MF_BYCOMMAND|MF_CHECKED);<br />
---------------------<br />
(2)<br />
CMenu *menu=GetMenu();<br />
CMenu *menu22=menu->GetSubMenu(0);<br />
menu22->CheckMenuItem(ID_FILE_OPEN,MF_BYCOMMAND|MF_CHECKED);<br />
<br />
|
|
|
|
|
Hai,
plz help me ,
1) i want to design a program that should calculate's the objects in a class.
in which way i design that problem .
plz help
-- modified at 5:21 Monday 14th August, 2006
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
U r looking for objects in a class or objects of a class? If it is the later, ie how to track the the number of objects created for a class, u can use below demo.
class InstanceCntDemo{<br />
<br />
private :<br />
static int nCnt; <br />
public:<br />
InstanceCntDemo(){<br />
nCnt++;<br />
}<br />
static int GetCnt()<br />
{<br />
return nCnt;<br />
}<br />
};<br />
int InstanceCntDemo::nCnt =0;<br />
<br />
int main(){<br />
<br />
InstanceCntDemo ic;<br />
InstanceCntDemo ic1;<br />
InstanceCntDemo ic2;<br />
InstanceCntDemo ic3;<br />
<br />
int nCnt = InstanceCntDemo::GetCnt(); <br />
};
Does this make sense?
Cheers MiltonKB.
|
|
|
|
|
Thanks Mr.MiltonKB.
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
Dear all,
I had one MDI application and I want to limit its execution to single instance.
I had tried source code from lots of articles (i.e Newcomer's, Naughter ...Armen...)
it will work ...but while closing the second instance it raises an exception ...
Abnormal program termination!!!
This exception generated from "WinMain" when the
"pthread->ExitInstance()" get called...
How can I solve this ?
I am using Windows XP SP2 .....and VC++ 6.0
Thanks in advance......
-- modified at 5:17 Monday 14th August, 2006
vinsankar
|
|
|
|
|
how you are limiting its instances ?
|
|
|
|
|
|
I tried first link only. But cant get second instance.
Can you explain it in detail?
|
|
|
|
|
Hi ,
How will u get second instance?
those articles tell u abt preventing the second instance from running when there is already one instance running on ur desktop....
ok.........
vinsankar
|
|
|
|
|
There are no direct APIs or functions to identify which is second instance or third instance and so on.
Why do u need second instance?
What exactly is the problem u r facing?
If something is crashing in the ExistInstance in the second time, you have to find out which statement is crashing.
It may be because, u r trying to access an un initialized variable there which may get initialized in the first instance as InitInstance will execute completely in the first instance.
But in the second instance you may bypass those initializations and exits after the 'previous instance' checking. Then when control reaches ExitInstance it will crash as what ever u r accessing is not initialized. Just a thought. chk it out.
Cheers..Milton KB.
|
|
|
|
|
Hi,
Sorry.......
I don't need the second instance......I want to prevent all other instances while one is there..
then.....
I fix it .....
I made a mistake in the "return statement" after finding the previous instance of that program in the 'InitInstance()' of my App class.
I was written like this...
BOOL CMyApp::InitInstance()
{
if(IsthereApreviousInstance(....GUID))
{
AfxMessageBox("Already one Instance");
return FALSE; // This is wrong
}
}
The above code will work but an exception will raised...
So I put it like this....
exit(0); // in place of "return FALSE"
Ok.............Thanks....to all
vinsankar
|
|
|
|
|
When the first instance starts execution, the very first thing it should do is check for a mutex, if not found it should create one. When the second instance starts, it should check for the mutex, when it finds it it should terminate.
Look at the CreateMutex() and GetLastError() functions.
I'm not sure where to do this in MFC, but in Win32 these routines are the first to be executed in WinMain() . Also note all of this should be done before creating/reading any other variables.
I have a header file containing all these functions and a few more like handling Command line paramaters, and handling MultiUser/MultiDesktop environments. (A modified combination of CP examples). If you like I will send it to you.
|
|
|
|