|
Hey guys, Check this out,, this is a function that converts a int to a string, it compiles and works fine with VC++.. problem is i need it to compoile on Sun, HP and DEC. I get a compile error <sstream> not found, so i tried using the <strstream> header, when i do that it dosent recognize what std::ostringstream is.. Im totally lost when it comes to unix compilers,, can anyone help me convert this code so unix g++ will understand it and compile it. Pleaseeeee
#include<sstream>
std::string itos(int arg)
{
std::ostringstream buffer;
buffer << arg; return buffer.str();
}
Thank You!
say what?
|
|
|
|
|
hummmm. i guess this dicussion board dosent like the angle brackets, seems whatever is inside them dosent show up on the screen,, anyway i will rewrite this post.
Hey guys, Check this out,, this is a function that converts a int to a string, it compiles and works fine with VC++.. problem is i need it to compile on Sun, HP and DEC. I get a compile error sstream not found, so i tried using the strstream header, when i do that it dosent recognize what std::ostringstream is.. Im totally lost when it comes to unix compilers,, can anyone help me convert this code so unix g++ will understand it and compile it. Pleaseeeee
#include<sstream> //sstream
std::string itos(int arg)
{
std::ostringstream buffer;
buffer << arg;
return buffer.str();
}
Thank You!
say what?
|
|
|
|
|
Not all compilers support have the standard library, and not all of them can support it (especially older compilers).
You need to make sure you're using the most recent compilers from your vendors and if they don't include a standard library, you may need to acquire one.
|
|
|
|
|
Hi
How can I get a type library name (without registring the type library in system registry) after loading this library by
LoadTypeLibEx(szFileName.Copy(), REGKIND_NONE, &hTypeLib);
Thanx
|
|
|
|
|
Hi
How can I get a type library name (without registring the type library in system registry) after loading this library by
LoadTypeLibEx(szFileName.Copy(), REGKIND_NONE, &hTypeLib);
Thanx
|
|
|
|
|
Now I write the program that move the transparent bitmap (sprite) across the screen with MFC (Use BitBlt function) but the problem is when I run program for a while (20 min) the sprite that is moving is disappear from the screen but the program is still running. Do you know what's happen and how can I reslove it?
Thank you
Kyousuke
|
|
|
|
|
are the co-ordinates taking it out of the clipping region?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
No, because I wrote the function that control the sprite to move on the circle line(The train is running on rail). And the sprite move around it several round until from 5:00AM-3:00PM->Simulate time(1 hour Simulate time = 2 min in real world) and after that it disappear.
|
|
|
|
|
Based on the info you given, I am not sure, but this could be a timer fault!
Perhaps you could show the code fragment of the timer function or where you are actually animating the sprite round the circle, may be I could solve it!
In case you cannot send the code, just look into the timer code yourself and see what is happening. For example check how/where are you setting the timers.
|
|
|
|
|
Now, I think that the problem is LoadBitmap function, because I want to flip the train when move to the left/right side of screen. But I don't know which function I must use, so I load new bitmap by "LoadBitmap" instead. And when I remove that part of code, no problem is occur.
Here is my code:
for(i=0;i<totaltraini;i++)
{
if(x1[i]="">34 && x1[i]<354 && f1[i]) {sprite1[i].LoadBitmap(IDB_TRAIN1); f1[i]=false;}
//else if(y1[i]>10 && y1[i]<280 && !f1[i]) {sprite1[i].LoadBitmap(IDB_TRAIN2); f1[i]=true;}
psprite1[i]->DrawTransparent(&memDC, x1[i], y1[i], RGB(0,0,0));
//if(x0[i]>34 && x0[i]<354 && f0[i]) {sprite0[i].LoadBitmap(IDB_TRAIN1); f0[i]=false;}
//else if(y0[i]>10 && y0[i]<280 && !f0[i]) {sprite0[i].LoadBitmap(IDB_TRAIN2); f0[i]=true;}
psprite0[i]->DrawTransparent(&memDC, x0[i], y0[i], RGB(0,0,0));
//if(x[i]>34 && x[i]<354 && y[i]==10 && f[i]) {sprite[i].LoadBitmap(IDB_THEAD2); f[i]=false;}
//else if(y[i]>10 && y[i]<280 && x[i]==34 && !f[i]) {sprite[i].LoadBitmap(IDB_THEAD3); f[i]=true;}
//else if(x[i]>34 && x[i]<354 && y[i]==280 && f[i]) {sprite[i].LoadBitmap(IDB_THEAD4); f[i]=false;}
//else if(y[i]>10 && y[i]<280 && x[i]==354 && !f[i]) {sprite[i].LoadBitmap(IDB_THEAD1); f[i]=true;}
psprite[i]->DrawTransparent(&memDC, x[i], y[i], RGB(0,0,0));
}
** (//) Mean if I remove that line it work perfect.
Do you know which function I should use to flip image or have other way to do?
|
|
|
|
|
Why all this LoadBitmap(..) stuff? Just load the bitmap once and then change its position based on the timer increment.
Put a WM_TIMER message and then inside it move the bitmap around by just passing it X and Y coordinates, the same sprite (bitmap) will just move around. In case you are trying to assign a path as the animation co-ordinates, just create an array of x and y coordinate and just pass then as x[i] and y[i] to the XY coordinate of the bitblits.
This is just the timer fault as I expected. Try the above and it fixes hopefully.
|
|
|
|
|
If you're using BitBlt, you must also be using or building a mask and using 3 blts to build the image, right ? I'd say the problem is that you have a small resource leak, and eventually you are running out of GDI resources, so the drawing comes to a stop, although the program is still trying to work, it has no resources to draw with.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hello,
I will send a key message ('ALT'+'d') to a foreign MFC window to close it.
The foreign window is a dialog window from an application.
The dialog window has one button that must be pressed.
I have the window handle of this window. I try following:
CWnd Wnd;
Wnd.Attach(WindowHdl);
int VkCode=LOWORD(VkKeyScan('d'));
int ScanCode=MapVirtualKey(VkCode,0);
long lParam=65536*ScanCode+1*0x20000000;
Wnd.PostMessage(WB_CHAR,'d',lParam);
Wnd.Detach();
This don't work. Can someone help me.
bye
Christian
|
|
|
|
|
Cool name there BTW.
I'm lost, what are you doing here ? To close this window, do this:
Wnd.DestroyWindow();
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I will be very pleased if you help me with this.
1. How can I open email client (Outlook, TheBat, etc. no matter what is installed) so it displays "New mail" dialog (sending mail)
2. How can I open email client so it displays "Reply" dialog (from, to and subject are passed to it somehow).
Thank you.
|
|
|
|
|
Answer to question #1. is
ShellExecute (m_hWnd, "open", "mailto:", NULL, NULL, SW_SHOW);
|
|
|
|
|
Hello, I need and example code of sorting ListView items by Name, using SortItems() function.
Any help appreciated,
Thanks,
Deian
|
|
|
|
|
OK, bitmaps are just dandy. Most of the time I'm plenty happy enough with them and the standard microsoft static control can be used nicely and easily for drawing a contained bitmap or icon. WHY NOT GIF/JPG?
I'm working on an application that has about 20 pictures I have to display at one point or another. They're all pretty much the same size and all 256 color. Anyway, bitmaps are just too big and adding this in to the resources pushes my exectuable (statically linking MFC) up to almost 5 MEG! A LOT of that is the bitmaps. I really would rather use GIF's. They're a lot smaller and since they can have transparent backgrounds it's easy to have them drawn transparent. It's funny but this is really the first time I've run into this and was actually amazed that it was even an issue.
Where is the MFC standard control for displaying GIF/JPG?!? I MUCH prefer C++ over Visual Basic but the basic picture control for VB does GIF/JPG just fine... easily. Why is this not part of MFC? Does someone know of a simple control I could use without re-inventing the wheel? How about a more advanced version that would resize the picture when I resize the control? How about one that includes "hot spots" where I could pop up messages or do "something" when they roll over it with the mouse?
Make me a believer again that MFC is better than VB... (I'm knocking MFC. NOT C++/COM/ATL/STL, yada yada yada)
Thanks,
Matt Philmon
|
|
|
|
|
I know some of the GDI APIs got JPG support in Win 98. I remember seeing mentions of this in the past, but it was a while ago so I couldn't name exact functions. Search the Platform SDK for "JPEG" and you should be able to find them.
--Mike--
http://home.inreach.com/mdunn/
The preferred snack of 4 out of 5 Lounge readers.
|
|
|
|
|
OLEPicture is the sollution. Search it on MSDN.
|
|
|
|
|
the merging of the two, then all of a sudden it wasn't. I believe this is why it was called W2000, which from a marketing POV makes it the follow on from 95/98.
I think it rocks too, I hate having to use W98 instead, but as it is more unstable, it is better for testing code to make sure IT is stable.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Ooops - if my other post came up, it's because I was trying to click reply on two things at once. I *hate* that IE pops Windows to the top, it is so frustrating sometimes.
The next version of MFC has jpeg/gif/etc support, in the meantime to get more comprehensive control than the control someone else suggested, go to www.apintlib.de, and you'll be able to read/write them and a lot of other formats as well.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
www.paintlib.de you mean no?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Yes, thanks. I actually got an email from the original poster and corrected it in a reply email, but I *should* be more careful, especially with URL's.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I am trying to set the text color of a number of CEdit and CComboBox controls whose state is not Enabled.
I can override the background colour, overrriding the OnCtlColor method, but not the text colour, whatever I
do it uses the SYSTEM Grey Color. I can set the Sytem Grey Color to black, but this effect everything!!
Any ideas would be appreciated
Marc Clarke, marclark@lehman.com
|
|
|
|
|