|
LookUpAccountName
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
I want to put a version of my app on my website that will allow someone to install and use the app on their machine for a limited time for evaluation purposes. Has anyone had any dealings with this and if so, how would I go about doing that?
|
|
|
|
|
Personally, I hid a file amongst the system directory, and used it in conjuction with a registry entry to fail after a month, and to fail if anyone tried to play with the registry or reset their system clock.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
fail if anyone tried to play with the registry or reset their system clock.
I know that it is possible to use RegNotifyChangeKeyValue() to monitor changes in a particular registry key. But even this does not work if they key is deleted. Am I right?
But how can I find out if someone has reset the system clock? Is there a similar function for this? Or would I have to write my own? If so, could you please give me any hints as to how to go about it?
Thanks very much.
Regards,
Rohit Sinha
|
|
|
|
|
By hiding the information elsewhere on the computer, so that if your program is run and the clock has gone back more than an hour since the last time, they changed it. You would also store the registry information there - the registry would be a smokescreen for your real, hidden system.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
it's very difficult to do this 100%... but, as a first try:
1. when your program starts, look in the registry for a key that your app would have created, if it has already run once. if the key isn't there, create it and add a DWORD value. set that value to the result from time().
2. if the key is there, get the value from the registry, get the current time, compare the two.
3. expire if difftime > X
that's a very basic way to do it. it's easy to beat, by just deleting the registry key or changing the system clock. but, if you don't think your customers are that sophisticated, this might be enough.
you can get much more complex, from here.
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
|
Hi, everyone!
Please look at the following statements,
--------
static void default_failure_notify(const char *);
void (*failure_notify) (const char *) = default_failure_notify;
--------
I think failure_notify stands for a pointer of a function,
whose return type is void and parameter list is (const char *).
Am I correct?
Cheers,
George
|
|
|
|
|
George Ma wrote:
Am I correct?
yes.
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
Thanks, pal!
You help a lot.
Cheers,
George
|
|
|
|
|
i want to send a function pointer to the dll so that dll could call my current application function?
let suppose
void add (int a,int b);
i want to send its function pointer to dll,so that it can be called in dll ?
is it possible ?
can any give the syntex of this example?
r00d0034@yahoo.com
|
|
|
|
|
declare a typedef somewhere
typedef void * (CALLBACK* MyCallbackFunctionType)(int a, int b);
in your DLL, have a function that accepts a function pointer as a parameter:
void SetCallback(MyCallbackFunctionType pCallback)
{
if (pCallback)
pCallback(a, b);
}
define the callback function in your app:
void CALLBACK MyCallbackFunction(int a, int b)
{
int c = a + b;
TRACE("%d+%d %d\n", a,b,c);
}
in your app:
SetCallback(MyCallbackFunction);
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
i want to creat a dll in my startup project's Dbeug directroy while compileing a dll sub project.
who to do it because i have seen many example but i could not understand?
r00d0034@yahoo.com
|
|
|
|
|
Go to your project settings for teh sub DLL, and click the general tab
then there is an edit box for your output files, simply change the directory from debug to the directory where you want it to go.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have an MDI app using CEditView in the Doc/View architecture. In this view, I have a function like so, which I call from the Document class:
void CMyEditView::addText(LPCTSTR szOutput)
{
ASSERT_VALID(this);
int nSize = GetBufferLength();
GetEditCtrl().SetSel(nSize, nSize, TRUE);
GetEditCtrl().ReplaceSel(szOutput, FALSE);
}
After feeding it data for a while, the program inevitably crashes and the display gets corrupted. By watching the executable's resources in Task Manager, I notice that the GDI Objects are steadily increasing, until they reach 9999, and then the crash happens. By setting breakpoints, I can see that one GDI Object is consumed every time CEdit::ReplaceSel() is called, and never released.
Is this method for appending text to an Edit Control contained in a View appropriate? Anyone know a better way? Using GetWindowText() and SetWindowText() has the same problem! Any thoughts as to what's happening, and how I can prevent the resource loss?
Thanks !
scott sanders
|
|
|
|
|
I created a simple MDI application as you described and - using the same code you wrote - the GDI objects are changing between 31 and 32. It looks ok.
Where is that szOutput coming from?
rechi
|
|
|
|
|
Thank you for your reply !
After experimenting a bit more, I found out that the resource leak was actually coming from my CMyView::CtlColor() function. I was allocating a brush to change the background color of the window, depending on the program state, and never releasing it. So it was my silly fault all along; sorry to send you on a wild goose chase. I changed the brush to be static, and the problem disappeared.
Thanks again for looking into this for me.
scott
|
|
|
|
|
Intersting case, it teaches me a good little lesson.
I thank you too!
rechi
|
|
|
|
|
k i have no complaints. i have gotten this to work, but i am wondering if i may be missing anything. the only thing that changes a console based program to a windows based program is the entry point function. main vs WinMain...?? and the settings for the subsystem "windows(/Subsytem:Windows)" ?? is there anything else i should know about the entry point?
~xai~
|
|
|
|
|
That's about it AFAIK. You're hoping to write Win32 API programs, as opposed to MFC ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
yeah im developing win32 API programs... i first started with MFC and then i realized that they were just all wrapper classes. I recently bought my first sockets programming book and am extremely interested in the potential to write some pretty cool programs.. and i do know that visual c++ has wrapper classes for sockets but it is making more sense to me, knowing what is happening behind the scenes. Thanks..
xai
|
|
|
|
|
My MFC app calls a custom dll function. At various intervals I want this dll to send back some information to the calling app.
How does one do this? For example, after the dll finishes step1, I want it to send back an integer and a string to the MFC app, then after step2, another pair of int, string to the calling app etc.
If I grasp the mechanism, I can implement it hopefully in my application. The dll unfortunately is in VB so thats a complication, but the notion first, then the implemenation...
Thank,s
ns
Thanks,
ns
maybe relevant: I get to this dll by doing a #import in my VC app.
|
|
|
|
|
there are many ways to do this:
you can pass a reference or pointer to a C++ object from your app to your DLL that your DLL can call a member function on, to signal events.
or, if your DLL doesn't export C++ symbols, you can use a "callback" function, which is just a function pointer that the DLL can use to call a function in your app.
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
My dll is in VB. I am following your ideas above, and dont know how to find out about if my dll can export C++ symbols.I need more info on callback functions. Do these have a particular format? Can you please point me to links where maybe this is done...or explained further? I feel encouraged that it can be done. I was losing hope and thinking I'd have to launch the progrssbar UI from the dll itself, instead of in my VC UI status bar.
Thanks,
ns
|
|
|
|
|