|
See here.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for the link. This works fine once the license expires. But, the user can work by changing the system date back to an allowed date before starting the application so that he never gets the license expired message. This way i think he can use the application for ever.
|
|
|
|
|
Check the article again. It works even if the user alters the system date. Read through the code and you'll quickly see how this is done.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello,
You could poll a server for the date / time and compare with that. You have to get around the unavailable internet connection problem though.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
I would like to show animation in my dialog.
I have the GIF file but I don't know how to show it.
Can anyone help me?
BTW - Does anyone know where can i find the animation which
Microsoft shows when files are being transffered from one place to another?
Regards,
Eli
|
|
|
|
|
|
Hi,
I'm trying to do some offscreen drawing. The usual teqnique is to go
CreateCompatibleDC
CreateCompatibleBitmap
SelectObject
...
but today I'm trying to create a memdc in the absence of a screen dc - so nothing to be compatible with. I guess I need to use CreateDC, but I can't put CreateDC(_T("DISPLAY"), NULL, NULL, NULL) because I don't want the drawing to appear on the display. Ideally I'd like to make a DC that simply prints into system ram (not video). Does anyone know how to do this?
Joel Holdsworth
|
|
|
|
|
|
Joel Holdsworth wrote:
but I can't put CreateDC(_T("DISPLAY"), NULL, NULL, NULL) because I don't want the drawing to appear on the display
Why can't you use that? You would use it as a basis for your own memory DC:
<br />
CDC dcDisplay;<br />
dcDisplay.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);<br />
CDC dcMem;<br />
dcMem.CreateCompatibleDC(&dcDisplay);<br />
Then you should be able to just draw into the new DC.
|
|
|
|
|
D'uh, yes that's the obvious answer. How supid of me. Thanks a lot!
Joel Holdsworth
|
|
|
|
|
Hi
I have developed a custom banner using CBannerStatic class and source file give at "http://www.codeproject.com/staticctrl/bannerstatic2.asp"
Now the problem is it terminates when I press ESC or spacebar. I want to use a different key combination to terminate, like say Ctrl+Alt+A or simply say "Ctrl + Q". For that I used OnKeyDown() and put the WM_KEYDWON event in message map but it's not working. I have also used OnChar() and same way WM_CHAR but still it's not working....
Any idea or any help how to overcome this ?
Regards,
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
I think you are using it in your dialog box. So all keys pressed go to the parent window. In this case it is going to the Cancel or OK button, so the application exits.
You need to handle your particular key combination e.g, Ctrl + Q etc for the main dialog using accelerators.
this is this.
|
|
|
|
|
Thankx for you kind response...But sorry to say that I m not been able to understand what you are saying exactly ....Can you please say it in more details plz...
Regards
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Can I see your code? Can you trace if OnkeyDown function gets called?
|
|
|
|
|
I don't mind if you want to see my code.....but where and how to send my code....can you plz give me u'r personal mail address so that I can send it over there....
And yes I have traced it but it never goes into OnKeyDown fuction.
Regards
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
My C++ program should call another program (GAMS), give data to it and then wait for the return data of this program. How do I do this in general or does anybody know how to do it with GAMS???
Thanks in advance!
|
|
|
|
|
We need to know a little more about this GAMS... is it a command line app? or a GUI app with an automation interface?
Joel Holdsworth
|
|
|
|
|
It is similar to Matlab I think... normally you have to open GAMS and you have to have a text file with all the information needed (in this case it´s a optimization problem...so you have a few equations and matrixes), and you tell GAMS "Solve it!" and the output data is put into another text file.
So I guess it´s a GUI, but my problem is that I don´t know whether it has an automation interface...boohoo...
|
|
|
|
|
try dropping the text file onto the icon for GAMS. If it opens up and runs, that means it will accept the name of the text file as a command-line argument. If this is the case, you could use ShellExecute() and just send it the path to the text file as an argument.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Joel Holdsworth wrote:
We need to know a little more about this GAMS...
Just a guess:
Guide to Available Mathematical Software
GPS Azimuth Measurement System
Genome Annotation Management System
General Algebraic Modeling System
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
See here.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I'm doing the excercise after the chapter about copy-constructor, Here's how it goes:
Create a very simple class, and a function that returns an
object of that class by value. Create a second function that
takes a reference to an object of your class. Call the first
function as the argument of the second function, and
demonstrate that the second function must use a const
reference as its argument.
And here's my implementation:
extern class A;
A fun1()
{
return A();
}
void fun2(A& a)
{
}
int main()
{
fun2(fun1());
}
I believe I've done exactly what the author has described, but It seems fun2(...) doesn't have to take a argument of const reference and compiler doesn't complain too!In addition what's the effect of calling A() inside fun1(...) instead of
A a
return a;
|
|
|
|
|
I think the question (from your book) is somewhat unintuitive. I think what it wants is for you to modify a member of A inside fun2(). You'll lose that change/value because your passing a temporary variable, but passing a temporary variable is fair game because it has an lvalue.
A a;
return a;
is the same as
return a();
The latter combines the two lines into one by using a temporary variable. I believe most compilers will produce the same code. They both go on the stack temporarily.
|
|
|
|
|
extern class A;
A fun1()
{
return A();
}
void fun2(A& a)
{}
int main()
{
fun2(fun1());
}
I think specify fun2(...) argument as a const reference make sense. Because when the call to fun2(...) is made the compiler has to generate a temporary object in order to hold the object returned by fun1(...), and this temporary object default to const!But somehow compiler doesn't complain!
Mark Petrik Sosa wrote:
A a;
return a;
is the same as
return A();
is "return A();" just a call to the constructor?
|
|
|
|
|
Hi guys hopefuly someone will be able to help.
I need to open a file for reading but this file is already open by another application for writing.
I have tried playing around with the flags in CreateFile but have still not succeeded.
Does anyone know how to do this?
|
|
|
|