|
you can try GetSystemTime() , or this MSDN article
TOXCCT >>> GEII power
|
|
|
|
|
you can set up a counter and count it down, everytime your timerFunction get called.
and when the timer got 0 you can perform the
action, that needs this REALY long interval.
|
|
|
|
|
I'm curious why you are after a timer that "fires" once every 24.8 days.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am not being able to compile the directx codes downloaded from this site or from the msdn help. the compiler(VC++ 6.0) can not recognize the LPDIRECTDRAWSURFACE7 OR LPDIRECTDRAW7.
what may be the reason?plz provide me the solution.
-babai
|
|
|
|
|
Did you download the directX 7.x SDK?
in case you did you need to add the path under tools->options->directories if its not automatically done for you by the installer
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi !
I'm facing a simple problem but couldn't find any clear answer on the net.
I have a class B which is derived from class A. I want to write a copy constructor for class B. In the copy constructor of class B, I copy each member of class B, and I thought that the default copy constructor of class A would be automatically called, which apparently is not the case.
How do make sure the copy constructor of the base class (and of the whole hierarchy) is called ?
Thanks for your help !
Jerome
|
|
|
|
|
// copycons.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class Base
{
public:
Base(){cout <<"\nBase called";}
Base(const Base&){cout<<"\nCopy of based called";}
};
class Derived : public Base
{
public:
Derived(){cout<<"\nDerived called";}
Derived(const Derived& D):Base(D ){cout<<"\nDerived copy con called";}
};
int main(int argc, char* argv[])
{
Derived d; // default constructor of base and derived will be called
cout<<"\nnow copying const for bot-----------------------------------";
Derived d1=d;
return 0;
}
--------------------------------------------------------------------------
output
Base called
Derived called
now copying const for bot-----------------------------------
Copy of based called
Derived copy con called
Press any key to continue
|
|
|
|
|
// copyCons.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream.h"
class base
{
int k;
public:
base(int j=0)
{
k=j;
}
base(base &b)
{
k=b.k;
}
void putdata()
{
cout<
|
|
|
|
|
you have to specifiate it before the body of your function (in its header) :
<font style="color:blue;">class</font> A : <font style="color:blue;">public class</font> B {
<font style="color:green;">
<font style="color:blue;">public:</font>
A (<font style="color:blue;">const</font> A&);
<font style="color:green;">
}
A::A(<font style="color:blue;">const</font> A& refA) : B(<font style="color:green;"></font>) {
<font style="color:green;">
} in fact, the " : B(/*...*/)" expression represent an explicit call to the Base class constructor, so you can now be sure that it is called.
TOXCCT >>> GEII power
|
|
|
|
|
Hello all,
How shall i use a DLL which is created using WTL & ATL in general MFC applications.
Is it possible to do so?.
ComputerNewton
|
|
|
|
|
http://www.codeproject.com/atl/atl_control_with_mfc.asp
|
|
|
|
|
I'm currently working on a I/O card project that is connected to the USB port. On this card are various I/O proprietary ports and a RS232 serial port. I need to create a driver that install a virtual COM port in the PC Windows OS, eg COM9, such that when OS open and sends data to this virtual COM port COM9, it is redirected by the driver through the USB port to the I/O card's serial port. Is this possible and how do i create a virtual COM port and redirect data to the USB port?
|
|
|
|
|
Yes it is possible. At about £1000 per day you could probably get a driver written for you!
Ant.
|
|
|
|
|
When I create thread and the at some part of the dialog or toolbar or anything I am drawing the things go well, It has to go well. But when I press Atl-Ctrl-Del(i.e I lock the computer) it stops drawing and after I release from locked state to normal state it dosent get the Handle to Device HDC and it stops painting. If any one encounter such problem, what should be the solution.
I have applied three different methods to solve this technique and it works but I am not satisfied. If I am unfortunately wrong , do let me know.
1) Before I entered The loop I write SaveDC(HDC) and when I am in loop of painting I check for locked state and I write RestoreDC(HDC,handle), it works but there is handsome memory and GDI leaks…It need to free the prev font and create font again and other init procedure
2) I write try ..throw catch and have to wait (Sleep(1) )for un-necessay time to keep on checking if I am getting HDC using GetDCEx(…); still it need to recreate font and other init once again.
3) This works if any one is stucked, without any leak
What WinXP does is it lock the window, so we cannot draw, the error code we get is GetLasterror=5 ie Access Denied.. and in that loop if we Write ::MessageBox(0,”Your message goes here”,”Error”,0); and don’t do the previous sucks…it again starts painting and any new cleanups and initializations…
Here my code goes
CreateFont(…)
GetDCEx(…DCX_LOCKWINDOWUPDATE)
While(EndTheLoop) // end the loop is 1
{
.
.
//example if I am drawing line or scrolling text
While((::TextOut(hdc,”Text”,5…)==0)
{
Sleep(1) //similarly for other HDC I keep on checking and sleeping
}
I am trying it in ATL Tool Bar and SDK Dialog Drawing, It works on win9x/2000 and dosent work on XP
Any other wise solution will be acknowledge
|
|
|
|
|
1. I am working out a similar issue with fast user switching problems. I use the WTSRegisterSessionNotification to know when the session is going to be/is locked and unlocked.
2. There is some vague recommendation in the terminal services and fast user switching (FUS) documentation mentioning that you should draw to a memory DC and then blit onto the screen. Maybe you cna keep a memory DC for your window, draw into it, and only do the blit really fast once your 'drawing' is done?
3. The Sleep call may be the problem ... from MSDN "You have to be careful when using SleepEx and code that directly or indirectly creates windows. If a thread creates any windows, it must process messages. Message broadcasts are sent to all windows in the system. If you have a thread that uses SleepEx with infinite delay, the system will deadlock. Two examples of code that indirectly creates windows are DDE and COM CoInitialize. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than SleepEx."
4. If you respond to the WTS_SESSION_??? messages, maybe you can invalidate your window when you see the appropriae message and then your repainting will be fine.
I think you should respond to WTS_SESSION_??? messages and avoid all draing if you are disconnected or locked out. Then you can redraw if your are connected or unlocked. If you get the lock and disconnect messages, you can also free your GDI resources to avoid the leaks.
|
|
|
|
|
Hi,
Blake Miller
Thanks a lot for thorough explanation.
regards
Balkrishna Talele
|
|
|
|
|
Hi i am working on a MDI application, and would like to implement a Visual Studio .NET dynamic help-style help pane (dockable) into my application. I am using BCG Pro for most of the GUI work (including the dockable control bars), so is there any libraries, APIs, or classes that could do this easily for me? Or should I just code up my own CHM viewer pane by myself? thanks in adv.
|
|
|
|
|
I need to make a source code file using C++ in order to make the game Reversi or Othello work
|
|
|
|
|
What do you mean make? do you mean you have a file and want to make it into a binary or that you want to write source code?
If it's the latter, you'll find a great reference[^] on CP. It's written in C#.
Or you can google.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Hi all,
I have two options, one is encapsulate my functions as a DLL, the other
is exports them as a DLL. Can anyone compare .lib with .dll? what are the
advantages and disadvantages of the both? So far, I know how to make DLL however, no idea how to make a lib file? any suggestions?
Thank you
David
|
|
|
|
|
.lib are statically linked to the EXE
in the VC++ new project screen choose win32 satic link library.
|
|
|
|
|
If there is ever-such a thing, that now i believe there can be, it can happen to writers/publishers (Getting Writers Block)... but how do i ever recover from this? its been going on for 1 Year now, and its stressing me out, I want to write a specific Code, and its in my head.. then.. i get at the key-board.. and it dissapears... like in a instant... i wonder if its Adult ADHD??? HAHAHAHAAHAHAAHAHA.. seriously now.....
|
|
|
|
|
add more RAM to your brain. hehe.
|
|
|
|
|
|
Thats a good one, i like it
|
|
|
|