|
Hello friends
I am working with a SDI application in which i am drawing on the view.
Steps followed are:
CreateCompatible DC and Bitmap
draw in memory dc
stretch over the view
CDC which is Meomory dc is the global.
But on one of my testing computer XP without Studio installed,
1.0 It seems some of the things are not drawing, it just displays the blank screen.
2.0 Dialog boxes are not appearing.
WHAT CAN BE THE REASON for this?
I am trying this one with Release Mode build
Any suggestion, idea, help
Leave your mark wherever you go
|
|
|
|
|
ok say if you have a function:
BOOL CreateDialog();
that returns false if it fails.
in your code, you do
BOOL Create()
{
ASSERT(CreateDialog());
...
return TRUE;
}
since ASSERT doesn't do anything in release build (compiler ignores it), CreateDialog() doesn't get called. Maybe that's one reason y some of your system is failing... Hope i helped...
or, check your project settings. might discover something there.
|
|
|
|
|
Thanks for your prompt reply
Well problem here is something else.
in my view i am initialising the objevt of the dialog box, assigning its variables and then calling DoModal()
Next complete setup seems to work fine here in the Windows XP and 98 etc, with Visual Studion Installed. On the system where the XP without Visual Studio problems appears
i.e Dialog box doesnot appears
Things does not get drawn on the View, etc
What can be the difference between systems with & without studio installed.
What actually is required to display the dialog box when we are doing do modal?
Thanks again
Leave your mark wherever you go
|
|
|
|
|
Maybe the MFC dlls?
Check the dependecies of the exe with dependency walker and try copy those dlls with your exe
or try to statically link the exe
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
or maybe your computer is just having her period. wait a week and see.
|
|
|
|
|
Hi , i want to trim(srink) and expand windows from the left side , to give the sliding window effect(as one can find in winodws media player where sliding windows open up from both side on button clicks) , but the problem is it can easily be done from the right side, by changing the width attribute of window gradually ,as width attribute always change width from right side.
but how to do this from left side
so any body have any clue.
Unmanaged in a .NET world
|
|
|
|
|
Use SetWindowPos : move the window to the left and increase his size simultaneously. Use
SWP_NOCOPYBITS, SWP_NOREDRAW flags, this causes, that the client area won't be moved with the left border of the window.
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
Hi,
As you know Win32's SetTimer function can be setted with
interval time by 0x7fffffff msec.
But now I want to use more large interval
over 0x7fffffff to timer operation.
Anybody know such function or C++ class that enable me
to do it ?
Or can anyone tell me how to make such function/class ?
Regards
Takanobu Maekawa
|
|
|
|
|
Takanobu Maekawa wrote:
I want to use more large interval
over 0x7fffffff to timer operation.
trying to clock eternity
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
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
|
|
|
|