|
I guess I don't fully understand.
I've got my timer around my render function so it only renders if the time is more than a certain value. What exactly do you mean give the relative or absolute time to the "sine wave" function? Also what would I use to calculate my angular velocity and my movement vector?
I think I'm starting to understand, thanks a lot for you help.
j
|
|
|
|
|
Well, its advanced to me anyway.
Included is the link to download the sample project and exe (Translucent_Test.exe) (too large to upload here - ~ 700k)
Run the exe to see the flickering problems.
1) The Side Nav Window will close and open with a mouse click - works fine.
2) The Top and Bottom Button (with the little arrow) scroll the buttons in this window vertically - too much flickering.
I have tried InvalidateRect, regioning, screaming, drinking, smoking, to no avail.
I'm not too worried about the sizing issues at the moment as this is just some test code. The painting issues are the major problem.
Critism is welcome, as it usually leads to a solution.
Look at the SsScrolled() method. This method is called everytime the buttons are moved up or down.
http://www26.brinkster.com/wzedx2/b...lucent_Test.zip
Any help would be appreciated.
Thanks.
PS: if the link does not work, please cut and paste into a new browser session.
|
|
|
|
|
Sorry, the link is
http://www26.brinkster.com/wzedx2/bin/Translucent_Test.zip
|
|
|
|
|
sprintf(statusMessage, "Stopped");
SendMessage(statusControl, SB_SETTEXT, 0 | 0, (LPARAM)statusMessage);
The following two lines of codes is what I used to update the status bar control. But only the first text was displayed. Others just doesn't get updated. Anyone have any solution? Thanks in advance.
|
|
|
|
|
|
Hi everybody : ). I took a short brake from visiting The Code Project since I was very busy with the project some of you know I'm working on. That is, a freeware. I'm pretty close to completion and hopefully in a few months you'll all have the opportunity to use a very nifty and usefull little application : D. For free. 'cause I am doing this out of pleasure, like you are helping here. I like to consider this my little gift to all the people that help and to the internet community in general.
However, we're not living in Paradise, so we run into all sorts of problems. What happens is that I got myself into one such problem : |.
The issue is that I want to use GDI to draw something in a Window. Draw something in a Window, by taking THAT SOMETHING from another window. Using getDc and bitblt that is : ). All fine so far... until I use ShowWindow to hide the window.
Of course, I don't want my original window (the one I'm copying the stuff from) to be visible. But the problem is that after I hide it, bye bye bitblt. Bitblt uses X and Y coordinates to *know* from where to take its stuff. So if I hide the window, the function just copies whatever I got on screen at that location. Pretty frustrating huh?
I guess I could use GDI function to draw text and colors directly???? I don't know how. I don't want to go there. It's too complicated for what I need. Because I may want to include bitmaps and stuff. So people... my question is... how can I bitblt from a hidden window? : ). 'cause frankly, if I nail this problem, I'm gonna be one step closer to my goal.
I don't think that I need to mention that I thank all of you for being here and helping people like me. Two months ago I was a newbie to VC++, now I began to find my way around. But there are still tricks which escape me.
Thank you in advance.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Have a look at WM_PRINT / WM_PRINTCLIENT.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Well .. first off one quick question. Why no MFC?
Anyways, try Bitblt()ing all the stuff you need to draw to your window into a seperate backbuffer, or a second backbuffer if you're already using one, then you can always have a copy of whatever it was that was drawn no matter what's currently in there.
Just an idea tho.
J c0dex
|
|
|
|
|
Thank you both PJ Arends and jc0dex for answering so soon : D.
I didn't yet check out PJ's answer, but I do have a question for you both, and something I forgot to mention!
The window that I want to draw from (the original window - the one that I wish to hide) gets repainted every second. So practically, things are going on there. Every second something changes in it.
So I don't know if a backbuffer might help. Are you talking about the stuff that I can get from using CreateCompatibleDC?
Sorry for leaving out this detail. The fact that the window changes complicates things. I don't even know if Windows really changes it... because this window (the original window) will always be hidden. There are two labels on it which change every second indicating a text. Or maybe I'll put a series of bitmaps that change one after the other. This is the real issue.... I would draw directly in the source window... but what if I want to take more complex elements from the original window? Like a bitmap, a gif or even other more complex things. This is why I need a support window, to copy the stuff from. It's difficult drawing directly with GDI.
So... I can only use GDI... and I don't know if it'll work with a window that keeps changing its data every second and it's also hidden with ShowWindow.
Hm : |.
Oh, and what was that about MFC? What does this have to do with anything? : ). Excuse my lack of knowledge.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
MFC stands for Microsoft Foundation Classes, which is "the" way to program windows applications nowadays. If you're doing anything complex as far as interaction, saving / loading data, or windows common controls and dialog boxes, just to name a few, MFC is a much easier way to go about doing these things.
With the MFC you could literally copy the info from one window to another with a couple commands, whereas with standard Win32 programming it would be much much more involved and complex.
MFC makes complex tasks in Win32 as simple as a function call in some cases.
Once you get into DirectX and OpenGL they use basic Win32 functions and operations, so knowing the basics of Windows programming before MFC is almost essential if you plan to continue learning languages.
There is endless information on the MFC out there these days, if you would like some direction on where to get started I've included some resources below.
I hope this helps a little.
j c0dex
|
|
|
|
|
MFC Resources:
http://www.codeguru.com/Cpp/Cpp/cpp_mfc/tutorials/article.php/c759/
http://www.techtutorials.info/mfc.html
http://www.functionx.com/visualc/
http://www.coin3d.org/windows/tutorial/tutorial_03/
|
|
|
|
|
Thanks jc0dex for the resources : D. I know what MFC means and I know some stuff about it. I also know message systems very well, and how Windows works, since I used a lot of types of hooks and DLLs with hooks. I didn't understand where does MFC fit into all of this.
Do you think that I can use bitblt / some function to copy the contents of the window even if its changing from second to second and it's hidden??
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Wow I was totally off base, I thought you were less experienced than you are, I apologize.
What EXACTLY are you using this copying over concept for ... maybe if I knew what you were trying to complish this for I could come up with an alternate solution, but don't know why you would want to do that at the moment.
|
|
|
|
|
No problem. I'm not that experienced but I not as beginner either : D.
Trust me, I tried all the possible alternatives. GDI is the only way to go. I'm trying to tamper with a particular window from the operating system which is very very rigid. That is, the clock window. I want to overwrite its contents with something made by me. So I have a window, the source, that contains some stuff that I want to put in that systray clock window. You can imagine now, why I want to HIDE the source window, my window.
I am almost certain that I can do this by drawing a DC with GDI directly in memory. That's possible right? Drawing something virtually and then just copying over the systray clock. I don't know how to do that either but I think it's possible.
But definetely, the best solution would be to be able to take stuff from my already-made window and dump it in the systray clock window : D. That would be cool 'cause my window already contains everything nicely formatted, and I wouldn't be forced to start re-inventing the wheel, that is, drawing everything again using GDI.
Also, the contents of my original window changes constantly, every second to be exact. That's the real problem : ). After I hide it, I need to refresh the systray clock's aspect from that window of mine. And bitblt only copies whatever is on screen at the X and Y coordinates with Z and W width. Annoying. So if my window's hidden, bye bye bitblt.
So far I did everything with API. I don't want to use MFC... it makes your life easier but it's not mandatory to use it. API is just as cool. I want to make this as small and as portable as possible. Anyway, you got the picture I guess... in the meantime I'm making all sorts of experiments with this issue.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
hii guys how r u all im with the visual c++ and i need ur help i need to upload file frm pc into adatabase if anyone can help it will be gr8 thanks anyway
|
|
|
|
|
haes wrote:
frm pc into adatabase
Hello There,
Could you tell me where exactly your database situated? secondly,Could you please mention the name of database?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
first thanks for replaying
the files will uploaded frm pc of a client into a server database (MyDataBase)
|
|
|
|
|
Hello Mr Haes,
If your database reside on Internet/Intranet Based Server you have to make Three Tier application.
i.e.
Your VC Application ---> Through POST/GET method post data to server <--> Middle Layer Validate it <---> Store in database!
This article demonstrate Data POST/GET:-
http://www.codeproject.com/internet/amhttputils.asp[^]
For Storing the data in database, Please refer manual of Web language you are using.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
I need to start a timer when a button is pressed and then stop the timer when the button is released.
I think I need to sub-class CButton as dont have the WM_KEYUP or WM_KEYDOWN events in the CButton class.
Can someone point me in the direction of how to sub-class a control in Visual Studio 7.1 please.
Many thanks,
Graham.
grahamfff
|
|
|
|
|
|
write the start timer code and Stop Timer code on the BN_CLICKED event of the button. Change the caption of the button to "STOP TIMER" when the timer starts.
Check the caption of the button before branching to the appropriate code.
|
|
|
|
|
I have a date time stamp which I have read from a file. I have read it as ascii characters and have stored it in a character array as follows:
The data is stored in the reverse order in the file where I read it i.e. [0] [1] [2] [3] [4] [5] [6] [7] has to be reordered as [7] [6] [5] [4] [2] [1] [0]. The bytes are put into a character array as a hexadecimal representation of a timestamp.
(actual example)
dt = "0x01c5556a92792c8c0"
Now in order to pass it to the localtime function I need to convert this ascii hex representation of my timestamp to an int64. I must be having a senior moment but I can't figure out how to do this (seemingly simple) operation.
Could someone more experienced please help me with this?
Thanks
|
|
|
|
|
Maybe not the shortest way, but should work:
__int64 test;
char buf[128];
const char dt[] = "0x01c5556a92792c8c";
memset(buf, 0, sizeof(buf));
for(int i=0;i<8;i++)
{
int n = strlen(dt) - ((i+1)*2);
sprintf(&buf[i*2], "%c%c", dt[n], dt[n+1]);
}
sscanf(buf, "%16I64x", &test);
Kuniva
--------------------------------------------
|
|
|
|
|
Well i have this perfectly terible text type game that, for testing purposes i want to have a DOS version of. (At the moment its just a console app, not DOS compatible)
Here is a sample of the code, and yes its pretty much all like this:
********************************************************************
//The text based carrot game brought to you by me
#include
using namespace std;
int main()
{
char a [50];
char b [50];
char c [50];
char d [50];
char e [50];
char f [50];
char g [50];
char h [50];
char i [50];
char j [50];
char k [50];
cout <<"This game was written by -. HELLO and welcom to the CARROT ADVENTURE TRILOGY wich contains all 3 carrot advantures. Enjoy.";
cout <<"\n\nYou are a carrot with no family and no friends and are rather quite lonely, have a look for an inanimate abject to be your new friend, what can you see?\n";
cin.getline (a,50);
cout <<"\n\nCONGRATULATIONS you have found the ";
cout <
|
|
|
|